filesystem: mark some fs ops const

This commit is contained in:
Alibek Omarov
2026-03-16 22:31:36 +05:00
parent d8b784482e
commit f42e2f59b7
3 changed files with 9 additions and 9 deletions

View File

@@ -2834,7 +2834,7 @@ FS_Tell
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;
return file->position - file->buff_len + file->buff_ind;
@@ -2847,7 +2847,7 @@ FS_Eof
indicates at reached end of file
====================
*/
qboolean FS_Eof( file_t *file )
qboolean FS_Eof( const file_t *file )
{
if( !file ) return true;
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
==================
*/
fs_offset_t FS_FileLength( file_t *f )
fs_offset_t FS_FileLength( const file_t *f )
{
if( !f ) return 0;
return f->real_length;

View File

@@ -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 (*Read)( file_t *file, void *buffer, size_t buffersize );
int (*Seek)( file_t *file, fs_offset_t offset, int whence );
fs_offset_t (*Tell)( file_t *file );
qboolean (*Eof)( file_t *file );
fs_offset_t (*Tell)( const file_t *file );
qboolean (*Eof)( const file_t *file );
int (*Flush)( file_t *file );
int (*Close)( file_t *file );
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 (*Printf)( file_t *file, const char *format, ... ) FORMAT_CHECK( 2 );
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 );
// file buffer ops

View File

@@ -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_Read( file_t *file, void *buffer, size_t buffersize );
int FS_Seek( file_t *file, fs_offset_t offset, int whence );
fs_offset_t FS_Tell( file_t *file );
qboolean FS_Eof( file_t *file );
fs_offset_t FS_Tell( const file_t *file );
qboolean FS_Eof( const file_t *file );
int FS_Flush( file_t *file );
int FS_Gets( file_t *file, char *string, size_t bufsize );
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_Printf( file_t *file, const char *format, ... ) FORMAT_CHECK( 2 );
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 );
// file buffer ops