diff --git a/apps/playback.c b/apps/playback.c index 23d68f4be9..f2e029ba30 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1576,8 +1576,8 @@ static void codec_advance_buffer_callback(size_t amount) int result; LOGFQUEUE("codec >| audio Q_AUDIO_REBUFFER_SEEK"); - result = (int)queue_send(&audio_queue, Q_AUDIO_REBUFFER_SEEK, - (void *)(ci.curpos + amount)); + result = (int)(intptr_t)queue_send(&audio_queue, Q_AUDIO_REBUFFER_SEEK, + (void *)(uintptr_t)(ci.curpos + amount)); switch (result) { @@ -1719,8 +1719,8 @@ static bool codec_seek_buffer_callback(size_t newpos) int result; LOGFQUEUE("codec >| audio Q_AUDIO_REBUFFER_SEEK"); - result = (int)queue_send(&audio_queue, Q_AUDIO_REBUFFER_SEEK, - (void *)newpos); + result = (int)(intptr_t)queue_send(&audio_queue, Q_AUDIO_REBUFFER_SEEK, + (void *)(uintptr_t)newpos); switch (result) { @@ -1855,7 +1855,8 @@ static bool codec_load_next_track(void) trigger_cpu_boost(); LOGFQUEUE("codec >| audio Q_AUDIO_CHECK_NEW_TRACK"); - result = (int)queue_send(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, NULL); + result = (int)(intptr_t)queue_send(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, + NULL); #if 0 /* Q_CODEC_REQUEST_PENDING never posted anyway */ while (1) @@ -3625,12 +3626,12 @@ static void audio_thread(void) case Q_AUDIO_REBUFFER_SEEK: LOGFQUEUE("audio < Q_AUDIO_REBUFFER_SEEK"); - result = (void *)audio_rebuffer_and_seek((size_t)ev.data); + result = (void *)(intptr_t)audio_rebuffer_and_seek((size_t)ev.data); break; case Q_AUDIO_CHECK_NEW_TRACK: LOGFQUEUE("audio < Q_AUDIO_CHECK_NEW_TRACK"); - result = (void *)audio_check_new_track(); + result = (void *)(intptr_t)audio_check_new_track(); break; case Q_AUDIO_DIR_SKIP: diff --git a/apps/plugins/doom/d_deh.c b/apps/plugins/doom/d_deh.c index 2aa9b83422..632146868e 100755 --- a/apps/plugins/doom/d_deh.c +++ b/apps/plugins/doom/d_deh.c @@ -1466,7 +1466,7 @@ void ProcessDehFile(const char *filename, const char *outfilename, int lumpnum) // killough 10/98: allow DEH files to come from wad lumps if (filename) { - if ((int)(infile.inp = (void *) open(filename,O_RDONLY))<0) + if ((intptr_t)(infile.inp = (void *)(intptr_t)open(filename,O_RDONLY))<0) { printf( "-deh file %s not found\n",filename); return; // should be checked up front anyway @@ -1558,7 +1558,7 @@ void ProcessDehFile(const char *filename, const char *outfilename, int lumpnum) if (infile.lump) W_UnlockLumpNum(lumpnum); // Mark purgable else - close((int) infile.inp); // Close real file + close((int)(intptr_t) infile.inp); // Close real file close(fileout); } diff --git a/firmware/include/inttypes.h b/firmware/include/inttypes.h index 6127485a8a..e23e1da960 100644 --- a/firmware/include/inttypes.h +++ b/firmware/include/inttypes.h @@ -36,6 +36,8 @@ #if ULONG_MAX == 0xfffffffful #define int32_t long #define uint32_t unsigned long +#define intptr_t long +#define uintptr_t unsigned long #elif UINT_MAX == 0xffffffffu #define int32_t int #define uint32_t unsigned int @@ -45,6 +47,8 @@ #if ULONG_MAX == 0xffffffffffffffffull #define int64_t long #define uint64_t unsigned long +#define intptr_t long +#define uintptr_t unsigned long #else #define int64_t long long #define uint64_t unsigned long long