Skip to content

Commit 2bc635f

Browse files
committed
Fix -Wsign-conversion warning
1 parent 2f37de7 commit 2bc635f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Auxiliary/DirectXTexEXR.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
220220
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
221221
if (nameLength > 0)
222222
{
223-
fileName.resize(nameLength);
223+
fileName.resize(static_cast<size_t>(nameLength));
224224
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
225225
if (result <= 0)
226226
{
@@ -338,7 +338,7 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
338338
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
339339
if (nameLength > 0)
340340
{
341-
fileName.resize(nameLength);
341+
fileName.resize(static_cast<size_t>(nameLength));
342342
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
343343
if (result <= 0)
344344
{
@@ -487,7 +487,7 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
487487
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
488488
if (nameLength > 0)
489489
{
490-
fileName.resize(nameLength);
490+
fileName.resize(static_cast<size_t>(nameLength));
491491
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
492492
if (result <= 0)
493493
{

0 commit comments

Comments
 (0)