X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb9010ed40454cc978a9cbaa6de2ee41ea8b6c84..4fcd60c72f6b90f5063f7000ff5a80a9004055a3:/src/os2/iniconf.cpp diff --git a/src/os2/iniconf.cpp b/src/os2/iniconf.cpp index a72bbfa961..05bdb58dd6 100644 --- a/src/os2/iniconf.cpp +++ b/src/os2/iniconf.cpp @@ -21,7 +21,9 @@ #include #include + #include +#if wxUSE_CONFIG #include @@ -63,7 +65,7 @@ wxIniConfig::wxIniConfig(const wxString& strAppName, // append the extension if none given and it's not an absolute file name // (otherwise we assume that they know what they're doing) - if ( !wxIsPathSeparator(m_strLocalFilename[0u]) && + if ( !wxIsPathSeparator(m_strLocalFilename[(size_t) 0]) && m_strLocalFilename.Find('.') == wxNOT_FOUND ) { m_strLocalFilename << ".ini"; @@ -88,7 +90,7 @@ void wxIniConfig::SetPath(const wxString& strPath) if ( strPath.IsEmpty() ) { // nothing } - else if ( strPath[0u] == wxCONFIG_PATH_SEPARATOR ) { + else if ( strPath[(size_t) 0] == wxCONFIG_PATH_SEPARATOR ) { // absolute path wxSplitPath(aParts, strPath); } @@ -107,7 +109,7 @@ void wxIniConfig::SetPath(const wxString& strPath) } else { // translate - m_strGroup = aParts[0u]; + m_strGroup = aParts[(size_t) 0]; for ( size_t nPart = 1; nPart < nPartsCount; nPart++ ) { if ( nPart > 1 ) m_strPath << PATH_SEP_REPLACE; @@ -323,7 +325,7 @@ bool wxIniConfig::Read(const wxString& szKey, long *pl) const static const int nMagic = 17; // 17 is some "rare" number static const int nMagic2 = 28; // arbitrary number != nMagic - long lVal; // = GetPrivateProfileInt(m_strGroup, strKey, nMagic, m_strLocalFilename); + long lVal = 0; // = GetPrivateProfileInt(m_strGroup, strKey, nMagic, m_strLocalFilename); if ( lVal != nMagic ) { // the value was read from the file *pl = lVal; @@ -349,7 +351,7 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue) wxConfigPathChanger path(this, szKey); wxString strKey = GetPrivateKeyName(path.Name()); - bool bOk; // = WritePrivateProfileString(m_strGroup, strKey, + bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, strKey, // szValue, m_strLocalFilename) != 0; if ( !bOk ) @@ -394,7 +396,7 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso) return TRUE; // delete the current group too - bool bOk; // = WritePrivateProfileString(m_strGroup, NULL, + bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, NULL, // NULL, m_strLocalFilename) != 0; if ( !bOk ) @@ -409,7 +411,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey) // passing NULL as section name to WritePrivateProfileString deletes the // whole section according to the docs - bool bOk; // = WritePrivateProfileString(path.Name(), NULL, + bool bOk = FALSE; // = WritePrivateProfileString(path.Name(), NULL, // NULL, m_strLocalFilename) != 0; if ( !bOk ) @@ -429,7 +431,7 @@ bool wxIniConfig::DeleteAll() // then delete our own ini file char szBuf[MAX_PATH]; - size_t nRc; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); + size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); if ( nRc == 0 ) { wxLogLastError("GetWindowsDirectory"); @@ -461,3 +463,5 @@ bool wxIniConfig::RenameGroup(const wxString& oldName, const wxString& newName) // Not implemented return FALSE; } + +#endif //wxUSE_CONFIG