diff options
author | Vlad Mironov <mironych@googlemail.com> | 2013-02-21 15:59:28 +0000 |
---|---|---|
committer | Vlad Mironov <mironych@googlemail.com> | 2013-02-21 15:59:28 +0000 |
commit | 3b4342ead0909ee9f5d515db932272f901708a3a (patch) | |
tree | 7d79f463c8b05e5c14fa8fa1fa532e6facc90047 /plugins/TrafficCounter/src | |
parent | df14d39c07a22130218388e7ce421710580408be (diff) |
СЃ-plus-plusification
git-svn-id: http://svn.miranda-ng.org/main/trunk@3671 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TrafficCounter/src')
-rw-r--r-- | plugins/TrafficCounter/src/TrafficCounter.cpp (renamed from plugins/TrafficCounter/src/TrafficCounter.c) | 16 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/commonheaders.c | 1 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/commonheaders.cpp | 1 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/commonheaders.h | 11 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/misc.cpp (renamed from plugins/TrafficCounter/src/misc.c) | 0 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/opttree.cpp (renamed from plugins/TrafficCounter/src/opttree.c) | 0 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/statistics.cpp (renamed from plugins/TrafficCounter/src/statistics.c) | 7 | ||||
-rw-r--r-- | plugins/TrafficCounter/src/vars.cpp (renamed from plugins/TrafficCounter/src/vars.c) | 3 |
8 files changed, 24 insertions, 15 deletions
diff --git a/plugins/TrafficCounter/src/TrafficCounter.c b/plugins/TrafficCounter/src/TrafficCounter.cpp index a423804e64..8a9611328e 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.c +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -24,6 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /*-------------------------------------------------------------------------------------------------------------------*/
//GLOBAL
/*-------------------------------------------------------------------------------------------------------------------*/
+uTCFLAGS unOptions;
+PROTOLIST *ProtoList; // Данные обо всех аккаунтах.
+PROTOLIST OverallInfo; // Суммарные данные по видимым аккаунтам.
+int NumberOfAccounts;
+extern WORD Stat_SelAcc;
+HWND TrafficHwnd;
+DWORD mirandaVer;
+
HINSTANCE hInst;
int hLangpack = 0; // Поддержка плагинозависимого перевода.
@@ -109,7 +117,7 @@ PLUGININFOEX pluginInfoEx = {0x82181510, 0x5dfa, 0x49d7, { 0xb4, 0x69, 0x33, 0x87, 0x1e, 0x2a, 0xe8, 0xb5}} // {82181510-5DFA-49d7-B469-33871E2AE8B5}
};
-__declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
mirandaVer = mirandaVersion;
return &pluginInfoEx;
@@ -123,7 +131,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-int __declspec(dllexport) Load(void)
+extern "C" int __declspec(dllexport) Load(void)
{
if (mirandaVer < PLUGIN_MAKE_VERSION(0, 92, 2, 0)) return -1;
@@ -139,7 +147,7 @@ int __declspec(dllexport) Load(void) return 0;
}
-int __declspec(dllexport) Unload(void)
+extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
}
@@ -1137,7 +1145,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC) }
mir_free(ItemsList);
}
- dx = CallService(MS_VARS_FREEMEMORY, (WPARAM)(void*)buf, 0);
+ mir_free(buf);
rect.top += Traffic_LineHeight + Traffic_AdditionSpace;
}
diff --git a/plugins/TrafficCounter/src/commonheaders.c b/plugins/TrafficCounter/src/commonheaders.c deleted file mode 100644 index c9fe1b2686..0000000000 --- a/plugins/TrafficCounter/src/commonheaders.c +++ /dev/null @@ -1 +0,0 @@ -#include "commonheaders.h"
\ No newline at end of file diff --git a/plugins/TrafficCounter/src/commonheaders.cpp b/plugins/TrafficCounter/src/commonheaders.cpp new file mode 100644 index 0000000000..14f99f7d71 --- /dev/null +++ b/plugins/TrafficCounter/src/commonheaders.cpp @@ -0,0 +1 @@ +#include "commonheaders.h"
diff --git a/plugins/TrafficCounter/src/commonheaders.h b/plugins/TrafficCounter/src/commonheaders.h index bdc5974519..6b8a521308 100644 --- a/plugins/TrafficCounter/src/commonheaders.h +++ b/plugins/TrafficCounter/src/commonheaders.h @@ -115,7 +115,7 @@ typedef struct //---------------------------------------------------------------------------------------------
// Различные флаги
//---------------------------------------------------------------------------------------------
-union
+typedef union
{
DWORD Flags;
struct
@@ -141,14 +141,7 @@ union unsigned int Reserv1:1; //22
unsigned int DrawTotalTimeCounter:1; //23
};
-} unOptions;
-
-PROTOLIST *ProtoList; // Данные обо всех аккаунтах.
-PROTOLIST OverallInfo; // Суммарные данные по видимым аккаунтам.
-int NumberOfAccounts;
-WORD Stat_SelAcc; // Выбранные аккаунты в окне статистики
-HWND TrafficHwnd;
-DWORD mirandaVer;
+} uTCFLAGS;
#include "misc.h"
#include "opttree.h"
diff --git a/plugins/TrafficCounter/src/misc.c b/plugins/TrafficCounter/src/misc.cpp index 6320117246..6320117246 100644 --- a/plugins/TrafficCounter/src/misc.c +++ b/plugins/TrafficCounter/src/misc.cpp diff --git a/plugins/TrafficCounter/src/opttree.c b/plugins/TrafficCounter/src/opttree.cpp index 05502ee78e..05502ee78e 100644 --- a/plugins/TrafficCounter/src/opttree.c +++ b/plugins/TrafficCounter/src/opttree.cpp diff --git a/plugins/TrafficCounter/src/statistics.c b/plugins/TrafficCounter/src/statistics.cpp index 03e30f2e90..859ecb40a9 100644 --- a/plugins/TrafficCounter/src/statistics.c +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -24,6 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
#include <math.h>
+extern HWND TrafficHwnd;
+extern PROTOLIST *ProtoList;
+extern uTCFLAGS unOptions;
+WORD Stat_SelAcc; // Выбранные аккаунты в окне статистики
+
HWND hListAccs;
INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -748,4 +753,4 @@ BYTE Stat_GetEldestAcc(WORD SelectedAccs) }
return Result;
-}
\ No newline at end of file +}
diff --git a/plugins/TrafficCounter/src/vars.c b/plugins/TrafficCounter/src/vars.cpp index bc2cda965f..bca68d5569 100644 --- a/plugins/TrafficCounter/src/vars.c +++ b/plugins/TrafficCounter/src/vars.cpp @@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
+extern PROTOLIST *ProtoList;
+extern PROTOLIST OverallInfo;
+
static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
{
DWORD tmp, tmpsn = 0, tmprn = 0, tmpst = 0, tmprt = 0;
|