summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saveload.c2
-rw-r--r--settings.h2
-rw-r--r--stdafx.h1
3 files changed, 3 insertions, 2 deletions
diff --git a/saveload.c b/saveload.c
index 39e3d2591..4a5470cb9 100644
--- a/saveload.c
+++ b/saveload.c
@@ -722,7 +722,7 @@ void SlObject(void *object, const SaveLoad *sld)
}
for (; sld->cmd != SL_END; sld++) {
- void *ptr = (byte*)object + (unsigned long)sld->address;
+ void *ptr = (byte*)object + (ptrdiff_t)sld->address;
SlObjectMember(ptr, sld);
}
}
diff --git a/settings.h b/settings.h
index 1c95601da..d8d83c6e2 100644
--- a/settings.h
+++ b/settings.h
@@ -71,7 +71,7 @@ typedef enum {
* to add this to the address of the object */
static inline void *ini_get_variable(const SaveLoad *sld, const void *object)
{
- return (object == NULL) ? sld->address : (byte*)object + (unsigned long)sld->address;
+ return (object == NULL) ? sld->address : (byte*)object + (ptrdiff_t)sld->address;
}
void IConsoleSetPatchSetting(const char *name, const char *value);
diff --git a/stdafx.h b/stdafx.h
index 21444ef70..a8600d9b5 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -3,6 +3,7 @@
#ifndef STDAFX_H
#define STDAFX_H
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>