From 789aa2edb6337739caccbf0a5769d2419ffd4bb9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 24 Jul 2019 17:13:02 +0300 Subject: code cleaning --- include/delphi/m_hotkeys.inc | 2 +- include/m_clistint.h | 2 +- include/m_hotkeys.h | 2 +- include/m_netlib.h | 4 ++-- include/m_popup.h | 11 +++-------- include/m_protosvc.h | 2 +- plugins/TabSRMM/src/chat.h | 4 +--- plugins/TabSRMM/src/muchighlight.h | 8 ++++---- plugins/TabSRMM/src/themes.h | 4 ++-- src/core/stdpopup/src/options.cpp | 6 ++++-- src/mir_app/src/popups.cpp | 6 ++++-- 11 files changed, 24 insertions(+), 27 deletions(-) diff --git a/include/delphi/m_hotkeys.inc b/include/delphi/m_hotkeys.inc index 4fb0cfc659..e19a2585f3 100644 --- a/include/delphi/m_hotkeys.inc +++ b/include/delphi/m_hotkeys.inc @@ -35,8 +35,8 @@ type pszSection :TChar; // section name used to group sounds (NULL is acceptable) pszService :PAnsiChar; // Service to call when HotKey Pressed DefHotKey :word; // default hot key for action - lParam :LPARAM; // lParam to pass to service dwFlags :dword; // Miranda ver >=9.0 + lParam :LPARAM; // lParam to pass to service end; diff --git a/include/m_clistint.h b/include/m_clistint.h index 91be4838a6..00e60f1568 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -297,9 +297,9 @@ EXTERN_C MIR_APP_DLL(int) Clist_GetAccountIndex(int iPos); struct ClcCacheEntryBase { MCONTACT hContact; + int bIsHidden; wchar_t* tszName; wchar_t* tszGroup; - int bIsHidden; char* szProto; }; diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h index 7135cb35a1..b081256a6d 100644 --- a/include/m_hotkeys.h +++ b/include/m_hotkeys.h @@ -39,8 +39,8 @@ struct HOTKEYDESC MAllStrings szSection; // section name used to group sounds (NULL is acceptable) const char *pszService; // Service to call when HotKey Pressed WORD DefHotKey; // default hot key for action + DWORD dwFlags; // one of HKD_* constants LPARAM lParam; // lParam to pass to service - DWORD dwFlags; }; ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/include/m_netlib.h b/include/m_netlib.h index 75191e5731..046f502706 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -343,10 +343,10 @@ EXTERN_C MIR_APP_DLL(HNETLIBCONN) Netlib_OpenConnection(HNETLIBUSER nlu, const N struct NETLIBHTTPPROXYINFO { DWORD flags; - char *szHttpPostUrl; - char *szHttpGetUrl; int firstGetSequence, firstPostSequence; int combinePackets; + char *szHttpPostUrl; + char *szHttpGetUrl; }; EXTERN_C MIR_APP_DLL(int) Netlib_SetHttpProxyInfo(HNETLIBCONN hConnection, const NETLIBHTTPPROXYINFO *nlhpi); diff --git a/include/m_popup.h b/include/m_popup.h index c8f77d27b5..6a0bf86fa3 100644 --- a/include/m_popup.h +++ b/include/m_popup.h @@ -399,17 +399,12 @@ struct POPUPCLASS { int cbSize; int flags; // PCF_* constants + int iSeconds; + COLORREF colorBack, colorText; char *pszName; MAllStrings pszDescription; - HICON hIcon; - - COLORREF colorBack; - COLORREF colorText; - WNDPROC PluginWindowProc; - - int iSeconds; LPARAM lParam; //APF_RETURN_HWND, APF_CUSTOM_POPUP ... as above }; @@ -422,11 +417,11 @@ EXTERN_C MIR_APP_DLL(void) Popup_UnregisterClass(HANDLE ppc); struct POPUPDATACLASS { int cbSize; + MCONTACT hContact; const char *pszClassName; MAllCStrings szTitle; MAllCStrings szText; void *PluginData; - MCONTACT hContact; }; EXTERN_C MIR_APP_DLL(HWND) Popup_AddClass(POPUPDATACLASS*); diff --git a/include/m_protosvc.h b/include/m_protosvc.h index f137982ebd..81da5718c3 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -325,12 +325,12 @@ static __inline unsigned long Proto_Status2Flag(int status) struct PROTOSEARCHRESULT { int cbSize; + int flags; MAllStrings nick; MAllStrings firstName; MAllStrings lastName; MAllStrings email; MAllStrings id; - int flags; }; #define PS_BASICSEARCH "/BasicSearch" diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h index 29937c1346..6ff0094398 100644 --- a/plugins/TabSRMM/src/chat.h +++ b/plugins/TabSRMM/src/chat.h @@ -61,7 +61,6 @@ struct LOGSTREAMDATA : public GCLogStreamDataBase struct TMUCSettings : public GlobalLogSettingsBase { HICON hIconOverlay; - DWORD dwIconFlags; LONG iNickListFontHeight; HFONT UserListFonts[CHAT_STATUS_MAX]; @@ -70,13 +69,12 @@ struct TMUCSettings : public GlobalLogSettingsBase COLORREF nickColors[8]; HBRUSH SelectionBGBrush; bool bOpenInDefault, bBBCodeInPopups; - bool bShowContactStatus, bContactStatusFirst; bool bLogClassicIndicators, bAlternativeSorting, bAnnoyingHighlight, bCreateWindowOnHighlight; bool bLogSymbols, bClassicIndicators, bClickableNicks, bColorizeNicks, bColorizeNicksInLog; bool bScaleIcons, bUseCommaAsColon, bNewLineAfterNames; - CMUCHighlight* Highlight; + CMUCHighlight *Highlight; }; struct FLASH_PARAMS diff --git a/plugins/TabSRMM/src/muchighlight.h b/plugins/TabSRMM/src/muchighlight.h index 97b68886cc..46f0458fa0 100644 --- a/plugins/TabSRMM/src/muchighlight.h +++ b/plugins/TabSRMM/src/muchighlight.h @@ -56,15 +56,15 @@ private: void tokenize(wchar_t *tszString, wchar_t** &patterns, UINT &nr); DWORD m_dwFlags = 0; + UINT m_iNickPatterns = 0; + UINT m_iTextPatterns = 0; bool m_fInitialized = false; + bool m_Valid = true; + bool m_fHighlightMe; wchar_t **m_NickPatterns = nullptr; wchar_t **m_TextPatterns = nullptr; - UINT m_iNickPatterns = 0; - UINT m_iTextPatterns = 0; wchar_t *m_NickPatternString = nullptr; wchar_t *m_TextPatternString = nullptr; - bool m_Valid = true; - bool m_fHighlightMe; }; struct THighLightEdit diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 24057311da..8aec16d505 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -159,8 +159,8 @@ public: HBRUSH brush, BYTE alpha, LONG inner_height, LONG inner_width, LONG height, LONG width) { m_bBottom = bottom; - m_bLeft = left, - m_bTop = top; + m_bLeft = left; + m_bTop = top; m_bRight = right; m_hdc = hdc; m_hbm = hbm; diff --git a/src/core/stdpopup/src/options.cpp b/src/core/stdpopup/src/options.cpp index d8f10fe511..0dbbaba995 100644 --- a/src/core/stdpopup/src/options.cpp +++ b/src/core/stdpopup/src/options.cpp @@ -429,7 +429,8 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam if (arNewClasses[i]->flags & PCF_UNICODE) { POPUPCLASS pc = *arNewClasses[i]; pc.PluginWindowProc = nullptr; - POPUPDATACLASS d = { sizeof(d), pc.pszName }; + POPUPDATACLASS d = { sizeof(d) }; + d.pszClassName = pc.pszName; d.szTitle.w = L"Preview"; d.szText.w = L"The quick brown fox jumps over the lazy dog."; CallService(MS_POPUP_ADDPOPUPCLASS, (WPARAM)& pc, (LPARAM)& d); @@ -437,7 +438,8 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam else { POPUPCLASS pc = *arNewClasses[i]; pc.PluginWindowProc = nullptr; - POPUPDATACLASS d = { sizeof(d), pc.pszName }; + POPUPDATACLASS d = { sizeof(d) }; + d.pszClassName = pc.pszName; d.szTitle.a = "Preview"; d.szText.a = "The quick brown fox jumps over the lazy dog."; CallService(MS_POPUP_ADDPOPUPCLASS, (WPARAM)& pc, (LPARAM)& d); diff --git a/src/mir_app/src/popups.cpp b/src/mir_app/src/popups.cpp index d6958bcb46..c2ace7d45f 100644 --- a/src/mir_app/src/popups.cpp +++ b/src/mir_app/src/popups.cpp @@ -140,7 +140,8 @@ MIR_APP_DLL(HWND) Popup_AddClass(POPUPDATACLASS *pData) MIR_APP_DLL(HWND) ShowClassPopup(const char *name, const char *title, const char *text) { - POPUPDATACLASS d = { sizeof(d), name }; + POPUPDATACLASS d = { sizeof(d) }; + d.pszClassName = name; d.szTitle.a = title; d.szText.a = text; return (HWND)CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&d); @@ -148,7 +149,8 @@ MIR_APP_DLL(HWND) ShowClassPopup(const char *name, const char *title, const char MIR_APP_DLL(HWND) ShowClassPopupW(const char *name, const wchar_t *title, const wchar_t *text) { - POPUPDATACLASS d = { sizeof(d), name }; + POPUPDATACLASS d = { sizeof(d) }; + d.pszClassName = name; d.szTitle.w = title; d.szText.w = text; return (HWND)CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&d); -- cgit v1.2.3