mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
filesystem: mark some fs ops const
This commit is contained in:
@@ -2834,7 +2834,7 @@ FS_Tell
|
|||||||
Give the current position in a file
|
Give the current position in a file
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
fs_offset_t FS_Tell( file_t *file )
|
fs_offset_t FS_Tell( const file_t *file )
|
||||||
{
|
{
|
||||||
if( !file ) return 0;
|
if( !file ) return 0;
|
||||||
return file->position - file->buff_len + file->buff_ind;
|
return file->position - file->buff_len + file->buff_ind;
|
||||||
@@ -2847,7 +2847,7 @@ FS_Eof
|
|||||||
indicates at reached end of file
|
indicates at reached end of file
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
qboolean FS_Eof( file_t *file )
|
qboolean FS_Eof( const file_t *file )
|
||||||
{
|
{
|
||||||
if( !file ) return true;
|
if( !file ) return true;
|
||||||
return (( file->position - file->buff_len + file->buff_ind ) == file->real_length ) ? true : false;
|
return (( file->position - file->buff_len + file->buff_ind ) == file->real_length ) ? true : false;
|
||||||
@@ -3161,7 +3161,7 @@ FS_FileLength
|
|||||||
return size of file in bytes
|
return size of file in bytes
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
fs_offset_t FS_FileLength( file_t *f )
|
fs_offset_t FS_FileLength( const file_t *f )
|
||||||
{
|
{
|
||||||
if( !f ) return 0;
|
if( !f ) return 0;
|
||||||
return f->real_length;
|
return f->real_length;
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ typedef struct fs_api_t
|
|||||||
fs_offset_t (*Write)( file_t *file, const void *data, size_t datasize );
|
fs_offset_t (*Write)( file_t *file, const void *data, size_t datasize );
|
||||||
fs_offset_t (*Read)( file_t *file, void *buffer, size_t buffersize );
|
fs_offset_t (*Read)( file_t *file, void *buffer, size_t buffersize );
|
||||||
int (*Seek)( file_t *file, fs_offset_t offset, int whence );
|
int (*Seek)( file_t *file, fs_offset_t offset, int whence );
|
||||||
fs_offset_t (*Tell)( file_t *file );
|
fs_offset_t (*Tell)( const file_t *file );
|
||||||
qboolean (*Eof)( file_t *file );
|
qboolean (*Eof)( const 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, char *string, size_t bufsize );
|
int (*Gets)( file_t *file, char *string, size_t bufsize );
|
||||||
@@ -184,7 +184,7 @@ typedef struct fs_api_t
|
|||||||
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_CHECK( 2 );
|
int (*Printf)( file_t *file, const char *format, ... ) FORMAT_CHECK( 2 );
|
||||||
int (*Print)( file_t *file, const char *msg );
|
int (*Print)( file_t *file, const char *msg );
|
||||||
fs_offset_t (*FileLength)( file_t *f );
|
fs_offset_t (*FileLength)( const file_t *f );
|
||||||
qboolean (*FileCopy)( file_t *pOutput, file_t *pInput, int fileSize );
|
qboolean (*FileCopy)( file_t *pOutput, file_t *pInput, int fileSize );
|
||||||
|
|
||||||
// file buffer ops
|
// file buffer ops
|
||||||
|
|||||||
@@ -173,8 +173,8 @@ file_t *FS_Open( const char *filepath, const char *mode, qboolean gamedironly )
|
|||||||
fs_offset_t FS_Write( file_t *file, const void *data, size_t datasize );
|
fs_offset_t FS_Write( file_t *file, const void *data, size_t datasize );
|
||||||
fs_offset_t FS_Read( file_t *file, void *buffer, size_t buffersize );
|
fs_offset_t FS_Read( file_t *file, void *buffer, size_t buffersize );
|
||||||
int FS_Seek( file_t *file, fs_offset_t offset, int whence );
|
int FS_Seek( file_t *file, fs_offset_t offset, int whence );
|
||||||
fs_offset_t FS_Tell( file_t *file );
|
fs_offset_t FS_Tell( const file_t *file );
|
||||||
qboolean FS_Eof( file_t *file );
|
qboolean FS_Eof( const file_t *file );
|
||||||
int FS_Flush( file_t *file );
|
int FS_Flush( file_t *file );
|
||||||
int FS_Gets( file_t *file, char *string, size_t bufsize );
|
int FS_Gets( file_t *file, char *string, size_t bufsize );
|
||||||
int FS_UnGetc( file_t *file, char c );
|
int FS_UnGetc( file_t *file, char c );
|
||||||
@@ -182,7 +182,7 @@ 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_CHECK( 2 );
|
int FS_Printf( file_t *file, const char *format, ... ) FORMAT_CHECK( 2 );
|
||||||
int FS_Print( file_t *file, const char *msg );
|
int FS_Print( file_t *file, const char *msg );
|
||||||
fs_offset_t FS_FileLength( file_t *f );
|
fs_offset_t FS_FileLength( const file_t *f );
|
||||||
qboolean FS_FileCopy( file_t *pOutput, file_t *pInput, int fileSize );
|
qboolean FS_FileCopy( file_t *pOutput, file_t *pInput, int fileSize );
|
||||||
|
|
||||||
// file buffer ops
|
// file buffer ops
|
||||||
|
|||||||
Reference in New Issue
Block a user