Commit d7fca891 authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid non-portable long long constants.

parent f93256a5
...@@ -235,8 +235,8 @@ static void test_RtlUlonglongByteSwap(void) ...@@ -235,8 +235,8 @@ static void test_RtlUlonglongByteSwap(void)
{ {
ULONGLONG result; ULONGLONG result;
result = pRtlUlonglongByteSwap(0x7654321087654321); result = pRtlUlonglongByteSwap( ((ULONGLONG)0x76543210 << 32) | 0x87654321 );
ok(0x2143658710325476 == result, ok( (((ULONGLONG)0x21436587 << 32) | 0x10325476) == result,
"RtlUlonglongByteSwap(0x7654321087654321) returns 0x%llx, expected 0x2143658710325476", "RtlUlonglongByteSwap(0x7654321087654321) returns 0x%llx, expected 0x2143658710325476",
result); result);
} }
......
...@@ -2206,23 +2206,29 @@ LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) ...@@ -2206,23 +2206,29 @@ LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
static const char sz3_1[] = "%3.1f"; static const char sz3_1[] = "%3.1f";
static const char sz3_2[] = "%3.2f"; static const char sz3_2[] = "%3.2f";
#define KB ((ULONGLONG)1024)
#define MB (KB*KB)
#define GB (KB*KB*KB)
#define TB (KB*KB*KB*KB)
#define PB (KB*KB*KB*KB*KB)
static const SHLWAPI_BYTEFORMATS bfFormats[] = static const SHLWAPI_BYTEFORMATS bfFormats[] =
{ {
{ 10240, 10.24, 100.0, sz3_2, 'K' }, /* 10 KB */ { 10*KB, 10.24, 100.0, sz3_2, 'K' }, /* 10 KB */
{ 102400, 102.4, 10.0, sz3_1, 'K' }, /* 100 KB */ { 100*KB, 102.4, 10.0, sz3_1, 'K' }, /* 100 KB */
{ 1024000, 1024.0, 1.0, sz3_0, 'K' }, /* 1000 KB */ { 1000*KB, 1024.0, 1.0, sz3_0, 'K' }, /* 1000 KB */
{ 10485760, 10485.76, 100.0, sz3_2, 'M' }, /* 10 MB */ { 10*MB, 10485.76, 100.0, sz3_2, 'M' }, /* 10 MB */
{ 104857600, 104857.6, 10.0, sz3_1, 'M' }, /* 100 MB */ { 100*MB, 104857.6, 10.0, sz3_1, 'M' }, /* 100 MB */
{ 1048576000, 1048576.0, 1.0, sz3_0, 'M' }, /* 1000 MB */ { 1000*MB, 1048576.0, 1.0, sz3_0, 'M' }, /* 1000 MB */
{ 10737418240, 10737418.24, 100.0, sz3_2, 'G' }, /* 10 GB */ { 10*GB, 10737418.24, 100.0, sz3_2, 'G' }, /* 10 GB */
{ 107374182400, 107374182.4, 10.0, sz3_1, 'G' }, /* 100 GB */ { 100*GB, 107374182.4, 10.0, sz3_1, 'G' }, /* 100 GB */
{ 1073741824000, 1073741824.0, 1.0, sz3_0, 'G' }, /* 1000 GB */ { 1000*GB, 1073741824.0, 1.0, sz3_0, 'G' }, /* 1000 GB */
{ 10995116277760, 10485.76, 100.0, sz3_2, 'T' }, /* 10 TB */ { 10*TB, 10485.76, 100.0, sz3_2, 'T' }, /* 10 TB */
{ 109951162777600, 104857.6, 10.0, sz3_1, 'T' }, /* 100 TB */ { 100*TB, 104857.6, 10.0, sz3_1, 'T' }, /* 100 TB */
{ 1099511627776000, 1048576.0, 1.0, sz3_0, 'T' }, /* 1000 TB */ { 1000*TB, 1048576.0, 1.0, sz3_0, 'T' }, /* 1000 TB */
{ 11258999068426240, 10737418.24, 100.00, sz3_2, 'P' }, /* 10 PB */ { 10*PB, 10737418.24, 100.00, sz3_2, 'P' }, /* 10 PB */
{ 112589990684262400, 107374182.4, 10.00, sz3_1, 'P' }, /* 100 PB */ { 100*PB, 107374182.4, 10.00, sz3_1, 'P' }, /* 100 PB */
{ 1125899906842624000, 1073741824.0, 1.00, sz3_0, 'P' }, /* 1000 PB */ { 1000*PB, 1073741824.0, 1.00, sz3_0, 'P' }, /* 1000 PB */
{ 0, 10995116277.76, 100.00, sz3_2, 'E' } /* EB's, catch all */ { 0, 10995116277.76, 100.00, sz3_2, 'E' } /* EB's, catch all */
}; };
char szBuff[32]; char szBuff[32];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment