@@ -102,11 +102,6 @@
}
#endif
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
-
/**
* Returns length of string of strings
*
@@ -121,7 +116,7 @@
for (s = szz; s[0]; s += wcslen(s) + 1)
{
}
- return s - szz;
+ return (size_t)(s - szz);
}
@@ -391,7 +386,7 @@
}
DWORD dwValueType = REG_NONE, dwSize = 0;
- DWORD dwResult = RegQueryValueEx(hKey, szName, NULL, &dwValueType, NULL, &dwSize);
+ DWORD dwResult = (DWORD)RegQueryValueEx(hKey, szName, NULL, &dwValueType, NULL, &dwSize);
if (dwResult != ERROR_SUCCESS)
{
/* MSDN does not mention RegQueryValueEx() to set GetLastError(). But
@@ -415,7 +410,7 @@
return ERROR_OUTOFMEMORY;
}
- dwResult = RegQueryValueEx(hKey, szName, NULL, NULL, (LPBYTE)szValue, &dwSize);
+ dwResult = (DWORD)RegQueryValueEx(hKey, szName, NULL, NULL, (LPBYTE)szValue, &dwSize);
if (dwResult != ERROR_SUCCESS)
{
SetLastError(dwResult);
@@ -441,6 +436,7 @@
DWORD dwCountExpResult = ExpandEnvironmentStrings(szValue, szValueExp, dwCountExp);
if (dwCountExpResult == 0)
{
+ dwResult = GetLastError();
msg(M_NONFATAL | M_ERRNO, "%s: expanding \"%ls\" registry value failed",
__FUNCTION__, szName);
free(szValueExp);
@@ -533,7 +529,7 @@
/* Query the NetCfgInstanceId value. Using get_reg_string() right on might clutter the
* output with error messages while the registry is still being populated. */
LPWSTR szCfgGuidString = NULL;
- dwResult = RegQueryValueEx(hKey, L"NetCfgInstanceId", NULL, NULL, NULL, NULL);
+ dwResult = (DWORD)RegQueryValueEx(hKey, L"NetCfgInstanceId", NULL, NULL, NULL, NULL);
if (dwResult != ERROR_SUCCESS)
{
if (dwResult == ERROR_FILE_NOT_FOUND && --iNumAttempts > 0)
@@ -953,7 +949,7 @@
/* Open network adapter registry key. */
HKEY hKey = NULL;
- dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hKey);
+ dwResult = (DWORD)RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hKey);
if (dwResult != ERROR_SUCCESS)
{
SetLastError(dwResult);
@@ -1120,7 +1116,7 @@
/* Open network adapter registry key. */
HKEY hKey = NULL;
- dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_READ, &hKey);
+ dwResult = (DWORD)RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_READ, &hKey);
if (dwResult != ERROR_SUCCESS)
{
SetLastError(dwResult);
@@ -1185,10 +1181,6 @@
return dwResult;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
void
tap_free_adapter_list(_In_ struct tap_adapter_node *pAdapterList)
{