@@ -940,13 +940,13 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
940
940
return 0 ;
941
941
942
942
default :
943
- if (dwOptions & (1u << dwOption))
943
+ if (dwOptions & (UINT32_C ( 1 ) << dwOption))
944
944
{
945
945
wprintf (L" ERROR: Duplicate option: `%ls`\n\n " , pArg);
946
946
return 1 ;
947
947
}
948
948
949
- dwOptions |= (1u << dwOption);
949
+ dwOptions |= (UINT32_C ( 1 ) << dwOption);
950
950
break ;
951
951
}
952
952
@@ -1168,7 +1168,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1168
1168
{
1169
1169
const size_t count = conversion.size ();
1170
1170
std::filesystem::path path (pArg);
1171
- SearchForFiles (path.make_preferred (), conversion, (dwOptions & (1u << OPT_RECURSIVE)) != 0 , nullptr );
1171
+ SearchForFiles (path.make_preferred (), conversion, (dwOptions & (UINT32_C ( 1 ) << OPT_RECURSIVE)) != 0 , nullptr );
1172
1172
if (conversion.size () <= count)
1173
1173
{
1174
1174
wprintf (L" No matching files found for %ls\n " , pArg);
@@ -1190,7 +1190,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1190
1190
return 0 ;
1191
1191
}
1192
1192
1193
- if (~dwOptions & (1u << OPT_NOLOGO))
1193
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_NOLOGO))
1194
1194
PrintLogo (false , g_ToolName, g_Description);
1195
1195
1196
1196
switch (dwCommand)
@@ -1245,7 +1245,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1245
1245
outputFile = curpath.stem ().concat (L" .dds" ).native ();
1246
1246
}
1247
1247
1248
- hr = LoadAnimatedGif (curpath.c_str (), loadedImages, (dwOptions & (1u << OPT_GIF_BGCOLOR)) != 0 );
1248
+ hr = LoadAnimatedGif (curpath.c_str (), loadedImages, (dwOptions & (UINT32_C ( 1 ) << OPT_GIF_BGCOLOR)) != 0 );
1249
1249
if (FAILED (hr))
1250
1250
{
1251
1251
wprintf (L" FAILED (%08X%ls)\n " , static_cast <unsigned int >(hr), GetErrorDesc (hr));
@@ -1372,7 +1372,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1372
1372
wprintf (L" \n ERROR: Can't assemble complex surfaces\n " );
1373
1373
return 1 ;
1374
1374
}
1375
- else if ((info.mipLevels > 1 ) && ((dwOptions & (1u << OPT_STRIP_MIPS)) == 0 ))
1375
+ else if ((info.mipLevels > 1 ) && ((dwOptions & (UINT32_C ( 1 ) << OPT_STRIP_MIPS)) == 0 ))
1376
1376
{
1377
1377
switch (dwCommand)
1378
1378
{
@@ -1552,7 +1552,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1552
1552
}
1553
1553
1554
1554
// --- Strip Mips (if requested) -----------------------------------------------
1555
- if ((info.mipLevels > 1 ) && (dwOptions & (1u << OPT_STRIP_MIPS)))
1555
+ if ((info.mipLevels > 1 ) && (dwOptions & (UINT32_C ( 1 ) << OPT_STRIP_MIPS)))
1556
1556
{
1557
1557
std::unique_ptr<ScratchImage> timage (new (std::nothrow) ScratchImage);
1558
1558
if (!timage)
@@ -1602,7 +1602,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1602
1602
}
1603
1603
1604
1604
// --- Undo Premultiplied Alpha (if requested) ---------------------------------
1605
- if ((dwOptions & (1u << OPT_DEMUL_ALPHA))
1605
+ if ((dwOptions & (UINT32_C ( 1 ) << OPT_DEMUL_ALPHA))
1606
1606
&& HasAlpha (info.format )
1607
1607
&& info.format != DXGI_FORMAT_A8_UNORM)
1608
1608
{
@@ -1709,7 +1709,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1709
1709
}
1710
1710
1711
1711
// --- Tonemap (if requested) --------------------------------------------------
1712
- if (dwOptions & (1u << OPT_TONEMAP))
1712
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TONEMAP))
1713
1713
{
1714
1714
std::unique_ptr<ScratchImage> timage (new (std::nothrow) ScratchImage);
1715
1715
if (!timage)
@@ -2049,12 +2049,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2049
2049
wprintf (L" \n " );
2050
2050
fflush (stdout);
2051
2051
2052
- if (dwOptions & (1u << OPT_TOLOWER))
2052
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TOLOWER))
2053
2053
{
2054
2054
std::transform (outputFile.begin (), outputFile.end (), outputFile.begin (), towlower);
2055
2055
}
2056
2056
2057
- if (~dwOptions & (1u << OPT_OVERWRITE))
2057
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_OVERWRITE))
2058
2058
{
2059
2059
if (GetFileAttributesW (outputFile.c_str ()) != INVALID_FILE_ATTRIBUTES)
2060
2060
{
@@ -2117,12 +2117,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2117
2117
wprintf (L" \n " );
2118
2118
fflush (stdout);
2119
2119
2120
- if (dwOptions & (1u << OPT_TOLOWER))
2120
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TOLOWER))
2121
2121
{
2122
2122
std::transform (outputFile.begin (), outputFile.end (), outputFile.begin (), towlower);
2123
2123
}
2124
2124
2125
- if (~dwOptions & (1u << OPT_OVERWRITE))
2125
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_OVERWRITE))
2126
2126
{
2127
2127
if (GetFileAttributesW (outputFile.c_str ()) != INVALID_FILE_ATTRIBUTES)
2128
2128
{
@@ -2186,12 +2186,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2186
2186
wprintf (L" \n " );
2187
2187
fflush (stdout);
2188
2188
2189
- if (dwOptions & (1u << OPT_TOLOWER))
2189
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TOLOWER))
2190
2190
{
2191
2191
std::transform (outputFile.begin (), outputFile.end (), outputFile.begin (), towlower);
2192
2192
}
2193
2193
2194
- if (~dwOptions & (1u << OPT_OVERWRITE))
2194
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_OVERWRITE))
2195
2195
{
2196
2196
if (GetFileAttributesW (outputFile.c_str ()) != INVALID_FILE_ATTRIBUTES)
2197
2197
{
@@ -2385,12 +2385,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2385
2385
wprintf (L" \n " );
2386
2386
fflush (stdout);
2387
2387
2388
- if (dwOptions & (1u << OPT_TOLOWER))
2388
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TOLOWER))
2389
2389
{
2390
2390
std::transform (outputFile.begin (), outputFile.end (), outputFile.begin (), towlower);
2391
2391
}
2392
2392
2393
- if (~dwOptions & (1u << OPT_OVERWRITE))
2393
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_OVERWRITE))
2394
2394
{
2395
2395
if (GetFileAttributesW (outputFile.c_str ()) != INVALID_FILE_ATTRIBUTES)
2396
2396
{
@@ -2400,7 +2400,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2400
2400
}
2401
2401
2402
2402
hr = SaveToDDSFile (result.GetImages (), result.GetImageCount (), result.GetMetadata (),
2403
- (dwOptions & (1u << OPT_USE_DX10)) ? (DDS_FLAGS_FORCE_DX10_EXT | DDS_FLAGS_FORCE_DX10_EXT_MISC2) : DDS_FLAGS_NONE,
2403
+ (dwOptions & (UINT32_C ( 1 ) << OPT_USE_DX10)) ? (DDS_FLAGS_FORCE_DX10_EXT | DDS_FLAGS_FORCE_DX10_EXT_MISC2) : DDS_FLAGS_NONE,
2404
2404
outputFile.c_str ());
2405
2405
if (FAILED (hr))
2406
2406
{
@@ -2443,12 +2443,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2443
2443
wprintf (L" \n " );
2444
2444
fflush (stdout);
2445
2445
2446
- if (dwOptions & (1u << OPT_TOLOWER))
2446
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TOLOWER))
2447
2447
{
2448
2448
std::transform (outputFile.begin (), outputFile.end (), outputFile.begin (), towlower);
2449
2449
}
2450
2450
2451
- if (~dwOptions & (1u << OPT_OVERWRITE))
2451
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_OVERWRITE))
2452
2452
{
2453
2453
if (GetFileAttributesW (outputFile.c_str ()) != INVALID_FILE_ATTRIBUTES)
2454
2454
{
@@ -2458,7 +2458,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2458
2458
}
2459
2459
2460
2460
hr = SaveToDDSFile (result.GetImages (), result.GetImageCount (), result.GetMetadata (),
2461
- (dwOptions & (1u << OPT_USE_DX10)) ? (DDS_FLAGS_FORCE_DX10_EXT | DDS_FLAGS_FORCE_DX10_EXT_MISC2) : DDS_FLAGS_NONE,
2461
+ (dwOptions & (UINT32_C ( 1 ) << OPT_USE_DX10)) ? (DDS_FLAGS_FORCE_DX10_EXT | DDS_FLAGS_FORCE_DX10_EXT_MISC2) : DDS_FLAGS_NONE,
2462
2462
outputFile.c_str ());
2463
2463
if (FAILED (hr))
2464
2464
{
@@ -2532,7 +2532,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2532
2532
2533
2533
case CMD_ARRAY:
2534
2534
case CMD_GIF:
2535
- hr = result.InitializeArrayFromImages (&imageArray[0 ], imageArray.size (), (dwOptions & (1u << OPT_USE_DX10)) != 0 );
2535
+ hr = result.InitializeArrayFromImages (&imageArray[0 ], imageArray.size (), (dwOptions & (UINT32_C ( 1 ) << OPT_USE_DX10)) != 0 );
2536
2536
break ;
2537
2537
2538
2538
case CMD_CUBE:
@@ -2556,12 +2556,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2556
2556
wprintf (L" \n " );
2557
2557
fflush (stdout);
2558
2558
2559
- if (dwOptions & (1u << OPT_TOLOWER))
2559
+ if (dwOptions & (UINT32_C ( 1 ) << OPT_TOLOWER))
2560
2560
{
2561
2561
std::transform (outputFile.begin (), outputFile.end (), outputFile.begin (), towlower);
2562
2562
}
2563
2563
2564
- if (~dwOptions & (1u << OPT_OVERWRITE))
2564
+ if (~dwOptions & (UINT32_C ( 1 ) << OPT_OVERWRITE))
2565
2565
{
2566
2566
if (GetFileAttributesW (outputFile.c_str ()) != INVALID_FILE_ATTRIBUTES)
2567
2567
{
@@ -2571,7 +2571,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2571
2571
}
2572
2572
2573
2573
hr = SaveToDDSFile (result.GetImages (), result.GetImageCount (), result.GetMetadata (),
2574
- (dwOptions & (1u << OPT_USE_DX10)) ? (DDS_FLAGS_FORCE_DX10_EXT | DDS_FLAGS_FORCE_DX10_EXT_MISC2) : DDS_FLAGS_NONE,
2574
+ (dwOptions & (UINT32_C ( 1 ) << OPT_USE_DX10)) ? (DDS_FLAGS_FORCE_DX10_EXT | DDS_FLAGS_FORCE_DX10_EXT_MISC2) : DDS_FLAGS_NONE,
2575
2575
outputFile.c_str ());
2576
2576
if (FAILED (hr))
2577
2577
{
0 commit comments