From 28b81bbed5d8db354349fd787c3db4123e55d423 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 14 Nov 2018 15:43:25 +0300 Subject: code cleaning --- plugins/AVS/src/options.cpp | 2 +- plugins/CSList/src/cslist.cpp | 4 ++-- plugins/ClientChangeNotify/src/Options.cpp | 4 ++-- plugins/ClientChangeNotify/src/Options.h | 2 +- plugins/Clist_nicer/src/clui.cpp | 2 +- plugins/Clist_nicer/src/viewmodes.cpp | 14 +++++++------- plugins/CloudFile/src/Services/google_service.cpp | 2 +- plugins/CloudFile/src/Services/yandex_service.cpp | 2 +- plugins/CmdLine/src/mimcmd_handlers.cpp | 2 +- plugins/MyDetails/src/frame.cpp | 4 ++-- plugins/NewAwaySysMod/src/Options.cpp | 4 ++-- plugins/NewAwaySysMod/src/Options.h | 2 +- plugins/Non-IM Contact/src/files.cpp | 4 ++-- plugins/Non-IM Contact/src/namereplacing.cpp | 4 ++-- plugins/PluginUpdater/src/DlgListNew.cpp | 2 +- plugins/RemovePersonalSettings/src/rps.cpp | 4 ++-- plugins/UserInfoEx/src/psp_options.cpp | 2 +- protocols/IRCG/src/commandmonitor.cpp | 6 +++--- protocols/IRCG/src/ircproto.cpp | 4 ++-- protocols/IRCG/src/options.cpp | 8 ++++---- protocols/IcqOscarJ/src/icq_servlist.cpp | 10 +++++----- protocols/MinecraftDynmap/src/chat.cpp | 2 +- protocols/MinecraftDynmap/src/communication.cpp | 2 +- protocols/MinecraftDynmap/src/dialogs.cpp | 2 +- protocols/Omegle/src/dialogs.cpp | 2 +- protocols/Tox/src/tox_bootstrap.cpp | 6 +++--- protocols/Tox/src/tox_options.cpp | 8 ++++---- src/core/stdclist/src/clcopts.cpp | 4 ++-- 28 files changed, 57 insertions(+), 57 deletions(-) diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index bef7b80373..b8b43675e9 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -48,7 +48,7 @@ static void RemoveProtoPic(protoPicCacheEntry *pce) if (pce == nullptr) return; - db_unset(NULL, PPICT_MODULE, pce->szProtoname); + db_unset(0, PPICT_MODULE, pce->szProtoname); // common for all accounts if (pce->cacheType == PCE_TYPE_GLOBAL) { diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 127ed4ad26..08d8abb871 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -254,8 +254,8 @@ void importCustomStatuses(CSWindow* csw, int result) else delete si; if (result == IDYES) { - db_unset(NULL, protoName, bufTitle); - db_unset(NULL, protoName, bufMessage); + db_unset(0, protoName, bufTitle); + db_unset(0, protoName, bufMessage); } } csw->m_listview->reinitItems(csw->m_itemslist->m_list->getListHead()); diff --git a/plugins/ClientChangeNotify/src/Options.cpp b/plugins/ClientChangeNotify/src/Options.cpp index e5fcc70ca7..225a0a8309 100644 --- a/plugins/ClientChangeNotify/src/Options.cpp +++ b/plugins/ClientChangeNotify/src/Options.cpp @@ -479,7 +479,7 @@ void COptItem_TreeCtrl::CleanDBSettings(const CString &sModule, CString *sDBSett db_enum_settings(NULL, TreeDeleteEnum, sModule, &TreeDeleteEnumData); for (int i = 0; i < TreeDeleteEnumData.TreeSettings.GetSize(); i++) - db_unset(NULL, sModule, TreeDeleteEnumData.TreeSettings[i]); + db_unset(0, sModule, TreeDeleteEnumData.TreeSettings[i]); } int COptItem_TreeCtrl::GetSelectedItemID(HWND hWnd) @@ -741,7 +741,7 @@ void COptItem_ListCtrl::CleanDBSettings(const CString &sModule, CString *sDBSett db_enum_settings(NULL, ListDeleteEnum, sModule, &ListDeleteEnumData); for (int i = 0; i < ListDeleteEnumData.ListSettings.GetSize(); i++) - db_unset(NULL, sModule, ListDeleteEnumData.ListSettings[i]); + db_unset(0, sModule, ListDeleteEnumData.ListSettings[i]); } int COptItem_ListCtrl::GetSelectedItemID(HWND hWnd) diff --git a/plugins/ClientChangeNotify/src/Options.h b/plugins/ClientChangeNotify/src/Options.h index 9f464d6407..9c69b4d1bc 100644 --- a/plugins/ClientChangeNotify/src/Options.h +++ b/plugins/ClientChangeNotify/src/Options.h @@ -38,7 +38,7 @@ public: virtual void MemToWnd(HWND hWnd) { EnableWindow(GetDlgItem(hWnd, m_dlgItemID), m_bEnabled); } void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); } void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = NULL) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); } - virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue? + virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL) { db_unset(0, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue? virtual void SetValue(INT_PTR) { m_bModified = true; } virtual void SetDefValue(INT_PTR) {} diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 182be342a1..c4e6f2db49 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1832,7 +1832,7 @@ void LoadCLUIModule(void) MessageBox(nullptr, TranslateT("You need the FloatingContacts plugin, cause the embedded floating contacts were removed."), TranslateT("Warning"), MB_OK | MB_ICONWARNING); - db_unset(NULL, "CLUI", "FloaterMode"); + db_unset(0, "CLUI", "FloaterMode"); } MF_InitCheck(); diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 7b8565deae..feb5c23f5e 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -633,16 +633,16 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (szBuf) { SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szBuf); mir_snprintf(szSetting, "%c%s_PF", 246, szBuf); - db_unset(NULL, CLVM_MODULE, szSetting); + db_unset(0, CLVM_MODULE, szSetting); mir_snprintf(szSetting, "%c%s_GF", 246, szBuf); - db_unset(NULL, CLVM_MODULE, szSetting); + db_unset(0, CLVM_MODULE, szSetting); mir_snprintf(szSetting, "%c%s_SM", 246, szBuf); - db_unset(NULL, CLVM_MODULE, szSetting); + db_unset(0, CLVM_MODULE, szSetting); mir_snprintf(szSetting, "%c%s_VA", 246, szBuf); - db_unset(NULL, CLVM_MODULE, szSetting); + db_unset(0, CLVM_MODULE, szSetting); mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf); - db_unset(NULL, CLVM_MODULE, szSetting); - db_unset(NULL, CLVM_MODULE, szBuf); + db_unset(0, CLVM_MODULE, szSetting); + db_unset(0, CLVM_MODULE, szBuf); if (!mir_strcmp(cfg::dat.current_viewmode, szBuf) && mir_strlen(szBuf) == mir_strlen(cfg::dat.current_viewmode)) { cfg::dat.bFilterEffective = 0; Clist_Broadcast(CLM_AUTOREBUILD, 0, 0); @@ -1025,7 +1025,7 @@ void ApplyViewMode(const char *name) if (name != nullptr) { char szSetting[256]; mir_snprintf(szSetting, "%c%s_PF", 246, name); - ptrA szProtos(db_get_sa(NULL, CLVM_MODULE, szSetting)); + ptrA szProtos(db_get_sa(0, CLVM_MODULE, szSetting)); if (mir_strlen(szProtos) >= 2) { strncpy_s(cfg::dat.protoFilter, szProtos, _TRUNCATE); cfg::dat.bFilterEffective |= CLVM_FILTER_PROTOS; diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp index 313aa5efa7..536d2ff65e 100644 --- a/plugins/CloudFile/src/Services/google_service.cpp +++ b/plugins/CloudFile/src/Services/google_service.cpp @@ -144,7 +144,7 @@ void CGDriveService::RequestAccessTokenThread(void *param) void CGDriveService::RevokeAccessTokenThread(void*) { - ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret")); + ptrA token(db_get_sa(0, GetAccountName(), "TokenSecret")); GDriveAPI::RevokeAccessTokenRequest request(token); NLHR_PTR response(request.Send(m_hConnection)); diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index a1472ee197..4bd0210ca1 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -146,7 +146,7 @@ void CYandexService::RequestAccessTokenThread(void *param) void CYandexService::RevokeAccessTokenThread(void*) { - ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret")); + ptrA token(db_get_sa(0, GetAccountName(), "TokenSecret")); YandexAPI::RevokeAccessTokenRequest request(token); NLHR_PTR response(request.Send(m_hConnection)); diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 0ddb5c5f6b..eafd2961f3 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -793,7 +793,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r wchar_t *module = argv[3]; wchar_t *key = argv[4]; - db_unset(NULL, _T2A(module), _T2A(key)); + db_unset(0, _T2A(module), _T2A(key)); reply->code = MIMRES_SUCCESS; mir_snwprintf(reply->message, TranslateT("Setting '%s/%s' deleted."), module, key); diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index cfe97cb2d8..f7a4b44242 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -296,7 +296,7 @@ int CreateFrame() if (flags & F_VISIBLE) CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); - db_unset(NULL, "MyDetails", "ForceHideFrame"); + db_unset(0, "MyDetails", "ForceHideFrame"); } if (db_get_b(0, "MyDetails", "ForceShowFrame", 0)) { @@ -304,7 +304,7 @@ int CreateFrame() if (!(flags & F_VISIBLE)) CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0); - db_unset(NULL, "MyDetails", "ForceShowFrame"); + db_unset(0, "MyDetails", "ForceShowFrame"); } } else { diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index 27015af169..f28cb1f2bf 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -479,7 +479,7 @@ void COptItem_TreeCtrl::CleanDBSettings(const CString &sModule, CString *sDBSett db_enum_settings(NULL, TreeDeleteEnum, sModule, &TreeDeleteEnumData); for (int i = 0; i < TreeDeleteEnumData.TreeSettings.GetSize(); i++) - db_unset(NULL, sModule, TreeDeleteEnumData.TreeSettings[i]); + db_unset(0, sModule, TreeDeleteEnumData.TreeSettings[i]); } int COptItem_TreeCtrl::GetSelectedItemID(HWND hWnd) @@ -741,7 +741,7 @@ void COptItem_ListCtrl::CleanDBSettings(const CString &sModule, CString *sDBSett db_enum_settings(NULL, ListDeleteEnum, sModule, &ListDeleteEnumData); for (int i = 0; i < ListDeleteEnumData.ListSettings.GetSize(); i++) - db_unset(NULL, sModule, ListDeleteEnumData.ListSettings[i]); + db_unset(0, sModule, ListDeleteEnumData.ListSettings[i]); } int COptItem_ListCtrl::GetSelectedItemID(HWND hWnd) diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h index 129a52a5bd..c73ba45420 100644 --- a/plugins/NewAwaySysMod/src/Options.h +++ b/plugins/NewAwaySysMod/src/Options.h @@ -39,7 +39,7 @@ public: virtual void MemToWnd(HWND hWnd) { EnableWindow(GetDlgItem(hWnd, m_dlgItemID), m_bEnabled); } void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = nullptr) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); } void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = nullptr) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); } - virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue? + virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr) { db_unset(0, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue? virtual void SetValue(INT_PTR) { m_bModified = true; } virtual void SetDefValue(INT_PTR) {} diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp index 8a58b495ac..a61d3a9095 100644 --- a/plugins/Non-IM Contact/src/files.cpp +++ b/plugins/Non-IM Contact/src/files.cpp @@ -233,7 +233,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int count = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCOUNT, 0, 0) - 1; if (index == count) { mir_snprintf(fn, "fn%d", index); - db_unset(NULL, MODNAME, fn); + db_unset(0, MODNAME, fn); SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_DELETESTRING, index, 0); SendMessage(hwnd, WM_RELOADWINDOW, 0, 0); if (!index) { @@ -251,7 +251,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) mir_snprintf(fn, "fn%d", ++i); } mir_snprintf(fn, "fn%d", --i); - db_unset(NULL, MODNAME, fn); + db_unset(0, MODNAME, fn); SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_DELETESTRING, index, 0); SendMessage(hwnd, WM_RELOADWINDOW, 0, 0); } diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 8e93072747..d7909d7281 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -5,7 +5,7 @@ int readFileIntoArray(int fileNumber, char *FileContents[]) char dbSetting[20], temp[MAX_STRING_LENGTH]; mir_snprintf(dbSetting, "fn%d", fileNumber); - char *szVar = db_get_sa(NULL, MODNAME, dbSetting); + char *szVar = db_get_sa(0, MODNAME, dbSetting); if (szVar == nullptr) return 0; @@ -400,7 +400,7 @@ int lastChecked(CMStringA &szNewStr, const char *str) sscanf(&str[cbPattern], "%d", &file); mir_snprintf(szSetting, "fn%d", file); - char *szVar = db_get_sa(NULL, MODNAME, szSetting); + char *szVar = db_get_sa(0, MODNAME, szSetting); if (szVar == nullptr) return 0; diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index b55d9ba333..52321a1dad 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -74,7 +74,7 @@ static void ApplyDownloads(void *param) ListView_SetItemText(hwndList, i, 1, TranslateT("Succeeded.")); if (unzip(p.File.tszDiskPath, tszMirandaPath, tszFileBack, false)) SafeDeleteFile(p.File.tszDiskPath); // remove .zip after successful update - db_unset(NULL, DB_MODULE_NEW_FILES, _T2A(p.tszOldName)); + db_unset(0, DB_MODULE_NEW_FILES, _T2A(p.tszOldName)); } else ListView_SetItemText(hwndList, i, 1, TranslateT("Failed!")); diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index d30b7073a6..a8f7ce8b90 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -224,14 +224,14 @@ void DeleteSettingEx(const char *szModule, const char *szSetting) // Delete then szSetting = dms.buffer; while (szSetting[0] != '\0') { - db_unset(NULL, szModule, szSetting); + db_unset(0, szModule, szSetting); // Get next one szSetting += mir_strlen(szSetting) + 1; } } else { - db_unset(NULL, szModule, szSetting); + db_unset(0, szModule, szSetting); } } } diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 405e1a6191..cd8ed8fb48 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -464,7 +464,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam if (!Settings.EnumSettings(NULL, "SkinIcons")) for (auto &s : Settings) if (mir_strncmpi(s, "UserInfoEx", 10) == 0) - db_unset(NULL, "SkinIcons", s); + db_unset(0, "SkinIcons", s); // delete global settings DB::Module::Delete(NULL, USERINFO"Ex"); diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 1e7b262430..08a2839c37 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -1394,7 +1394,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg) else Chat_Control(m_szModuleName, sID, SESSION_INITDONE); if (save.IsEmpty()) - db_unset(NULL, m_szModuleName, "JTemp"); + db_unset(0, m_szModuleName, "JTemp"); else setWString("JTemp", save); db_free(&dbv); @@ -1828,7 +1828,7 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage *pmsg) db_free(&dbv); if (save.IsEmpty()) - db_unset(NULL, m_szModuleName, "JTemp"); + db_unset(0, m_szModuleName, "JTemp"); else setWString("JTemp", save); } @@ -2278,7 +2278,7 @@ void CIrcProto::OnIrcDefault(const CIrcMessage *pmsg) void CIrcProto::OnIrcDisconnected() { m_statusMessage = L""; - db_unset(NULL, m_szModuleName, "JTemp"); + db_unset(0, m_szModuleName, "JTemp"); bTempDisableCheck = false; bTempForceCheck = false; m_iTempCheckTime = 0; diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 3fa02e20b1..380984a4f9 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -180,7 +180,7 @@ void CIrcProto::OnModulesLoaded() wchar_t name[128]; mir_snwprintf(name, TranslateT("%s server connection"), m_tszUserName); - db_unset(NULL, m_szModuleName, "JTemp"); + db_unset(0, m_szModuleName, "JTemp"); NETLIBUSER nlu = {}; nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; @@ -245,7 +245,7 @@ void CIrcProto::OnModulesLoaded() for (auto &it : performToConvert) { DBVARIANT dbv; if (!getWString(*it, &dbv)) { - db_unset(NULL, m_szModuleName, *it); + db_unset(0, m_szModuleName, *it); it->MakeUpper(); setWString(*it, dbv.pwszVal); db_free(&dbv); diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 0e10ae9ead..14b3c4ae8c 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1167,7 +1167,7 @@ bool COtherPrefsDlg::OnApply() if (!pPerf->mText.IsEmpty()) m_proto->setWString(pPerf->mSetting.c_str(), pPerf->mText.c_str()); else - db_unset(NULL, m_proto->m_szModuleName, pPerf->mSetting.c_str()); + db_unset(0, m_proto->m_szModuleName, pPerf->mSetting.c_str()); } } m_proto->WriteSettings(OtherSettings, _countof(OtherSettings)); @@ -1383,7 +1383,7 @@ void CIrcProto::RewriteIgnoreSettings(void) int i = 0; for (;;) { mir_snprintf(settingName, "IGNORE:%d", i++); - if (db_unset(NULL, m_szModuleName, settingName)) + if (db_unset(0, m_szModuleName, settingName)) break; } @@ -1688,11 +1688,11 @@ void CIrcProto::InitPrefs(void) int x = getDword("SizeOfListBottom", -1); if (x != -1) { - db_unset(NULL, m_szModuleName, "SizeOfListBottom"); + db_unset(0, m_szModuleName, "SizeOfListBottom"); setDword("channelList_height", x); } if ((x = getDword("SizeOfListWidth", -1)) != -1) { - db_unset(NULL, m_szModuleName, "SizeOfListWidth"); + db_unset(0, m_szModuleName, "SizeOfListWidth"); setDword("channelList_width", x); } diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 62f45998ee..ee70e8de8a 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -1268,7 +1268,7 @@ void CIcqProto::removeGroupPathLinks(WORD wGroupID) while (list) { void* bet; - db_unset(NULL, szModule, list[1]); + db_unset(0, szModule, list[1]); SAFE_FREE((void**)&list[1]); bet = list; list = (char**)list[0]; @@ -1292,7 +1292,7 @@ char* CIcqProto::getServListGroupName(WORD wGroupID) if (!CheckServerID(wGroupID, 0)) { // check if valid id, if not give empty and remove debugLogA("Removing group %u from cache...", wGroupID); - db_unset(NULL, szModule, szGroup); + db_unset(0, szModule, szGroup); return nullptr; } @@ -1315,7 +1315,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName) if (szGroupName) db_set_utf(NULL, szModule, szGroup, szGroupName); else { - db_unset(NULL, szModule, szGroup); + db_unset(0, szModule, szGroup); removeGroupPathLinks(wGroupID); } } @@ -1329,7 +1329,7 @@ WORD CIcqProto::getServListGroupLinkID(const char *szPath) if (wGroupId && !CheckServerID(wGroupId, 0)) { // known, check if still valid, if not remove debugLogA("Removing group \"%s\" from cache...", szPath); - db_unset(NULL, szModule, szPath); + db_unset(0, szModule, szPath); wGroupId = 0; } @@ -1344,7 +1344,7 @@ void CIcqProto::setServListGroupLinkID(const char *szPath, WORD wGroupID) if (wGroupID) db_set_w(0, szModule, szPath, wGroupID); else - db_unset(NULL, szModule, szPath); + db_unset(0, szModule, szPath); } // determine if the specified clist group path exists diff --git a/protocols/MinecraftDynmap/src/chat.cpp b/protocols/MinecraftDynmap/src/chat.cpp index 4b6d8b0c46..0027ba3e44 100644 --- a/protocols/MinecraftDynmap/src/chat.cpp +++ b/protocols/MinecraftDynmap/src/chat.cpp @@ -162,7 +162,7 @@ void MinecraftDynmapProto::SetChatStatus(int status) if (status == ID_STATUS_ONLINE) { // Load actual name from database - ptrA nick(db_get_sa(NULL, m_szModuleName, MINECRAFTDYNMAP_KEY_NAME)); + ptrA nick(db_get_sa(0, m_szModuleName, MINECRAFTDYNMAP_KEY_NAME)); if (!nick) { nick = mir_strdup(Translate("You")); db_set_s(0, m_szModuleName, MINECRAFTDYNMAP_KEY_NAME, nick); diff --git a/protocols/MinecraftDynmap/src/communication.cpp b/protocols/MinecraftDynmap/src/communication.cpp index 2124715301..35f74f0818 100644 --- a/protocols/MinecraftDynmap/src/communication.cpp +++ b/protocols/MinecraftDynmap/src/communication.cpp @@ -353,7 +353,7 @@ void MinecraftDynmapProto::SignOnWorker(void*) int old_status = m_iStatus; // Load server from database - ptrA str(db_get_sa(NULL, m_szModuleName, MINECRAFTDYNMAP_KEY_SERVER)); + ptrA str(db_get_sa(0, m_szModuleName, MINECRAFTDYNMAP_KEY_SERVER)); if (!str || !str[0]) { MessageBox(nullptr, TranslateT("Set server address to connect."), m_tszUserName, MB_OK); SetStatus(ID_STATUS_OFFLINE); diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp index 633ea10671..f682fd5c7b 100644 --- a/protocols/MinecraftDynmap/src/dialogs.cpp +++ b/protocols/MinecraftDynmap/src/dialogs.cpp @@ -61,7 +61,7 @@ static void StoreDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const if (tstr[0] != '\0') { db_set_ws(0, ppro->m_szModuleName, szSetting, tstr); } else { - db_unset(NULL, ppro->m_szModuleName, szSetting); + db_unset(0, ppro->m_szModuleName, szSetting); } } diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp index 06e4504721..4a4b069813 100644 --- a/protocols/Omegle/src/dialogs.cpp +++ b/protocols/Omegle/src/dialogs.cpp @@ -51,7 +51,7 @@ static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* sz if (tstr[0] != '\0') db_set_ws(0, ppro->m_szModuleName, szSetting, tstr); else - db_unset(NULL, ppro->m_szModuleName, szSetting); + db_unset(0, ppro->m_szModuleName, szSetting); } INT_PTR CALLBACK OmegleAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) diff --git a/protocols/Tox/src/tox_bootstrap.cpp b/protocols/Tox/src/tox_bootstrap.cpp index 103f9a5fcf..638d3aadfe 100644 --- a/protocols/Tox/src/tox_bootstrap.cpp +++ b/protocols/Tox/src/tox_bootstrap.cpp @@ -33,16 +33,16 @@ void CToxProto::BootstrapNodesFromDb(Tox *tox, bool isIPv6) char setting[MAX_PATH]; for (int i = 0; i < nodeCount; i++) { mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i); - ptrA address(db_get_sa(NULL, module, setting)); + ptrA address(db_get_sa(0, module, setting)); mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i); int port = db_get_w(0, module, setting, 33445); mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i); - ptrA pubKey(db_get_sa(NULL, module, setting)); + ptrA pubKey(db_get_sa(0, module, setting)); BootstrapUdpNode(tox, address, port, pubKey); BootstrapTcpRelay(tox, address, port, pubKey); if (isIPv6) { mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i); - address = db_get_sa(NULL, module, setting); + address = db_get_sa(0, module, setting); BootstrapUdpNode(tox, address, port, pubKey); BootstrapTcpRelay(tox, address, port, pubKey); } diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index cd3a8357cd..2d5c570b45 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -539,13 +539,13 @@ bool CToxOptionsNodeList::OnApply() int nodeCount = db_get_b(0, module, TOX_SETTINGS_NODE_COUNT, 0); for (iItem = itemCount; iItem < nodeCount; iItem++) { mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem); - db_unset(NULL, module, setting); + db_unset(0, module, setting); mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem); - db_unset(NULL, module, setting); + db_unset(0, module, setting); mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem); - db_unset(NULL, module, setting); + db_unset(0, module, setting); mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem); - db_unset(NULL, module, setting); + db_unset(0, module, setting); } db_set_b(0, module, TOX_SETTINGS_NODE_COUNT, itemCount); return true; diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 61fcd13d12..67a282df1b 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -375,12 +375,12 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, COLORREF col; col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0); if (col == CLCDEFAULT_BKCOLOUR) - db_unset(NULL, "CLC", "BkColour"); + db_unset(0, "CLC", "BkColour"); else db_set_dw(0, "CLC", "BkColour", col); col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0); if (col == CLCDEFAULT_SELBKCOLOUR) - db_unset(NULL, "CLC", "SelBkColour"); + db_unset(0, "CLC", "SelBkColour"); else db_set_dw(0, "CLC", "SelBkColour", col); db_set_b(0, "CLC", "UseWinColours", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR))); -- cgit v1.2.3