ISO C90 - Split variable initialisation and declaration

This commit is contained in:
Scr3amer 2023-04-01 17:13:23 -04:00
parent f1ee946007
commit 6404b1bba4

View File

@ -336,11 +336,16 @@ static char * GetAccurateMonitorName(const WCHAR *deviceName)
if(loadWin7MonitorPointers(&dllPointers) == 0) if(loadWin7MonitorPointers(&dllPointers) == 0)
return NULL; return NULL;
DISPLAYCONFIG_PATH_INFO *paths = NULL; DISPLAYCONFIG_PATH_INFO *paths;
DISPLAYCONFIG_MODE_INFO *modes = NULL; paths = NULL;
char *retval = NULL; DISPLAYCONFIG_MODE_INFO *modes;
UINT32 pathCount = 0; modes = NULL;
UINT32 modeCount = 0; char *retval;
retval = NULL;
UINT32 pathCount;
pathCount = 0;
UINT32 modeCount;
modeCount = 0;
UINT32 i; UINT32 i;
LONG rc; LONG rc;
@ -429,7 +434,8 @@ static BOOL CALLBACK monitorCallback(HMONITOR handle,
if (wcscmp(mi.szDevice, monitor->win32.adapterName) == 0) if (wcscmp(mi.szDevice, monitor->win32.adapterName) == 0)
{ {
monitor->win32.handle = handle; monitor->win32.handle = handle;
char *possiblyMoreAccurateMonitorName = GetAccurateMonitorName(mi.szDevice); char *possiblyMoreAccurateMonitorName;
possiblyMoreAccurateMonitorName = GetAccurateMonitorName(mi.szDevice);
if(possiblyMoreAccurateMonitorName != NULL) if(possiblyMoreAccurateMonitorName != NULL)
{ {
strncpy(monitor->name, possiblyMoreAccurateMonitorName, sizeof(monitor->name) - 1); strncpy(monitor->name, possiblyMoreAccurateMonitorName, sizeof(monitor->name) - 1);