diff options
author | ghazan <ghazan@miranda.im> | 2021-12-19 18:47:56 +0300 |
---|---|---|
committer | ghazan <ghazan@miranda.im> | 2021-12-19 18:47:56 +0300 |
commit | 16809066c4931a34de2403e4c0bfcee3b98f42b5 (patch) | |
tree | b51fa56f16f3673f9213c1f022f293f21bfc3351 /src/mir_app | |
parent | c8fbefe8f38a74bfaea88a195c71a6e0c94c7a6a (diff) |
further code cleaning
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/CMPluginBase.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/IcoLib.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/addcontact.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/auth.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/contacts.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/database.cpp | 4 |
6 files changed, 12 insertions, 8 deletions
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index 1b8495eb71..94c41c84bf 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -288,6 +288,7 @@ void CMPluginBase::debugLogW(LPCWSTR wszFormat, ...) ///////////////////////////////////////////////////////////////////////////////////////// +#ifdef _WINDOWS int CMPluginBase::addImgListIcon(HIMAGELIST himl, int iconId) { HICON hIcon = getIcon(iconId); @@ -295,6 +296,7 @@ int CMPluginBase::addImgListIcon(HIMAGELIST himl, int iconId) IcoLib_ReleaseIcon(hIcon); return ret; } +#endif HICON CMPluginBase::getIcon(int iconId, bool big) { diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 1f47c76d55..efec47bc05 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -107,7 +107,7 @@ struct IcolibItem : public MZeroedObject UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HICON *phicon, UINT flags);
-void __fastcall SafeDestroyIcon(HICON &icon);
+void SafeDestroyIcon(HICON &icon);
IconSourceItem* GetIconSourceItem(const wchar_t* file, int indx, int cxIcon, int cyIcon);
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index c4520d37ba..a749fae087 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -193,7 +193,7 @@ MIR_APP_DLL(void) Contact_AddByEvent(MEVENT hEvent, HWND hwndParent) DWORD dwData[2];
DBEVENTINFO dbei = {};
dbei.cbBlob = sizeof(dwData);
- dbei.pBlob = (PBYTE)&dwData;
+ dbei.pBlob = (BYTE*)&dwData;
db_event_get(hEvent, &dbei);
if (dwData[0] != 0)
m_szName.Format(L"%d", dwData[0]);
diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp index dd448a2b61..c861bf57cb 100644 --- a/src/mir_app/src/auth.cpp +++ b/src/mir_app/src/auth.cpp @@ -61,7 +61,7 @@ public: m_szProto = dbei.szModule; - DWORD uin = *(PDWORD)dbei.pBlob; + DWORD uin = *(DWORD*)dbei.pBlob; m_hContact = DbGetAuthEventContact(&dbei); char *nick = (char*)dbei.pBlob + sizeof(DWORD) * 2; char *first = nick + mir_strlen(nick) + 1; diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index ef749d21d5..7172608ae2 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -66,7 +66,7 @@ static wchar_t* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szPro case DBVT_DWORD:
return mir_wstrdup(_itow(dbv.dVal, buf, 10));
case DBVT_BLOB:
- return mir_wstrdup(bin2hexW(dbv.pbVal, min(dbv.cpbVal, 19), buf));
+ return mir_wstrdup(bin2hexW(dbv.pbVal, std::min(int(dbv.cpbVal), 19), buf));
}
db_free(&dbv);
@@ -147,7 +147,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s DBVARIANT dbv2;
if (!db_get_ws(hContact, szProto, "LastName", &dbv2)) {
size_t len = mir_wstrlen(dbv.pwszVal) + mir_wstrlen(dbv2.pwszVal) + 2;
- WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
+ wchar_t *buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
if (buf != nullptr)
mir_wstrcat(mir_wstrcat(mir_wstrcpy(buf, dbv.pwszVal), L" "), dbv2.pwszVal);
db_free(&dbv);
@@ -215,7 +215,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s if (!db_get_ws(hContact, szProto, uid, &dbv)) {
if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD) {
long value = (dbv.type == DBVT_BYTE) ? dbv.bVal : (dbv.type == DBVT_WORD ? dbv.wVal : dbv.dVal);
- WCHAR buf[40];
+ wchar_t buf[40];
_ltow(value, buf, 10);
return mir_wstrdup(buf);
}
@@ -230,7 +230,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s DBVARIANT dbv2;
if (!db_get_ws(hContact, szProto, nameOrder[i] == 6 ? "LastName" : "FirstName", &dbv2)) {
size_t len = mir_wstrlen(dbv.pwszVal) + mir_wstrlen(dbv2.pwszVal) + 2;
- WCHAR* buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
+ wchar_t *buf = (WCHAR*)mir_alloc(sizeof(WCHAR)*len);
if (buf != nullptr)
mir_wstrcat(mir_wstrcat(mir_wstrcpy(buf, dbv.pwszVal), L" "), dbv2.pwszVal);
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 630d8f9aab..bf0b23e4c3 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -93,12 +93,14 @@ int isValidProfileName(const wchar_t *name) // returns 1 if the profile manager should be shown
static bool showProfileManager(void)
{
- wchar_t Mgr[32];
// is control pressed?
+ #ifdef _WINDOWS
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
return 1;
+ #endif
// wanna show it?
+ wchar_t Mgr[32];
Profile_GetSetting(L"Database/ShowProfileMgr", Mgr, L"never");
return (mir_wstrcmpi(Mgr, L"yes") == 0);
}
|