# HG changeset patch # User KUDr # Date 1145383372 0 # Node ID 1af7d6e9d1bac508f85fcfa810c877f8c9207075 # Parent 6873a46cdf471fe5dad79847dc4b473f01cb0312 (svn r4470) -Fix: FS#97 ? Possible bug in Win64 versions (by michi_cc) Doesn't fix any known bug, but the code is now bit cleaner. The proper result of subtraction of two pointers is ptrdiff_t. diff -r 6873a46cdf47 -r 1af7d6e9d1ba saveload.c --- a/saveload.c Tue Apr 18 17:44:24 2006 +0000 +++ b/saveload.c Tue Apr 18 18:02:52 2006 +0000 @@ -722,7 +722,7 @@ } 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 -r 6873a46cdf47 -r 1af7d6e9d1ba settings.h --- a/settings.h Tue Apr 18 17:44:24 2006 +0000 +++ b/settings.h Tue Apr 18 18:02:52 2006 +0000 @@ -71,7 +71,7 @@ * 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 -r 6873a46cdf47 -r 1af7d6e9d1ba stdafx.h --- a/stdafx.h Tue Apr 18 17:44:24 2006 +0000 +++ b/stdafx.h Tue Apr 18 18:02:52 2006 +0000 @@ -3,6 +3,7 @@ #ifndef STDAFX_H #define STDAFX_H +#include #include #include #include