From: Tim Mann Date: Tue, 15 Feb 2005 05:57:42 +0000 (+0000) Subject: 64-bit constants need an ll, ull, i64, or ui64 suffix. X-Git-Tag: v4.2.8~14 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6199d0ab0a5f9c02221817537c0f8b691c957247;p=xboard.git 64-bit constants need an ll, ull, i64, or ui64 suffix. --- diff --git a/backend.c b/backend.c index f1a79d2..4bec193 100644 --- a/backend.c +++ b/backend.c @@ -273,9 +273,9 @@ double u64ToDouble(u64 value) { double r; - u64 tmp = value & 0x7fffffffffffffff; + u64 tmp = value & u64Const(0x7fffffffffffffff); r = (double)(s64)tmp; - if (value & 0x8000000000000000) + if (value & u64Const(0x8000000000000000)) r += 9.2233720368547758080e18; /* 2^63 */ return r; } diff --git a/backend.h b/backend.h index 244838d..f782f83 100644 --- a/backend.h +++ b/backend.h @@ -183,22 +183,31 @@ int ics_type; * This is for MS Visual Studio */ #ifdef _MSC_VER - #define u64 unsigned __int64 + #define u64 unsigned __int64 #define s64 signed __int64 - #define u64Display "%I64u" + #define u64Display "%I64u" + #define s64Display "%I64d" + #define u64Const(c) (c ## UI64) + #define s64Const(c) (c ## I64) #else /* place holder * or dummy types for other compiler */ - #define u64 unsigned __int64 + #define u64 unsigned __int64 #define s64 signed __int64 - #define u64Display "%I64u" + #define u64Display "%I64u" + #define s64Display "%I64d" + #define u64Const(c) (c ## UI64) + #define s64Const(c) (c ## I64) #endif #else /* GNU gcc */ - #define u64 unsigned long long + #define u64 unsigned long long #define s64 signed long long - #define u64Display "%llu" + #define u64Display "%llu" + #define s64Display "%lld" + #define u64Const(c) (c ## ull) + #define s64Const(c) (c ## ll) #endif