OSDN Git Service

Increased warning level to #4 and fixed a number of warnings.
[mutilities/MUtilities.git] / src / Registry_Win32.cpp
index 323d609..9dd6471 100644 (file)
@@ -191,7 +191,7 @@ bool MUtils::Registry::RegistryKey::value_write(const QString &valueName, const
 bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, quint32 &value) const
 {
        value = 0;
-       DWORD size = sizeof(quint32), type = -1;
+       DWORD size = sizeof(quint32), type = static_cast<DWORD>(-1);
        CHECK_STATUS(KEY_READ);
        return (RegQueryValueEx(p->m_hKey, valueName.isEmpty() ? NULL : MUTILS_WCHR(valueName), 0, &type, reinterpret_cast<BYTE*>(&value), &size) == ERROR_SUCCESS) && (type == REG_DWORD);
 }
@@ -199,7 +199,7 @@ bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, quint32
 bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, QString &value) const
 {
        value = QString();
-       wchar_t buffer[2048]; DWORD size = sizeof(wchar_t) * 2048, type = -1;
+       wchar_t buffer[2048]; DWORD size = sizeof(wchar_t) * 2048, type = static_cast<DWORD>(-1);
        CHECK_STATUS(KEY_READ);
        if((RegQueryValueEx(p->m_hKey, valueName.isEmpty() ? NULL : MUTILS_WCHR(valueName), 0, &type, reinterpret_cast<BYTE*>(&(buffer[0])), &size) == ERROR_SUCCESS) && ((type == REG_SZ) || (type == REG_EXPAND_SZ)))
        {