From 30334016020f54bb93999010bed118f5605b06bd Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 5 Jul 2005 09:10:43 +0000 Subject: [PATCH] changed some things to size_t to reduce warnings on MSVC x64 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5492 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_main.h | 6 +++--- snd_mix.c | 4 +--- snd_ogg.c | 6 +++--- sys_win.c | 5 ++++- zone.c | 2 +- zone.h | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/snd_main.h b/snd_main.h index d2e37f39..2df36540 100644 --- a/snd_main.h +++ b/snd_main.h @@ -80,9 +80,9 @@ typedef struct 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 diff --git a/snd_mix.c b/snd_mix.c index 2f1a7d43..2315f7c9 100644 --- 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) { - size_t pausedtime; - - pausedtime = end - paintedtime; + int pausedtime = end - paintedtime; ch->lastptime += pausedtime; ch->end += pausedtime; continue; diff --git a/snd_ogg.c b/snd_ogg.c index 73aa52f7..61085b6e 100644 --- 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; - 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) @@ -492,8 +492,8 @@ static const sfxbuffer_t* OGG_FetchSound (channel_t* ch, unsigned int start, uns 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; } diff --git a/sys_win.c b/sys_win.c index 71aae138..c0ae22af 100644 --- 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) - 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); +#ifdef WIN64 +#define atoi _atoi64 +#endif // give QHOST a chance to hook into the console if ((t = COM_CheckParm ("-HFILE")) > 0) { diff --git a/zone.c b/zone.c index d8c54d0a..30965833 100644 --- a/zone.c +++ b/zone.c @@ -26,7 +26,7 @@ cvar_t developer_memorydebug = {0, "developer_memorydebug", "0"}; 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; diff --git a/zone.h b/zone.h index 3410c0ec..1d411847 100644 --- 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__) -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); -- 2.39.2