summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghazan <ghazan@miranda.im>2021-12-19 18:47:56 +0300
committerghazan <ghazan@miranda.im>2021-12-19 18:47:56 +0300
commit16809066c4931a34de2403e4c0bfcee3b98f42b5 (patch)
treeb51fa56f16f3673f9213c1f022f293f21bfc3351
parentc8fbefe8f38a74bfaea88a195c71a6e0c94c7a6a (diff)
further code cleaning
-rw-r--r--codelite/Makefile8
-rw-r--r--codelite/Miranda.workspace4
-rw-r--r--include/m_options.h4
-rw-r--r--include/m_system.h4
-rw-r--r--include/m_types.h3
-rw-r--r--src/mir_app/src/CMPluginBase.cpp2
-rw-r--r--src/mir_app/src/IcoLib.h2
-rw-r--r--src/mir_app/src/addcontact.cpp2
-rw-r--r--src/mir_app/src/auth.cpp2
-rw-r--r--src/mir_app/src/contacts.cpp8
-rw-r--r--src/mir_app/src/database.cpp4
11 files changed, 20 insertions, 23 deletions
diff --git a/codelite/Makefile b/codelite/Makefile
index 04521d512f..109553266c 100644
--- a/codelite/Makefile
+++ b/codelite/Makefile
@@ -1,12 +1,8 @@
.PHONY: clean All
All:
- @echo "----------Building project:[ mir_core - Release ]----------"
- @cd "/var/www/miranda-ng/src/mir_core" && "$(MAKE)" -f "mir_core.mk"
- @echo "----------Building project:[ mir_app - Release ]----------"
+ @echo "----------Building project:[ mir_app - Debug ]----------"
@cd "/var/www/miranda-ng/src/mir_app" && "$(MAKE)" -f "mir_app.mk"
clean:
- @echo "----------Cleaning project:[ mir_core - Release ]----------"
- @cd "/var/www/miranda-ng/src/mir_core" && "$(MAKE)" -f "mir_core.mk" clean
- @echo "----------Cleaning project:[ mir_app - Release ]----------"
+ @echo "----------Cleaning project:[ mir_app - Debug ]----------"
@cd "/var/www/miranda-ng/src/mir_app" && "$(MAKE)" -f "mir_app.mk" clean
diff --git a/codelite/Miranda.workspace b/codelite/Miranda.workspace
index a6e9c4eaec..4f121248b2 100644
--- a/codelite/Miranda.workspace
+++ b/codelite/Miranda.workspace
@@ -5,12 +5,12 @@
<Project Name="mir_app" Path="../../../../var/www/miranda-ng/src/mir_app/mir_app.project" Active="Yes"/>
</VirtualDirectory>
<BuildMatrix>
- <WorkspaceConfiguration Name="Debug" Selected="no">
+ <WorkspaceConfiguration Name="Debug" Selected="yes">
<Environment/>
<Project Name="mir_core" ConfigName="Debug"/>
<Project Name="mir_app" ConfigName="Debug"/>
</WorkspaceConfiguration>
- <WorkspaceConfiguration Name="Release" Selected="yes">
+ <WorkspaceConfiguration Name="Release" Selected="no">
<Environment/>
<Project Name="mir_core" ConfigName="Release"/>
<Project Name="mir_app" ConfigName="Release"/>
diff --git a/include/m_options.h b/include/m_options.h
index 9c4783fa66..cdc352193b 100644
--- a/include/m_options.h
+++ b/include/m_options.h
@@ -63,12 +63,12 @@ struct OPTIONSDIALOGPAGE
{
int position; // a position number, lower numbers are topmost
MAllStrings szTitle, szGroup, szTab; // [TRANSLATED-BY-CORE]
- char *pszTemplate;
+ HPLUGIN pPlugin;
DWORD flags;
#ifdef _WINDOWS
DLGPROC pfnDlgProc;
- HPLUGIN pPlugin;
+ char *pszTemplate;
#endif
union {
diff --git a/include/m_system.h b/include/m_system.h
index 9994da7c67..5162b82692 100644
--- a/include/m_system.h
+++ b/include/m_system.h
@@ -39,9 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MIRANDA_VER 0x0A00
#endif
-#ifndef _MSC_VER
- #define __forceinline inline __attribute__ ((always_inline))
-#else
+#ifdef _MSC_VER
#pragma warning(disable:4244 4245)
#endif
diff --git a/include/m_types.h b/include/m_types.h
index 8538f6c2f2..dd22aa373f 100644
--- a/include/m_types.h
+++ b/include/m_types.h
@@ -84,6 +84,7 @@ struct LOGFONTW;
#define _Pre_notnull_
#define _Always_(x)
#define _Printf_format_string_
+#define __forceinline inline __attribute__ ((always_inline))
#define InterlockedIncrement(x) __sync_fetch_and_add(x, 1)
#define InterlockedDecrement(x) __sync_fetch_and_add(x, -1)
@@ -101,8 +102,6 @@ struct LOGFONTW;
#define _vsnprintf vsnprintf
#define _vsnwprintf vswprintf
-#define __forceinline inline
-
#define DECLARE_HANDLE(name) struct _##name { int unused; }; typedef struct _##name *name
DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HWND);
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);
}