mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
Code review for const auto vs auto const (#579)
This commit is contained in:
@@ -183,7 +183,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@@ -294,7 +294,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
ddsData.reset();
|
||||
@@ -1751,7 +1751,7 @@ namespace
|
||||
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
|
||||
{
|
||||
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>(reinterpret_cast<const uint8_t*>(header) + sizeof(DDS_HEADER));
|
||||
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
switch (mode)
|
||||
{
|
||||
case DDS_ALPHA_MODE_STRAIGHT:
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@@ -380,7 +380,7 @@ namespace
|
||||
#endif
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
ddsData.reset();
|
||||
@@ -1623,7 +1623,7 @@ namespace
|
||||
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
|
||||
{
|
||||
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>(reinterpret_cast<const uint8_t*>(header) + sizeof(DDS_HEADER));
|
||||
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
switch (mode)
|
||||
{
|
||||
case DDS_ALPHA_MODE_STRAIGHT:
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@@ -259,7 +259,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
ddsData.reset();
|
||||
|
||||
Reference in New Issue
Block a user