Browse Source

common: add fs_size_t typedef, for read()/write() return value

pull/2/head
Alibek Omarov 3 years ago
parent
commit
764ef93984
  1. 1
      common/port.h
  2. 5
      common/xash3d_types.h
  3. 4
      engine/common/filesystem.c

1
common/port.h

@ -137,6 +137,7 @@ GNU General Public License for more details. @@ -137,6 +137,7 @@ GNU General Public License for more details.
#define HAVE_DUP
#endif //WIN32
#ifndef XASH_LOW_MEMORY
#define XASH_LOW_MEMORY 0
#endif

5
common/xash3d_types.h

@ -117,6 +117,11 @@ typedef struct file_s file_t; // normal file @@ -117,6 +117,11 @@ typedef struct file_s file_t; // normal file
typedef struct wfile_s wfile_t; // wad file
typedef struct stream_s stream_t; // sound stream for background music playing
typedef off_t fs_offset_t;
#if XASH_WIN32
typedef int fs_size_t; // return type of _read, _write funcs
#else /* !XASH_WIN32 */
typedef ssize_t fs_size_t;
#endif /* !XASH_WIN32 */
typedef struct dllfunc_s
{

4
engine/common/filesystem.c

@ -606,7 +606,7 @@ pack_t *FS_LoadPackPAK( const char *packfile, int *error ) @@ -606,7 +606,7 @@ pack_t *FS_LoadPackPAK( const char *packfile, int *error )
int i, numpackfiles;
pack_t *pack;
dpackfile_t *info;
ssize_t c;
fs_size_t c;
packhandle = open( packfile, O_RDONLY|O_BINARY );
@ -722,7 +722,7 @@ static zip_t *FS_LoadZip( const char *zipfile, int *error ) @@ -722,7 +722,7 @@ static zip_t *FS_LoadZip( const char *zipfile, int *error )
zipfile_t *info = NULL;
char filename_buffer[MAX_SYSPATH];
zip_t *zip = (zip_t *)Mem_Calloc( fs_mempool, sizeof( *zip ));
ssize_t c;
fs_size_t c;
zip->handle = open( zipfile, O_RDONLY|O_BINARY );

Loading…
Cancel
Save