The warning occurs on this line
if (displayModes[i].Width == (unsigned int)screenW) {}
Here is the code.
int count = 0;
DXGI_MODE_DESC* displayModes = {};
UINT numModes = 0;
DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;
UINT flags = DXGI_ENUM_MODES_INTERLACED;
hr = pDXGIAdapter->EnumOutputs(0, &pDXGIOutput);
if (SUCCEEDED(hr))
{
hr = pDXGIOutput->GetDisplayModeList(format, flags/*0*/, &numModes, nullptr);
if (SUCCEEDED(hr))
{
displayModes = new DXGI_MODE_DESC[numModes];
if (displayModes)
{
hr = pDXGIOutput->GetDisplayModeList(
format, flags/*0*/, &numModes, displayModes);
if (SUCCEEDED(hr))
{
for (UINT i = 0; i < numModes; i++)
{
if (displayModes[i].Width == (unsigned int)screenW)
{
if (displayModes[i].Height == (unsigned int)screenH)
{
numerator = displayModes[i].RefreshRate.Numerator;
denominator = displayModes[i].RefreshRate.Denominator;
}
}
}
}
}
}
}
delete[] displayModes;
displayModes = 0;