From a45bb7a68890742e03c834c0f63b844ff822f16e Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 7 Apr 2013 08:58:22 +0000 Subject: project cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@4358 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YahooGroups/YahooGroups_10.vcxproj | 18 ++---- plugins/YahooGroups/YahooGroups_11.vcxproj | 18 ++---- plugins/YahooGroups/res/YahooGroups.rc | 2 +- plugins/YahooGroups/res/version.rc | 88 +++++------------------------- plugins/YahooGroups/src/YahooGroups.cpp | 16 +++--- plugins/YahooGroups/src/commonheaders.h | 30 ++++------ plugins/YahooGroups/src/list.h | 1 - plugins/YahooGroups/src/services.h | 1 - plugins/YahooGroups/src/utils.cpp | 37 ++++--------- plugins/YahooGroups/src/utils.h | 3 - plugins/YahooGroups/src/version.h | 34 +++++------- 11 files changed, 67 insertions(+), 181 deletions(-) (limited to 'plugins/YahooGroups') diff --git a/plugins/YahooGroups/YahooGroups_10.vcxproj b/plugins/YahooGroups/YahooGroups_10.vcxproj index 1a73cb5e3d..25b3e1cb15 100644 --- a/plugins/YahooGroups/YahooGroups_10.vcxproj +++ b/plugins/YahooGroups/YahooGroups_10.vcxproj @@ -20,28 +20,26 @@ {0E73244B-30D7-4A62-B4B3-9A32B96EC1B7} - YahooGroups - Win32Proj YahooGroups DynamicLibrary - NotSet + Unicode true DynamicLibrary - NotSet + Unicode true DynamicLibrary - NotSet + Unicode DynamicLibrary - NotSet + Unicode @@ -65,14 +63,11 @@ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - true $(SolutionDir)$(Configuration)\Plugins\ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - false - false + true @@ -108,7 +103,6 @@ MultiThreadedDebugDLL Use Level3 - ProgramDatabase ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) commonheaders.h false @@ -132,7 +126,6 @@ WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Use Level3 - ProgramDatabase ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) commonheaders.h true @@ -161,7 +154,6 @@ WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Use Level3 - ProgramDatabase ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) commonheaders.h true diff --git a/plugins/YahooGroups/YahooGroups_11.vcxproj b/plugins/YahooGroups/YahooGroups_11.vcxproj index c9b98c60be..51189509a3 100644 --- a/plugins/YahooGroups/YahooGroups_11.vcxproj +++ b/plugins/YahooGroups/YahooGroups_11.vcxproj @@ -20,31 +20,29 @@ {0E73244B-30D7-4A62-B4B3-9A32B96EC1B7} - YahooGroups - Win32Proj YahooGroups DynamicLibrary - NotSet + Unicode v110_xp true DynamicLibrary - NotSet + Unicode v110_xp true DynamicLibrary - NotSet + Unicode v110_xp DynamicLibrary - NotSet + Unicode v110_xp @@ -69,14 +67,11 @@ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - true $(SolutionDir)$(Configuration)\Plugins\ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - false - false + true @@ -113,7 +108,6 @@ MultiThreadedDebugDLL Use Level3 - ProgramDatabase ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) commonheaders.h false @@ -137,7 +131,6 @@ WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Use Level3 - ProgramDatabase ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) commonheaders.h true @@ -166,7 +159,6 @@ WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Use Level3 - ProgramDatabase ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) commonheaders.h true diff --git a/plugins/YahooGroups/res/YahooGroups.rc b/plugins/YahooGroups/res/YahooGroups.rc index 850df9e92d..9d81b51149 100644 --- a/plugins/YahooGroups/res/YahooGroups.rc +++ b/plugins/YahooGroups/res/YahooGroups.rc @@ -29,7 +29,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 1 TEXTINCLUDE BEGIN - "resource.h\0" + "..\\src\\resource.h\0" END 2 TEXTINCLUDE diff --git a/plugins/YahooGroups/res/version.rc b/plugins/YahooGroups/res/version.rc index dcab769d88..5bfbab4754 100644 --- a/plugins/YahooGroups/res/version.rc +++ b/plugins/YahooGroups/res/version.rc @@ -1,61 +1,15 @@ // Microsoft Visual C++ generated resource script. // -#include "..\src\resource.h" -#include "..\src\version.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - #ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// +#include "afxres.h" +#include "..\src\version.h" VS_VERSION_INFO VERSIONINFO - FILEVERSION __PLUGINVERSION_STRING - PRODUCTVERSION __PLUGINVERSION_STRING + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -63,38 +17,22 @@ VS_VERSION_INFO VERSIONINFO FILEFLAGS 0x0L #endif FILEOS 0x4L - FILETYPE 0x2L + FILETYPE 0x0L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN - BLOCK "040904b0" + BLOCK "000004b0" BEGIN - VALUE "Author", __AUTHOR - VALUE "FileDescription", __DESC - VALUE "FileVersion", __VERSION_STRING - VALUE "InternalName", __PLUGIN_DISPLAY_NAME + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x0, 1200 END END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/YahooGroups/src/YahooGroups.cpp b/plugins/YahooGroups/src/YahooGroups.cpp index 38f5656335..f867404140 100644 --- a/plugins/YahooGroups/src/YahooGroups.cpp +++ b/plugins/YahooGroups/src/YahooGroups.cpp @@ -28,18 +28,18 @@ int hLangpack = 0; PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), - __PLUGIN_DISPLAY_NAME, - VERSION, - __DESC, + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, __AUTHOR, __AUTHOREMAIL, __COPYRIGHT, __AUTHORWEB, - 0, //unicode aware - {0x2f3fe8b9, 0x7327, 0x4008, {0xa6, 0x0d, 0x93, 0xf0, 0xf4, 0xf7, 0xf0, 0xf1}} //{2f3fe8b9-7327-4008-a60d-93f0f4f7f0f1} -}; //not used + UNICODE_AWARE, + // {2F3FE8B9-7327-4008-A60D-93F0F4F7F0F1} + {0x2f3fe8b9, 0x7327, 0x4008, {0xa6, 0x0d, 0x93, 0xf0, 0xf4, 0xf7, 0xf0, 0xf1}} +}; - extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfo; @@ -68,7 +68,7 @@ extern "C" int __declspec(dllexport) Unload() return 0; } -bool WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { hInstance = hinstDLL; if (fdwReason == DLL_PROCESS_ATTACH) diff --git a/plugins/YahooGroups/src/commonheaders.h b/plugins/YahooGroups/src/commonheaders.h index 20125002f1..e89e48e214 100644 --- a/plugins/YahooGroups/src/commonheaders.h +++ b/plugins/YahooGroups/src/commonheaders.h @@ -24,36 +24,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define _CRT_SECURE_NO_WARNINGS -#include -#include -#include #include -#include - -#include "version.h" -#include "dlg_handlers.h" -#include "hooked_events.h" -#include "services.h" -#include "list.h" -#include "services.h" -#include "utils.h" - -#include "resource.h" #include #include -#include #include -#include #include #include #include #include -#include #include -#include -#include -#include +#include + +#include "version.h" +#include "dlg_handlers.h" +#include "hooked_events.h" +#include "services.h" +#include "list.h" +#include "services.h" +#include "utils.h" +#include "resource.h" extern char ModuleName[]; extern HINSTANCE hInstance; diff --git a/plugins/YahooGroups/src/list.h b/plugins/YahooGroups/src/list.h index 2bc3c160a8..ef34699e7c 100644 --- a/plugins/YahooGroups/src/list.h +++ b/plugins/YahooGroups/src/list.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" - class CGroupsList { protected: diff --git a/plugins/YahooGroups/src/services.h b/plugins/YahooGroups/src/services.h index 4e7b424fee..dff16431d0 100644 --- a/plugins/YahooGroups/src/services.h +++ b/plugins/YahooGroups/src/services.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_YAHOOGROUPS_SERVICES_H #include "commonheaders.h" -#include "list.h" #define MS_YAHOOGROUPS_MOVE "YahooGroups/Groups/MoveToOfficialGroups" #define MS_YAHOOGROUPS_RESET "YahooGroups/Groups/Reset" diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index a2108af1f0..0a77deb1e4 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -80,14 +80,14 @@ int Info(char *title, char *format, ...) return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION); } -int MyPUShowMessage(char *lpzText, BYTE kind) +int MyPUShowMessage(TCHAR *lpzText, BYTE kind) { if (ServiceExists(MS_POPUP_SHOWMESSAGE)) { - return PUShowMessage(lpzText, kind); + return PUShowMessageT(lpzText, kind); } else{ - char *title = (kind == SM_NOTIFY) ? Translate("Notify") : Translate("Warning"); + TCHAR *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning"); return MessageBox(NULL, lpzText, title, MB_OK | (kind == SM_NOTIFY) ? MB_ICONINFORMATION : MB_ICONEXCLAMATION); } @@ -117,7 +117,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) { char buffer[32] = {0}; strcpy(buffer, "0x"); - STRNCPY(buffer + 2, inData, HEX_SIZE); + strncpy(buffer + 2, inData, HEX_SIZE); sscanf(buffer, "%x", &size); outData = (unsigned char*)new char[size*2]; UINT i; @@ -126,7 +126,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) buffer[4] = '\0'; //mark the end of the string for (i = 0; i < size; i++) { - STRNCPY(buffer + 2, &tmp[i * 2], 2); + strncpy(buffer + 2, &tmp[i * 2], 2); sscanf(buffer, "%x", &outData[i]); } i = size; @@ -210,7 +210,6 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count); } -#pragma warning (disable: 4312) TCHAR *GetContactName(HANDLE hContact, char *szProto) { CONTACTINFO ctInfo; @@ -246,16 +245,12 @@ TCHAR *GetContactName(HANDLE hContact, char *szProto) } return buffer; } -#pragma warning (default: 4312) -#pragma warning (disable: 4312) void GetContactProtocol(HANDLE hContact, char *szProto, int size) { GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size); } -#pragma warning (default: 4312) -#pragma warning (disable: 4312) TCHAR *GetContactID(HANDLE hContact) { char protocol[256]; @@ -282,7 +277,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) { case CNFT_BYTE: { - _stprintf(tmp, _T("%d"), ctInfo.bVal); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.bVal); buffer = _tcsdup(tmp); break; @@ -290,7 +285,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) case CNFT_WORD: { - _stprintf(tmp, _T("%d"), ctInfo.wVal); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.wVal); buffer = _tcsdup(tmp); break; @@ -298,7 +293,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) case CNFT_DWORD: { - _stprintf(tmp, _T("%ld"), ctInfo.dVal); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%ld"), ctInfo.dVal); buffer = _tcsdup(tmp); break; @@ -324,16 +319,14 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) return NULL; } } -#pragma warning (default: 4312) -#pragma warning (disable: 4312) HANDLE GetContactFromID(TCHAR *szID, char *szProto) { HANDLE hContact = db_find_first(); TCHAR *szHandle; TCHAR dispName[1024]; char cProtocol[256]; - char *tmp; + TCHAR *tmp; int found = 0; while (hContact) @@ -341,8 +334,8 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto) GetContactProtocol(hContact, cProtocol, sizeof(cProtocol)); szHandle = GetContactID(hContact, cProtocol); - tmp = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0); - STRNCPY(dispName, tmp, sizeof(dispName)); + tmp = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); + _tcsncpy(dispName, tmp, SIZEOF(dispName)); if ((szHandle) && ((_tcsicmp(szHandle, szID) == 0) || (_tcsicmp(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0))) { @@ -442,12 +435,4 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, rChild.top += cy; } return rChild; -} - -inline char *STRNCPY(char *output, const char *input, size_t size) -{ - char *res = strncpy(output, input, size); - output[size - 1] = 0; - - return res; } \ No newline at end of file diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index f2f0411de7..9133633caf 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_YAHOOGROUPS_UTILS_H #define M_YAHOOGROUPS_UTILS_H -#include #include "commonheaders.h" //#define USE_LOG @@ -59,6 +58,4 @@ void GetContactProtocol(HANDLE hContact, char *szProto, int size); int MyPUShowMessage(char *lpzText, BYTE kind); -inline char *STRNCPY(char *output, const char *input, size_t size); - #endif \ No newline at end of file diff --git a/plugins/YahooGroups/src/version.h b/plugins/YahooGroups/src/version.h index 1def768cf4..ef4f961521 100644 --- a/plugins/YahooGroups/src/version.h +++ b/plugins/YahooGroups/src/version.h @@ -21,25 +21,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_CMDLINE_VERSION_H #define M_CMDLINE_VERSION_H -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 0 -#define __RELEASE_NUM 1 -#define __BUILD_NUM 1 - -#define VERSION PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM) - -#define __PLUGINVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -#define __PLUGINVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -#define __STRINGIFY_(x) #x -#define __STRINGIFY(x) __STRINGIFY_(x) -#define __VERSION_STRING __STRINGIFY(__PLUGINVERSION_STRING_DOTS) - -#define __DESC "This plugin imports and creates the Yahoo groups defined in Yahoo Messenger." -#define __AUTHOR "Cristian Libotean" -#define __AUTHOREMAIL "eblis102@yahoo.com" -#define __COPYRIGHT "© 2007 Cristian Libotean" -#define __AUTHORWEB "http://www.miranda-ng.org/" - -#define __PLUGIN_DISPLAY_NAME "Yahoo Groups" +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 0 +#define __RELEASE_NUM 1 +#define __BUILD_NUM 1 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM + +#define __PLUGIN_NAME "Yahoo groups" +#define __FILENAME "YahooGroups.dll" +#define __DESCRIPTION "This plugin imports and creates the Yahoo groups defined in Yahoo Messenger." +#define __AUTHOR "Cristian Libotean" +#define __AUTHOREMAIL "eblis102@yahoo.com" +#define __AUTHORWEB "http://miranda-ng.org/" +#define __COPYRIGHT "© 2007 Cristian Libotean" #endif //M_CMDLINE_VERSION_H -- cgit v1.2.3