mirror of https://github.com/OpenTTD/OpenTTD.git
(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.
This commit is contained in:
parent
537e4dba9c
commit
24ef4ce560
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue