filesystem: fix wrong data type for character in Gets and Ungetc
This commit is contained in:
parent
41025c0049
commit
eb0686fca1
3 changed files with 7 additions and 10 deletions
|
@ -33,9 +33,6 @@ GNU General Public License for more details.
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#if XASH_LINUX
|
|
||||||
#include <sys/inotify.h>
|
|
||||||
#endif
|
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "crtlib.h"
|
#include "crtlib.h"
|
||||||
|
@ -2106,7 +2103,7 @@ FS_UnGetc
|
||||||
Put a character back into the read buffer (only supports one character!)
|
Put a character back into the read buffer (only supports one character!)
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
int FS_UnGetc( file_t *file, byte c )
|
int FS_UnGetc( file_t *file, char c )
|
||||||
{
|
{
|
||||||
// If there's already a character waiting to be read
|
// If there's already a character waiting to be read
|
||||||
if( file->ungetc != EOF )
|
if( file->ungetc != EOF )
|
||||||
|
@ -2123,7 +2120,7 @@ FS_Gets
|
||||||
Same as fgets
|
Same as fgets
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
int FS_Gets( file_t *file, byte *string, size_t bufsize )
|
int FS_Gets( file_t *file, char *string, size_t bufsize )
|
||||||
{
|
{
|
||||||
int c, end = 0;
|
int c, end = 0;
|
||||||
|
|
||||||
|
@ -2145,7 +2142,7 @@ int FS_Gets( file_t *file, byte *string, size_t bufsize )
|
||||||
c = FS_Getc( file );
|
c = FS_Getc( file );
|
||||||
|
|
||||||
if( c != '\n' )
|
if( c != '\n' )
|
||||||
FS_UnGetc( file, (byte)c );
|
FS_UnGetc( file, c );
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
|
|
|
@ -155,8 +155,8 @@ typedef struct fs_api_t
|
||||||
qboolean (*Eof)( file_t *file );
|
qboolean (*Eof)( file_t *file );
|
||||||
int (*Flush)( file_t *file );
|
int (*Flush)( file_t *file );
|
||||||
int (*Close)( file_t *file );
|
int (*Close)( file_t *file );
|
||||||
int (*Gets)( file_t *file, byte *string, size_t bufsize );
|
int (*Gets)( file_t *file, char *string, size_t bufsize );
|
||||||
int (*UnGetc)( file_t *file, byte c );
|
int (*UnGetc)( file_t *file, char c );
|
||||||
int (*Getc)( file_t *file );
|
int (*Getc)( file_t *file );
|
||||||
int (*VPrintf)( file_t *file, const char *format, va_list ap );
|
int (*VPrintf)( file_t *file, const char *format, va_list ap );
|
||||||
int (*Printf)( file_t *file, const char *format, ... ) _format( 2 );
|
int (*Printf)( file_t *file, const char *format, ... ) _format( 2 );
|
||||||
|
|
|
@ -144,8 +144,8 @@ fs_offset_t FS_Tell( file_t *file );
|
||||||
qboolean FS_Eof( file_t *file );
|
qboolean FS_Eof( file_t *file );
|
||||||
int FS_Flush( file_t *file );
|
int FS_Flush( file_t *file );
|
||||||
int FS_Close( file_t *file );
|
int FS_Close( file_t *file );
|
||||||
int FS_Gets( file_t *file, byte *string, size_t bufsize );
|
int FS_Gets( file_t *file, char *string, size_t bufsize );
|
||||||
int FS_UnGetc( file_t *file, byte c );
|
int FS_UnGetc( file_t *file, char c );
|
||||||
int FS_Getc( file_t *file );
|
int FS_Getc( file_t *file );
|
||||||
int FS_VPrintf( file_t *file, const char *format, va_list ap );
|
int FS_VPrintf( file_t *file, const char *format, va_list ap );
|
||||||
int FS_Printf( file_t *file, const char *format, ... ) _format( 2 );
|
int FS_Printf( file_t *file, const char *format, ... ) _format( 2 );
|
||||||
|
|
Loading…
Add table
Reference in a new issue