Mercurial > hg > openttd
changeset 2923:041f961333fd draft
(svn r3479) -Fix: fixed warnings on 64bit platforms (anyway, most 64bit platforms)
(tnx to qball and DarkVater for testing)
author | truelight <truelight@openttd.org> |
---|---|
date | Sun, 29 Jan 2006 20:32:30 +0000 |
parents | b181ae766bb6 |
children | fe7b46599424 |
files | settings.c |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/settings.c +++ b/settings.c @@ -491,7 +491,7 @@ static const void *string_to_val(const SettingDesc *desc, const char *str) { - uint32 val; + unsigned long val; char *end; switch(desc->flags & 0xF) { @@ -500,14 +500,14 @@ if (*end != 0) ShowInfoF("ini: trailing characters at end of setting '%s'", desc->name); return (void*)val; case SDT_ONEOFMANY: { - int r = lookup_oneofmany((const char*)desc->b, str, -1); + long r = lookup_oneofmany((const char*)desc->b, str, -1); if (r != -1) return (void*)r; ShowInfoF("ini: invalid value '%s' for '%s'", str, desc->name); return 0; } case SDT_MANYOFMANY: { - uint32 r = lookup_manyofmany(desc->b, str); - if (r != (uint32)-1) return (void*)r; + unsigned long r = lookup_manyofmany(desc->b, str); + if (r != (unsigned long)-1) return (void*)r; ShowInfoF("ini: invalid value '%s' for '%s'", str, desc->name); return 0; } @@ -567,15 +567,15 @@ switch(desc->flags >> 4 & 7) { case SDT_INT8 >> 4: case SDT_UINT8 >> 4: - *(byte*)ptr = (byte)(uint)p; + *(byte*)ptr = (byte)(unsigned long)p; break; case SDT_INT16 >> 4: case SDT_UINT16 >> 4: - *(uint16*)ptr = (uint16)(uint)p; + *(uint16*)ptr = (uint16)(unsigned long)p; break; case SDT_INT32 >> 4: case SDT_UINT32 >> 4: - *(uint32*)ptr = (uint32)p; + *(uint32*)ptr = (uint32)(unsigned long)p; break; default: NOT_REACHED(); @@ -648,17 +648,17 @@ switch(desc->flags >> 4 & 7) { case SDT_INT8 >> 4: case SDT_UINT8 >> 4: - if (*(byte*)ptr == (byte)(uint)p) + if (*(byte*)ptr == (byte)(unsigned long)p) continue; break; case SDT_INT16 >> 4: case SDT_UINT16 >> 4: - if (*(uint16*)ptr == (uint16)(uint)p) + if (*(uint16*)ptr == (uint16)(unsigned long)p) continue; break; case SDT_INT32 >> 4: case SDT_UINT32 >> 4: - if (*(uint32*)ptr == (uint32)p) + if (*(uint32*)ptr == (uint32)(unsigned long)p) continue; break; default: