std::ignore usage instead of (void) for ignoring return values

This commit is contained in:
Chuck Walbourn
2021-10-17 11:57:07 -07:00
parent 144847dfcc
commit 1363046e2b
12 changed files with 60 additions and 50 deletions

View File

@@ -23,6 +23,7 @@
#include <cstring>
#include <memory>
#include <new>
#include <tuple>
#include <wincodec.h>
@@ -225,7 +226,7 @@ namespace
{
FILE_DISPOSITION_INFO info = {};
info.DeleteFile = TRUE;
(void)SetFileInformationByHandle(m_handle, FileDispositionInfo, &info, sizeof(info));
std::ignore = SetFileInformationByHandle(m_handle, FileDispositionInfo, &info, sizeof(info));
}
}
@@ -831,7 +832,7 @@ HRESULT DirectX::SaveWICTextureToFile(
VARIANT varValue;
varValue.vt = VT_BOOL;
varValue.boolVal = VARIANT_TRUE;
(void)props->Write(1, &option, &varValue);
std::ignore = props->Write(1, &option, &varValue);
}
if (setCustomProps)
@@ -923,12 +924,12 @@ HRESULT DirectX::SaveWICTextureToFile(
if (memcmp(&guidContainerFormat, &GUID_ContainerFormatPng, sizeof(GUID)) == 0)
{
// Set Software name
(void)metawriter->SetMetadataByName(L"/tEXt/{str=Software}", &value);
std::ignore = metawriter->SetMetadataByName(L"/tEXt/{str=Software}", &value);
}
else
{
// Set Software name
(void)metawriter->SetMetadataByName(L"System.ApplicationName", &value);
std::ignore = metawriter->SetMetadataByName(L"System.ApplicationName", &value);
}
}