don't use ssize_t
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 24 Dec 2009 17:06:38 +0000 (17:06 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 24 Dec 2009 17:06:38 +0000 (17:06 +0000)
removed ssize_t from qtypes.h

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9680 d7cf8633-e32d-0410-b094-e92efae38249

fs.c
prvm_edict.c
qtypes.h
sys_linux.c

diff --git a/fs.c b/fs.c
index 8092ee1..273b089 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -549,7 +549,7 @@ int PK3_BuildFileList (pack_t *pack, const pk3_endOfCentralDir_t *eocd)
        // Load the central directory in memory
        central_dir = (unsigned char *)Mem_Alloc (tempmempool, eocd->cdir_size);
        lseek (pack->handle, eocd->cdir_offset, SEEK_SET);
-       if(read (pack->handle, central_dir, eocd->cdir_size) != (ssize_t) eocd->cdir_size)
+       if(read (pack->handle, central_dir, eocd->cdir_size) != (fs_offset_t) eocd->cdir_size)
        {
                Mem_Free (central_dir);
                return -1;
index eff8d5a..dbbff6a 100644 (file)
@@ -1928,7 +1928,7 @@ po_t *PRVM_PO_Load(const char *filename, mempool_t *pool)
                                --q;
                        if(*(q-1) != '"')
                                break;
-                       if(q - p >= (ssize_t) sizeof(inbuf))
+                       if((size_t)(q - p) >= (size_t) sizeof(inbuf))
                                break;
                        strlcpy(inbuf, p, q - p); // not - 1, because this adds a NUL
                        PRVM_PO_ParseString(decodedbuf + decodedpos, inbuf, sizeof(decodedbuf) - decodedpos);
index a945785..3a481ca 100644 (file)
--- a/qtypes.h
+++ b/qtypes.h
@@ -11,10 +11,6 @@ typedef enum qboolean_e {false, true} qboolean;
 typedef bool qboolean;
 #endif
 
-#if defined(WIN32)
-# define ssize_t long
-#endif
-
 #ifndef NULL
 #define NULL ((void *)0)
 #endif
index 6df93c5..c274cf3 100644 (file)
@@ -71,7 +71,7 @@ void Sys_PrintToTerminal(const char *text)
 #endif
        while(*text)
        {
-               ssize_t written = write(1, text, strlen(text));
+               fs_offset_t written = (fs_offset_t)write(1, text, strlen(text));
                if(written <= 0)
                        break; // sorry, I cannot do anything about this error - without an output
                text += written;