]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
changed some things to size_t to reduce warnings on MSVC x64
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jul 2005 09:10:43 +0000 (09:10 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jul 2005 09:10:43 +0000 (09:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5492 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.h
snd_mix.c
snd_ogg.c
sys_win.c
zone.c
zone.h

index d2e37f39051b49b14596894895870383b25953c6..2df365408e323dec050c279c7104eb309d1acea1 100644 (file)
@@ -80,9 +80,9 @@ typedef struct
        int                             master_vol;             // 0-255 master volume
        int                             leftvol;                // 0-255 volume
        int                             rightvol;               // 0-255 volume
        int                             master_vol;             // 0-255 master volume
        int                             leftvol;                // 0-255 volume
        int                             rightvol;               // 0-255 volume
-       int                             end;                    // end time in global paintsamples
-       int                             lastptime;              // last time this channel was painted
-       int                             pos;                    // sample position in sfx
+       size_t                  end;                    // end time in global paintsamples
+       size_t                  lastptime;              // last time this channel was painted
+       size_t                  pos;                    // sample position in sfx
        int                             entnum;                 // to allow overriding a specific sound
        int                             entchannel;
        vec3_t                  origin;                 // origin of sound effect
        int                             entnum;                 // to allow overriding a specific sound
        int                             entchannel;
        vec3_t                  origin;                 // origin of sound effect
index 2f1a7d43d200c9d3e70464edbd3096c844993915..2315f7c9fc22aeeb83efaeecfea6d27ff827a490 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -238,9 +238,7 @@ void S_PaintChannels(int endtime)
                        // if the channel is paused
                        if (ch->flags & CHANNELFLAG_PAUSED)
                        {
                        // if the channel is paused
                        if (ch->flags & CHANNELFLAG_PAUSED)
                        {
-                               size_t pausedtime;
-
-                               pausedtime = end - paintedtime;
+                               int pausedtime = end - paintedtime;
                                ch->lastptime += pausedtime;
                                ch->end += pausedtime;
                                continue;
                                ch->lastptime += pausedtime;
                                ch->end += pausedtime;
                                continue;
index 73aa52f7132f96f2d492918361fb8cb4e23ef475..61085b6e8f55d2a0623e503da0dd02cd1a66ebd9 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -452,7 +452,7 @@ static const sfxbuffer_t* OGG_FetchSound (channel_t* ch, unsigned int start, uns
        if (sb->offset <= start && sb->offset + sb->length >= start + nbsamples)
                return sb;
 
        if (sb->offset <= start && sb->offset + sb->length >= start + nbsamples)
                return sb;
 
-       newlength = sb->offset + sb->length - start;
+       newlength = (int)(sb->offset + sb->length) - start;
 
        // If we need to skip some data before decompressing the rest, or if the stream has looped
        if (newlength < 0 || sb->offset > start)
 
        // If we need to skip some data before decompressing the rest, or if the stream has looped
        if (newlength < 0 || sb->offset > start)
@@ -492,8 +492,8 @@ static const sfxbuffer_t* OGG_FetchSound (channel_t* ch, unsigned int start, uns
                done += ret;
 
        // Resample in the sfxbuffer
                done += ret;
 
        // Resample in the sfxbuffer
-       newlength = ResampleSfx (resampling_buffer, (size_t)done / factor, &per_sfx->format, sb->data + sb->length * factor, sfx->name);
-       sb->length += newlength;
+       newlength = ResampleSfx (resampling_buffer, (size_t)done / (size_t)factor, &per_sfx->format, sb->data + sb->length * factor, sfx->name);
+       sb->length += newlength;
 
        return sb;
 }
 
        return sb;
 }
index 71aae138c65c3e6f9c7aa8f8247270d21217f7f6..c0ae22af3006c3230409385a0cc0dbb763e418b1 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -108,7 +108,7 @@ void Sys_PrintToTerminal(const char *text)
        DWORD dummy;
        extern HANDLE houtput;
        if (cls.state == ca_dedicated)
        DWORD dummy;
        extern HANDLE houtput;
        if (cls.state == ca_dedicated)
-               WriteFile(houtput, text, strlen (text), &dummy, NULL);
+               WriteFile(houtput, text, (DWORD) strlen(text), &dummy, NULL);
 }
 
 /*
 }
 
 /*
@@ -316,6 +316,9 @@ void Sys_InitConsole (void)
                hinput = GetStdHandle (STD_INPUT_HANDLE);
                houtput = GetStdHandle (STD_OUTPUT_HANDLE);
 
                hinput = GetStdHandle (STD_INPUT_HANDLE);
                houtput = GetStdHandle (STD_OUTPUT_HANDLE);
 
+#ifdef WIN64
+#define atoi _atoi64
+#endif
        // give QHOST a chance to hook into the console
                if ((t = COM_CheckParm ("-HFILE")) > 0)
                {
        // give QHOST a chance to hook into the console
                if ((t = COM_CheckParm ("-HFILE")) > 0)
                {
diff --git a/zone.c b/zone.c
index d8c54d0aa4b7730eff9385b9399eb84a38de25c8..309658339089c025b16db7d6d470b59b6608f98a 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -26,7 +26,7 @@ cvar_t developer_memorydebug = {0, "developer_memorydebug", "0"};
 
 mempool_t *poolchain = NULL;
 
 
 mempool_t *poolchain = NULL;
 
-void *_Mem_Alloc(mempool_t *pool, int size, const char *filename, int fileline)
+void *_Mem_Alloc(mempool_t *pool, size_t size, const char *filename, int fileline)
 {
 #if MEMCLUMPING
        int i, j, k, needed, endbit, largest;
 {
 #if MEMCLUMPING
        int i, j, k, needed, endbit, largest;
diff --git a/zone.h b/zone.h
index 3410c0ecc226517e61843e99d6a2e3af6d3303ab..1d4118479a7be75f6265229994924853b6451cf8 100644 (file)
--- a/zone.h
+++ b/zone.h
@@ -125,7 +125,7 @@ mempool_t;
 #define Mem_FreePool(pool) _Mem_FreePool(pool, __FILE__, __LINE__)
 #define Mem_EmptyPool(pool) _Mem_EmptyPool(pool, __FILE__, __LINE__)
 
 #define Mem_FreePool(pool) _Mem_FreePool(pool, __FILE__, __LINE__)
 #define Mem_EmptyPool(pool) _Mem_EmptyPool(pool, __FILE__, __LINE__)
 
-void *_Mem_Alloc(mempool_t *pool, int size, const char *filename, int fileline);
+void *_Mem_Alloc(mempool_t *pool, size_t size, const char *filename, int fileline);
 void _Mem_Free(void *data, const char *filename, int fileline);
 mempool_t *_Mem_AllocPool(const char *name, int flags, mempool_t *parent, const char *filename, int fileline);
 void _Mem_FreePool(mempool_t **pool, const char *filename, int fileline);
 void _Mem_Free(void *data, const char *filename, int fileline);
 mempool_t *_Mem_AllocPool(const char *name, int flags, mempool_t *parent, const char *filename, int fileline);
 void _Mem_FreePool(mempool_t **pool, const char *filename, int fileline);