From 78c0815c4118fe24ab78cce2dc48a6232dcd824a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Jun 2012 20:55:18 +0000 Subject: - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/common.h | 4 ++-- plugins/Popup/src/config.cpp | 2 +- plugins/Popup/src/formula.cpp | 6 +++--- plugins/Popup/src/formula.h | 4 ++-- plugins/Popup/src/icons.cpp | 2 +- plugins/Popup/src/main.cpp | 8 ++++---- plugins/Popup/src/notifications.cpp | 2 +- plugins/Popup/src/opt_adv.cpp | 12 ++++++------ plugins/Popup/src/opt_contacts.cpp | 2 +- plugins/Popup/src/opt_gen.cpp | 6 +++--- plugins/Popup/src/opt_skins.cpp | 12 ++++++------ plugins/Popup/src/popup_wnd2.cpp | 10 +++++----- plugins/Popup/src/services.cpp | 4 ++-- plugins/Popup/src/skin.cpp | 2 +- 14 files changed, 38 insertions(+), 38 deletions(-) (limited to 'plugins/Popup') diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index d975e0df0c..3b5ecae721 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -127,7 +127,7 @@ inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleNam ret = (INT_PTR)mir_strdup(result ? Default : dbv.pszVal); break; case DBVT_WCHAR: - if(!result) { + if (!result) { ret = (INT_PTR)mir_wstrdup(dbv.pwszVal); } else { @@ -137,7 +137,7 @@ inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleNam default: break; } - if(!result) + if (!result) CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)&dbv); return ret; } diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index 5831de512e..0f4dbb1309 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -112,7 +112,7 @@ void LoadOptions() { #endif //Load PopUp Options - if(!OptionLoaded){ + if (!OptionLoaded){ LoadOption_General(); LoadOption_Skins(); LoadOption_Actions(); diff --git a/plugins/Popup/src/formula.cpp b/plugins/Popup/src/formula.cpp index 37002c9d18..86f102890a 100644 --- a/plugins/Popup/src/formula.cpp +++ b/plugins/Popup/src/formula.cpp @@ -98,16 +98,16 @@ int Formula::eval_mul(char *&s, Args *args, bool *vars) const { ++s; } else - if(*s == '*') + if (*s == '*') { left *= eval_atom(++s, args, vars); } else - if(*s == '/') + if (*s == '/') { if (int right = eval_atom(++s, args, vars)) left /= right; } else - if(*s == '%') + if (*s == '%') { if (int right = eval_atom(++s, args, vars)) left %= right; diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h index b0239c5551..d227613fd0 100644 --- a/plugins/Popup/src/formula.h +++ b/plugins/Popup/src/formula.h @@ -88,8 +88,8 @@ private: int eval_atom(char *&s, Args *args, bool *vars) const; public: - Formula():m_str(mir_strdup("")){} - Formula(char *s):m_str(mir_strdup(s)){} + Formula():m_str(mir_strdup("")) {} + Formula(char *s):m_str(mir_strdup(s)) {} ~Formula() {mir_free(m_str);} void set(char *s){mir_free(m_str);m_str=mir_strdup(s);} int eval(Args *args, bool *vars = 0) const; diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp index cb6e87dcc7..5bfd22f49c 100644 --- a/plugins/Popup/src/icons.cpp +++ b/plugins/Popup/src/icons.cpp @@ -101,7 +101,7 @@ void InitIcons() TCHAR selfDLL[1024]; GetModuleFileName(hInst, selfDLL, 1024); - for(int i = 0; i < SIZEOF(icoDesc); i++){ + for(int i = 0; i < SIZEOF(icoDesc); i++) { sid.pszName = icoDesc[i].pszName; sid.ptszDescription = icoDesc[i].ptszDesc; // [TRANSLATED-BY-CORE] sid.ptszSection = icoDesc[i].ptszSection; //must be always untranslatet !!!!! diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 41ad1b56ce..ab89e61d5f 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -349,7 +349,7 @@ INT_PTR GetStatus(WPARAM wp, LPARAM lp) } //register Updatersupport -void registerUpdate(){ +void registerUpdate() { Update update = {0}; char szVersion[16]; update.cbSize = sizeof(Update); @@ -374,7 +374,7 @@ void registerUpdate(){ } //register Hotkey -void LoadHotkey(){ +void LoadHotkey() { HOTKEYDESC hk = {0}; hk.cbSize = sizeof(hk); hk.dwFlags = HKD_TCHAR; @@ -429,7 +429,7 @@ static int ModulesLoaded(WPARAM wParam,LPARAM lParam) } //check if OptionLoaded - if(!OptionLoaded){ + if (!OptionLoaded){ LoadOptions(); } /*/deprecatet stuff @@ -661,7 +661,7 @@ MIRAPI int Load(PLUGINLINK *link) hbmNoAvatar = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_NOAVATAR)); - if(!OptionLoaded){ + if (!OptionLoaded){ LoadOptions(); } diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 89cf7d8991..c693405bdc 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -244,7 +244,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ) { for(int i = 0; i < gTreeData.getCount(); i++) { - if( gTreeData[i]->typ == typ && + if ( gTreeData[i]->typ == typ && (!group || (_tcscmp(gTreeData[i]->pszTreeRoot, group) == 0)) && (!name || (_tcscmp(gTreeData[i]->pszDescription, name) == 0)) ) { diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index f8fcd5f619..7ada1662f2 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -405,7 +405,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM } break; case EN_CHANGE: //Edit controls change - if(!bDlgInit) break; + if (!bDlgInit) break; switch(idCtrl) { //lParam = Handle to the control case IDC_MAXPOPUPS: @@ -420,7 +420,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_HISTORYSIZE: { int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE); - if( histSize > 0 && + if ( histSize > 0 && histSize <= SETTING_HISTORYSIZE_MAX){ PopUpOptions.HistorySize = histSize; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); @@ -430,7 +430,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_AVT_RADIUS: { int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE); - if( avtRadius <= SETTING_AVTSIZE_MAX / 2 ){ + if ( avtRadius <= SETTING_AVTSIZE_MAX / 2 ) { PopUpOptions.avatarRadius = avtRadius; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); } @@ -439,8 +439,8 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_FADEIN: { int fadeIn = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE); - if( fadeIn >= SETTING_FADEINTIME_MIN && - fadeIn <= SETTING_FADEINTIME_MAX ){ + if ( fadeIn >= SETTING_FADEINTIME_MIN && + fadeIn <= SETTING_FADEINTIME_MAX ) { PopUpOptions.FadeIn = fadeIn; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); } @@ -449,7 +449,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_FADEOUT: { int fadeOut = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE); - if( fadeOut >= SETTING_FADEOUTTIME_MIN && + if ( fadeOut >= SETTING_FADEOUTTIME_MIN && fadeOut <= SETTING_FADEOUTTIME_MAX){ PopUpOptions.FadeOut = fadeOut; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 582a85ae77..16a1963e14 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -88,7 +88,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if(nm->iColumn==-1) break; hItem=(HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y)); if(hItem==NULL) break; - if(!(hitFlags&CLCHT_ONITEMEXTRA)) break; + if (!(hitFlags&CLCHT_ONITEMEXTRA)) break; iImage=SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0)); if (iImage != 0xFF) diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 109598ee87..4538e2b9fa 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -307,7 +307,7 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth); EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth); SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopUpOptions.DynamicResize ? TranslateT("Maximum width"): TranslateT("Width")); - if(!PopUpOptions.DynamicResize) { + if (!PopUpOptions.DynamicResize) { PopUpOptions.UseMaximumWidth = TRUE; CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, BST_CHECKED); EnableWindow(GetDlgItem(hwnd, IDC_USEMAXIMUMWIDTH), TRUE); @@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_USEMAXIMUMWIDTH: { PopUpOptions.UseMaximumWidth= Button_GetCheck((HWND)lParam); - if(!PopUpOptions.DynamicResize) { //ugly - set always on if DynamicResize = off + if (!PopUpOptions.DynamicResize) { //ugly - set always on if DynamicResize = off CheckDlgButton(hwnd, idCtrl, BST_CHECKED); PopUpOptions.UseMaximumWidth = TRUE; } @@ -432,7 +432,7 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM } break; case EN_CHANGE: //Edit controls change - if(!bDlgInit) break; + if (!bDlgInit) break; switch(idCtrl) { //lParam = Handle to the control case IDC_SECONDS: diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index d91efe5afd..033c26c6a7 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -211,7 +211,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos LPTSTR pszName = NULL; if (skin = skins.getSkin(PopUpOptions.SkinPack)) { for (int i = 1; i <= 10; i++) { - if(!skin->getFlagName(i)) + if (!skin->getFlagName(i)) continue; *OptionsCount += 1; options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount)); @@ -249,17 +249,17 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos bCheck = PopUpOptions.DisplayTime; break; case 1: - if(!IsWinVerXPPlus()) continue; + if (!IsWinVerXPPlus()) continue; *dwGlobalOptions |= PopUpOptions.DropShadow ? (1 << i) : 0; bCheck = PopUpOptions.DropShadow; break; case 2: - if(!IsWinVerXPPlus()) continue; + if (!IsWinVerXPPlus()) continue; *dwGlobalOptions |= PopUpOptions.EnableFreeformShadows ? (1 << i) : 0; bCheck = PopUpOptions.EnableFreeformShadows; break; case 3: - if(!MyDwmEnableBlurBehindWindow) continue; + if (!MyDwmEnableBlurBehindWindow) continue; *dwGlobalOptions |= PopUpOptions.EnableAeroGlass ? (1 << i) : 0; bCheck = PopUpOptions.EnableAeroGlass; break; @@ -268,7 +268,7 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos bCheck = PopUpOptions.UseWinColors; break; case 5: - if(!(htuText&&htuTitle)) continue; + if (!(htuText&&htuTitle)) continue; *dwGlobalOptions |= PopUpOptions.UseMText ? (1 << i) : 0; bCheck = PopUpOptions.UseMText; break; @@ -521,7 +521,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE; case WM_NOTIFY: { - if(!bDlgInit) return FALSE; + if (!bDlgInit) return FALSE; switch (((LPNMHDR)lParam)->idFrom) { case 0: { switch (((LPNMHDR)lParam)->code) { diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 785c0e706e..7658e0ff76 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -242,7 +242,7 @@ void PopupWnd2::create() if (m_options->DropShadow && !(style & CS_DROPSHADOW)) { style |= CS_DROPSHADOW; } - else if (!m_options->DropShadow && (style & CS_DROPSHADOW)){ + else if (!m_options->DropShadow && (style & CS_DROPSHADOW)) { style &= ~CS_DROPSHADOW; } SetClassLongPtr(m_hwnd, GCL_STYLE, style); @@ -1092,7 +1092,7 @@ BOOL IsUtfSendAvailable(HANDLE hContact) //check for MetaContact and get szProto from subcontact if(strcmp(szProto, gszMetaProto)==0) { HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0); - if(!hSubContact) return FALSE; + if (!hSubContact) return FALSE; szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hSubContact, 0); } return(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF) ? TRUE : FALSE; @@ -1470,7 +1470,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara if (i == m_actionCount) { - if(PopUpOptions.overrideLeft!=false && (m_hContact!=NULL || PopUpOptions.overrideLeft == 5 || PopUpOptions.overrideLeft == 6)){ + if(PopUpOptions.overrideLeft!=false && (m_hContact!=NULL || PopUpOptions.overrideLeft == 5 || PopUpOptions.overrideLeft == 6)) { switch (PopUpOptions.overrideLeft){ default: case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break; @@ -1493,7 +1493,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara case WM_MBUTTONUP: { - if(PopUpOptions.overrideMiddle!=false && (m_hContact!=NULL || PopUpOptions.overrideMiddle == 5 || PopUpOptions.overrideMiddle == 6)){ + if(PopUpOptions.overrideMiddle!=false && (m_hContact!=NULL || PopUpOptions.overrideMiddle == 5 || PopUpOptions.overrideMiddle == 6)) { switch (PopUpOptions.overrideMiddle){ default: case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break; @@ -1510,7 +1510,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara case WM_CONTEXTMENU: { - if(PopUpOptions.overrideRight!=false && (m_hContact!=NULL || PopUpOptions.overrideRight == 5 || PopUpOptions.overrideRight == 6)){ + if(PopUpOptions.overrideRight!=false && (m_hContact!=NULL || PopUpOptions.overrideRight == 5 || PopUpOptions.overrideRight == 6)) { switch (PopUpOptions.overrideRight){ default: case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break; diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 48f1919d12..ca1c700781 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -424,7 +424,7 @@ INT_PTR PopUp_Change2(WPARAM wParam, LPARAM lParam) //===== PopUp/ShowMessage INT_PTR PopUp_ShowMessage(WPARAM wParam, LPARAM lParam) { - if(!gbPopupLoaded || !wParam || !lParam) return -1; + if (!gbPopupLoaded || !wParam || !lParam) return -1; if(closing) return 0; POPUPDATA2 ppd2 = {0}; @@ -460,7 +460,7 @@ INT_PTR PopUp_ShowMessage(WPARAM wParam, LPARAM lParam) { } INT_PTR PopUp_ShowMessageW(WPARAM wParam, LPARAM lParam) { - if(!gbPopupLoaded || !wParam || !lParam) return -1; + if (!gbPopupLoaded || !wParam || !lParam) return -1; if(closing) return 0; POPUPDATA2 ppd2 = {0}; diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index d3847f6f7c..c18dcde07f 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -1152,7 +1152,7 @@ void PopupSkin::loadSkin(std::istream &f) void PopupSkin::loadSkin(LPCTSTR fn) { - if(!fn) return; + if (!fn) return; #if defined (_UNICODE) && _MSC_VER <= 1200 char* temp= mir_t2a(fn); std::ifstream theFile; -- cgit v1.2.3