ref: 6812a5896abf0f78fa45ed14d4b4a7e6f2f4d310
parent: 63df9283035b7f221dcef0cd5d1e488da3af12b6
author: Fabian Greffrath <fabian@greffrath.com>
date: Mon May 4 03:55:15 EDT 2015
warnings: fix some cast to/from pointer from/to int warnings This fixes the following two warnings cast from pointer to integer of different size cast to pointer from integer of different size by either changing some ints that are supposed to hold pointers to intptr_t type or by intermediate casting to (intptr_t).
--- a/src/doom/p_maputl.c
+++ b/src/doom/p_maputl.c
@@ -846,7 +846,7 @@
InterceptsMemoryOverrun(location, intercept->frac);
InterceptsMemoryOverrun(location + 4, intercept->isaline);
- InterceptsMemoryOverrun(location + 8, (int) intercept->d.thing);
+ InterceptsMemoryOverrun(location + 8, (intptr_t) intercept->d.thing);
}
--- a/src/doom/p_saveg.c
+++ b/src/doom/p_saveg.c
@@ -184,12 +184,12 @@
static void *saveg_readp(void)
{
- return (void *) saveg_read32();
+ return (void *) (intptr_t) saveg_read32();
}
static void saveg_writep(void *p)
{
- saveg_write32((int) p);
+ saveg_write32((intptr_t) p);
}
// Enum values are 32-bit integers.
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -355,7 +355,7 @@
{
int l;
- l = (int) val;
+ l = (intptr_t) val;
warpepisode = l / 10;
warpmap = l % 10;
@@ -367,7 +367,7 @@
{
int l;
- l = (int) val;
+ l = (intptr_t) val;
warpmap = l;
@@ -389,8 +389,8 @@
const iwad_t *iwad;
char buf[10];
int episodes;
- int x, y;
- int l;
+ intptr_t x, y;
+ intptr_t l;
int i;
window = TXT_NewWindow("Select level");
--- a/src/strife/p_saveg.c
+++ b/src/strife/p_saveg.c
@@ -186,12 +186,12 @@
static void *saveg_readp(void)
{
- return (void *) saveg_read32();
+ return (void *) (intptr_t) saveg_read32();
}
static void saveg_writep(void *p)
{
- saveg_write32((int) p);
+ saveg_write32((intptr_t) p);
}
// Enum values are 32-bit integers.