Skip to content

Commit cfd5f27

Browse files
authored
Code review for const auto vs auto const (#579)
1 parent 87e8b95 commit cfd5f27

23 files changed

+95
-95
lines changed

Auxiliary/DirectXTexEXR.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
374374
Imf::RgbaInputFile file(fileName.c_str());
375375
#endif
376376

377-
auto const dw = file.dataWindow();
377+
const auto dw = file.dataWindow();
378378

379379
const int width = dw.max.x - dw.min.x + 1;
380380
int height = dw.max.y - dw.min.y + 1;

Auxiliary/DirectXTexXboxDDS.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace
6464
}
6565

6666
// DDS files always start with the same magic number ("DDS ")
67-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(pSource);
67+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(pSource);
6868
if (dwMagicNumber != DDS_MAGIC)
6969
{
7070
return E_FAIL;

DDSTextureLoader/DDSTextureLoader11.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ namespace
183183
}
184184

185185
// DDS files always start with the same magic number ("DDS ")
186-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
186+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
187187
if (dwMagicNumber != DDS_MAGIC)
188188
{
189189
return E_FAIL;
@@ -294,7 +294,7 @@ namespace
294294
}
295295

296296
// DDS files always start with the same magic number ("DDS ")
297-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
297+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
298298
if (dwMagicNumber != DDS_MAGIC)
299299
{
300300
ddsData.reset();
@@ -1751,7 +1751,7 @@ namespace
17511751
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
17521752
{
17531753
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>(reinterpret_cast<const uint8_t*>(header) + sizeof(DDS_HEADER));
1754-
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
1754+
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
17551755
switch (mode)
17561756
{
17571757
case DDS_ALPHA_MODE_STRAIGHT:

DDSTextureLoader/DDSTextureLoader12.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ namespace
229229
}
230230

231231
// DDS files always start with the same magic number ("DDS ")
232-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
232+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
233233
if (dwMagicNumber != DDS_MAGIC)
234234
{
235235
return E_FAIL;
@@ -380,7 +380,7 @@ namespace
380380
#endif
381381

382382
// DDS files always start with the same magic number ("DDS ")
383-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
383+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
384384
if (dwMagicNumber != DDS_MAGIC)
385385
{
386386
ddsData.reset();
@@ -1623,7 +1623,7 @@ namespace
16231623
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
16241624
{
16251625
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>(reinterpret_cast<const uint8_t*>(header) + sizeof(DDS_HEADER));
1626-
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
1626+
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
16271627
switch (mode)
16281628
{
16291629
case DDS_ALPHA_MODE_STRAIGHT:

DDSTextureLoader/DDSTextureLoader9.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ namespace
156156
}
157157

158158
// DDS files always start with the same magic number ("DDS ")
159-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
159+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
160160
if (dwMagicNumber != DDS_MAGIC)
161161
{
162162
return E_FAIL;
@@ -259,7 +259,7 @@ namespace
259259
}
260260

261261
// DDS files always start with the same magic number ("DDS ")
262-
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
262+
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
263263
if (dwMagicNumber != DDS_MAGIC)
264264
{
265265
ddsData.reset();

DirectXTex/BC.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ namespace
203203
}
204204

205205
// Use Newton's Method to find local minima of sum-of-squares error.
206-
auto const fSteps = static_cast<float>(cSteps - 1);
206+
const auto fSteps = static_cast<float>(cSteps - 1);
207207

208208
for (size_t iIteration = 0; iIteration < 8; iIteration++)
209209
{
@@ -1032,8 +1032,8 @@ void DirectX::D3DXEncodeBC3(uint8_t *pBC, const XMVECTOR *pColor, uint32_t flags
10321032
float fAlphaA, fAlphaB;
10331033
OptimizeAlpha<false>(&fAlphaA, &fAlphaB, fAlpha, uSteps);
10341034

1035-
auto const bAlphaA = static_cast<uint8_t>(static_cast<int32_t>(fAlphaA * 255.0f + 0.5f));
1036-
auto const bAlphaB = static_cast<uint8_t>(static_cast<int32_t>(fAlphaB * 255.0f + 0.5f));
1035+
const auto bAlphaA = static_cast<uint8_t>(static_cast<int32_t>(fAlphaA * 255.0f + 0.5f));
1036+
const auto bAlphaB = static_cast<uint8_t>(static_cast<int32_t>(fAlphaB * 255.0f + 0.5f));
10371037

10381038
fAlphaA = static_cast<float>(bAlphaA) * (1.0f / 255.0f);
10391039
fAlphaB = static_cast<float>(bAlphaB) * (1.0f / 255.0f);
@@ -1084,7 +1084,7 @@ void DirectX::D3DXEncodeBC3(uint8_t *pBC, const XMVECTOR *pColor, uint32_t flags
10841084
}
10851085

10861086
// Encode alpha bitmap
1087-
auto const fSteps = static_cast<float>(uSteps - 1);
1087+
const auto fSteps = static_cast<float>(uSteps - 1);
10881088
const float fScale = (fStep[0] != fStep[1]) ? (fSteps / (fStep[1] - fStep[0])) : 0.0f;
10891089

10901090
if (flags & BC_FLAGS_DITHER_A)

DirectXTex/BC.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ namespace DirectX
230230
}
231231

232232
// Use Newton's Method to find local minima of sum-of-squares error.
233-
auto const fSteps = static_cast<float>(cSteps - 1);
233+
const auto fSteps = static_cast<float>(cSteps - 1);
234234

235235
for (size_t iIteration = 0; iIteration < 8; iIteration++)
236236
{

DirectXTex/BC6HBC7.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ namespace
593593
assert(uStartBit < 128);
594594
_Analysis_assume_(uStartBit < 128);
595595
const size_t uIndex = uStartBit >> 3;
596-
auto const ret = static_cast<uint8_t>((m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01);
596+
const auto ret = static_cast<uint8_t>((m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01);
597597
uStartBit++;
598598
return ret;
599599
}
@@ -1290,7 +1290,7 @@ namespace
12901290
}
12911291

12921292
// Use Newton's Method to find local minima of sum-of-squares error.
1293-
auto const fSteps = static_cast<float>(cSteps - 1);
1293+
const auto fSteps = static_cast<float>(cSteps - 1);
12941294

12951295
for (size_t iIteration = 0; iIteration < 8; iIteration++)
12961296
{
@@ -2048,7 +2048,7 @@ float D3DX_BC6H::MapColorsQuantized(const EncodeParams* pEP, const INTColor aCol
20482048
_Analysis_assume_(pEP->uMode < c_NumModes);
20492049

20502050
const uint8_t uIndexPrec = ms_aInfo[pEP->uMode].uIndexPrec;
2051-
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
2051+
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
20522052
INTColor aPalette[BC6H_MAX_INDICES];
20532053
GeneratePaletteQuantized(pEP, endPts, aPalette);
20542054

@@ -2264,7 +2264,7 @@ void D3DX_BC6H::AssignIndices(const EncodeParams* pEP, const INTEndPntPair aEndP
22642264
_Analysis_assume_(pEP->uMode < c_NumModes);
22652265

22662266
const uint8_t uPartitions = ms_aInfo[pEP->uMode].uPartitions;
2267-
auto const uNumIndices = static_cast<const uint8_t>(1u << ms_aInfo[pEP->uMode].uIndexPrec);
2267+
const auto uNumIndices = static_cast<const uint8_t>(1u << ms_aInfo[pEP->uMode].uIndexPrec);
22682268

22692269
assert(uPartitions < BC6H_MAX_REGIONS && pEP->uShape < BC6H_MAX_SHAPES);
22702270
_Analysis_assume_(uPartitions < BC6H_MAX_REGIONS && pEP->uShape < BC6H_MAX_SHAPES);
@@ -2437,7 +2437,7 @@ void D3DX_BC6H::GeneratePaletteUnquantized(const EncodeParams* pEP, size_t uRegi
24372437

24382438
const INTEndPntPair& endPts = pEP->aUnqEndPts[pEP->uShape][uRegion];
24392439
const uint8_t uIndexPrec = ms_aInfo[pEP->uMode].uIndexPrec;
2440-
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
2440+
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
24412441
assert(uNumIndices > 0);
24422442
_Analysis_assume_(uNumIndices > 0);
24432443

@@ -2473,7 +2473,7 @@ float D3DX_BC6H::MapColors(const EncodeParams* pEP, size_t uRegion, size_t np, c
24732473
_Analysis_assume_(pEP->uMode < c_NumModes);
24742474

24752475
const uint8_t uIndexPrec = ms_aInfo[pEP->uMode].uIndexPrec;
2476-
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
2476+
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
24772477
INTColor aPalette[BC6H_MAX_INDICES];
24782478
GeneratePaletteUnquantized(pEP, uRegion, aPalette);
24792479

@@ -2577,7 +2577,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
25772577
assert(uPartitions < BC7_MAX_REGIONS);
25782578
_Analysis_assume_(uPartitions < BC7_MAX_REGIONS);
25792579

2580-
auto const uNumEndPts = static_cast<const uint8_t>((unsigned(uPartitions) + 1u) << 1);
2580+
const auto uNumEndPts = static_cast<const uint8_t>((unsigned(uPartitions) + 1u) << 1);
25812581
const uint8_t uIndexPrec = ms_aInfo[uMode].uIndexPrec;
25822582
const uint8_t uIndexPrec2 = ms_aInfo[uMode].uIndexPrec2;
25832583
size_t i;
@@ -3151,8 +3151,8 @@ void D3DX_BC7::AssignIndices(const EncodeParams* pEP, size_t uShape, size_t uInd
31513151

31523152
const uint8_t uIndexPrec = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec2 : ms_aInfo[pEP->uMode].uIndexPrec;
31533153
const uint8_t uIndexPrec2 = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec : ms_aInfo[pEP->uMode].uIndexPrec2;
3154-
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
3155-
auto const uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
3154+
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
3155+
const auto uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
31563156

31573157
assert((uNumIndices <= BC7_MAX_INDICES) && (uNumIndices2 <= BC7_MAX_INDICES));
31583158
_Analysis_assume_((uNumIndices <= BC7_MAX_INDICES) && (uNumIndices2 <= BC7_MAX_INDICES));
@@ -3505,8 +3505,8 @@ float D3DX_BC7::RoughMSE(EncodeParams* pEP, size_t uShape, size_t uIndexMode) no
35053505

35063506
const uint8_t uIndexPrec = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec2 : ms_aInfo[pEP->uMode].uIndexPrec;
35073507
const uint8_t uIndexPrec2 = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec : ms_aInfo[pEP->uMode].uIndexPrec2;
3508-
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
3509-
auto const uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
3508+
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
3509+
const auto uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
35103510
size_t auPixIdx[NUM_PIXELS_PER_BLOCK];
35113511
LDRColorA aPalette[BC7_MAX_REGIONS][BC7_MAX_INDICES];
35123512

DirectXTex/BCDirectCompute.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ HRESULT GPUCompressBC::Prepare(size_t width, size_t height, uint32_t flags, DXGI
264264
if (sizeInBytes >= UINT32_MAX)
265265
return HRESULT_E_ARITHMETIC_OVERFLOW;
266266

267-
auto const bufferSize = static_cast<size_t>(sizeInBytes);
267+
const auto bufferSize = static_cast<size_t>(sizeInBytes);
268268

269269
{
270270
D3D11_BUFFER_DESC desc = {};
@@ -459,7 +459,7 @@ HRESULT GPUCompressBC::Compress(const Image& srcImage, const Image& destImage)
459459
const size_t xblocks = std::max<size_t>(1, (m_width + 3) >> 2);
460460
const size_t yblocks = std::max<size_t>(1, (m_height + 3) >> 2);
461461

462-
auto const num_total_blocks = static_cast<UINT>(xblocks * yblocks);
462+
const auto num_total_blocks = static_cast<UINT>(xblocks * yblocks);
463463
UINT num_blocks = num_total_blocks;
464464
UINT start_block_id = 0;
465465
while (num_blocks > 0)

DirectXTex/DirectXTexCompressGPU.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace
172172
ScratchImage image;
173173
HRESULT hr = E_UNEXPECTED;
174174

175-
auto const srgb = GetSRGBFlags(compress);
175+
const auto srgb = GetSRGBFlags(compress);
176176

177177
switch (tformat)
178178
{

DirectXTex/DirectXTexConvert.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,8 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
983983
auto sPtr = static_cast<const uint32_t*>(pSource);
984984
for (size_t icount = 0; icount < (size - sizeof(uint32_t) + 1); icount += sizeof(uint32_t))
985985
{
986-
auto const d = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
987-
auto const s = static_cast<float>((*sPtr & 0xFF000000) >> 24);
986+
const auto d = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
987+
const auto s = static_cast<float>((*sPtr & 0xFF000000) >> 24);
988988
++sPtr;
989989
if (dPtr >= ePtr) break;
990990
*(dPtr++) = XMVectorSet(d, s, 0.f, 1.f);
@@ -999,7 +999,7 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
999999
auto sPtr = static_cast<const uint32_t*>(pSource);
10001000
for (size_t icount = 0; icount < (size - sizeof(uint32_t) + 1); icount += sizeof(uint32_t))
10011001
{
1002-
auto const r = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
1002+
const auto r = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
10031003
++sPtr;
10041004
if (dPtr >= ePtr) break;
10051005
*(dPtr++) = XMVectorSet(r, 0.f /* typeless component assumed zero */, 0.f, 1.f);
@@ -1014,7 +1014,7 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
10141014
auto sPtr = static_cast<const uint32_t*>(pSource);
10151015
for (size_t icount = 0; icount < (size - sizeof(uint32_t) + 1); icount += sizeof(uint32_t))
10161016
{
1017-
auto const g = static_cast<float>((*sPtr & 0xFF000000) >> 24);
1017+
const auto g = static_cast<float>((*sPtr & 0xFF000000) >> 24);
10181018
++sPtr;
10191019
if (dPtr >= ePtr) break;
10201020
*(dPtr++) = XMVectorSet(0.f /* typeless component assumed zero */, g, 0.f, 1.f);
@@ -1344,9 +1344,9 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
13441344
// G = 1.1678Y' - 0.3929Cb' - 0.8152Cr'
13451345
// B = 1.1678Y' + 2.0232Cb'
13461346

1347-
auto const r = static_cast<int>((76533 * y + 104905 * v + 32768) >> 16);
1348-
auto const g = static_cast<int>((76533 * y - 25747 * u - 53425 * v + 32768) >> 16);
1349-
auto const b = static_cast<int>((76533 * y + 132590 * u + 32768) >> 16);
1347+
const auto r = static_cast<int>((76533 * y + 104905 * v + 32768) >> 16);
1348+
const auto g = static_cast<int>((76533 * y - 25747 * u - 53425 * v + 32768) >> 16);
1349+
const auto b = static_cast<int>((76533 * y + 132590 * u + 32768) >> 16);
13501350

13511351
if (dPtr >= ePtr) break;
13521352
*(dPtr++) = XMVectorSet(float(std::min<int>(std::max<int>(r, 0), 1023)) / 1023.f,
@@ -1367,7 +1367,7 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
13671367
const int64_t u = int64_t(sPtr->x) - 32768;
13681368
const int64_t y = int64_t(sPtr->y) - 4096;
13691369
const int64_t v = int64_t(sPtr->z) - 32768;
1370-
auto const a = static_cast<int>(sPtr->w);
1370+
const auto a = static_cast<int>(sPtr->w);
13711371
++sPtr;
13721372

13731373
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb970578.aspx
@@ -1380,9 +1380,9 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
13801380
// G = 1.1689Y' - 0.3933Cb' - 0.8160Cr'
13811381
// B = 1.1689Y'+ 2.0251Cb'
13821382

1383-
auto const r = static_cast<int>((76607 * y + 105006 * v + 32768) >> 16);
1384-
auto const g = static_cast<int>((76607 * y - 25772 * u - 53477 * v + 32768) >> 16);
1385-
auto const b = static_cast<int>((76607 * y + 132718 * u + 32768) >> 16);
1383+
const auto r = static_cast<int>((76607 * y + 105006 * v + 32768) >> 16);
1384+
const auto g = static_cast<int>((76607 * y - 25772 * u - 53477 * v + 32768) >> 16);
1385+
const auto b = static_cast<int>((76607 * y + 132718 * u + 32768) >> 16);
13861386

13871387
if (dPtr >= ePtr) break;
13881388
*(dPtr++) = XMVectorSet(float(std::min<int>(std::max<int>(r, 0), 65535)) / 65535.f,
@@ -4716,7 +4716,7 @@ namespace
47164716
filter &= ~(TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT);
47174717
}
47184718

4719-
auto const wicsrgb = CheckWICColorSpace(pfGUID, targetGUID);
4719+
const auto wicsrgb = CheckWICColorSpace(pfGUID, targetGUID);
47204720

47214721
if (wicsrgb != (filter & (TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT)))
47224722
{
@@ -4943,7 +4943,7 @@ namespace
49434943
{\
49444944
const size_t rowPitch = srcImage.rowPitch;\
49454945
\
4946-
auto const sourceE = reinterpret_cast<const srcType*>(pSrc + srcImage.slicePitch);\
4946+
const auto sourceE = reinterpret_cast<const srcType*>(pSrc + srcImage.slicePitch);\
49474947
auto pSrcUV = pSrc + (srcImage.height * rowPitch);\
49484948
\
49494949
for(size_t y = 0; y < srcImage.height; y+= 2)\

DirectXTex/DirectXTexD3D12.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,10 @@ HRESULT DirectX::CaptureTexture(
738738
pCommandQueue->GetDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf()));
739739

740740
#if defined(_MSC_VER) || !defined(_WIN32)
741-
auto const desc = pSource->GetDesc();
741+
const auto desc = pSource->GetDesc();
742742
#else
743743
D3D12_RESOURCE_DESC tmpDesc;
744-
auto const& desc = *pSource->GetDesc(&tmpDesc);
744+
const auto& desc = *pSource->GetDesc(&tmpDesc);
745745
#endif
746746

747747
ComPtr<ID3D12Resource> pStaging;

DirectXTex/DirectXTexDDS.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ namespace
341341
}
342342

343343
// DDS files always start with the same magic number ("DDS ")
344-
auto const dwMagicNumber = *static_cast<const uint32_t*>(pSource);
344+
const auto dwMagicNumber = *static_cast<const uint32_t*>(pSource);
345345
if (dwMagicNumber != DDS_MAGIC)
346346
{
347347
return E_FAIL;
@@ -1942,9 +1942,9 @@ HRESULT DirectX::GetMetadataFromDDSFileEx(
19421942
return HRESULT_FROM_WIN32(GetLastError());
19431943
}
19441944

1945-
auto const headerLen = static_cast<size_t>(bytesRead);
1945+
const auto headerLen = static_cast<size_t>(bytesRead);
19461946
#else
1947-
auto const headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
1947+
const auto headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
19481948

19491949
inFile.read(reinterpret_cast<char*>(header), headerLen);
19501950
if (!inFile)
@@ -2124,9 +2124,9 @@ HRESULT DirectX::LoadFromDDSFileEx(
21242124
return HRESULT_FROM_WIN32(GetLastError());
21252125
}
21262126

2127-
auto const headerLen = static_cast<size_t>(bytesRead);
2127+
const auto headerLen = static_cast<size_t>(bytesRead);
21282128
#else
2129-
auto const headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
2129+
const auto headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
21302130

21312131
inFile.read(reinterpret_cast<char*>(header), headerLen);
21322132
if (!inFile)
@@ -2263,7 +2263,7 @@ HRESULT DirectX::LoadFromDDSFileEx(
22632263
}
22642264

22652265
#ifdef _WIN32
2266-
auto const pixelBytes = static_cast<DWORD>(image.GetPixelsSize());
2266+
const auto pixelBytes = static_cast<DWORD>(image.GetPixelsSize());
22672267
if (!ReadFile(hFile.get(), image.GetPixels(), pixelBytes, &bytesRead, nullptr))
22682268
{
22692269
image.Release();

0 commit comments

Comments
 (0)