From 58b2bcb0e39fde6c46b1b41c2eefdb6f505ffb17 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 12 Dec 2014 17:53:50 +0000 Subject: Sessions: changed warning lavel to w4 git-svn-id: http://svn.miranda-ng.org/main/trunk@11352 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Sessions/Sessions_12.vcxproj | 8 ++++---- plugins/Sessions/Src/Main.cpp | 35 +++++++++++++++++------------------ plugins/Sessions/Src/Options.cpp | 4 ++-- plugins/Sessions/Src/Sessions.h | 2 +- plugins/Sessions/Src/Utils.cpp | 20 ++++++-------------- 5 files changed, 30 insertions(+), 39 deletions(-) diff --git a/plugins/Sessions/Sessions_12.vcxproj b/plugins/Sessions/Sessions_12.vcxproj index 2113f258a0..b064929579 100644 --- a/plugins/Sessions/Sessions_12.vcxproj +++ b/plugins/Sessions/Sessions_12.vcxproj @@ -80,7 +80,7 @@ true true Use - Level3 + Level4 ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) Size sessions.h @@ -109,7 +109,7 @@ true true Use - Level3 + Level4 ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) Size sessions.h @@ -136,7 +136,7 @@ %(AdditionalOptions) MultiThreadedDebugDLL Use - Level3 + Level4 EditAndContinue ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) Disabled @@ -164,7 +164,7 @@ Disabled MultiThreadedDebugDLL Use - Level3 + Level4 ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) sessions.h _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 3e3dfde266..58309b3e81 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -30,7 +30,7 @@ bool g_hghostw; HWND hClistControl; int g_ses_limit; -int g_ses_count; +size_t g_ses_count; bool g_bExclHidden; bool g_bWarnOnHidden; bool g_bOtherWarnings; @@ -74,7 +74,7 @@ IconItem iconList[] = { LPGEN("Load last Session"), "SessionsLoadLast", IDD_SESSIONS_LOADLAST } }; -INT_PTR CALLBACK ExitDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK ExitDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) { switch (msg) { case WM_INITDIALOG: @@ -121,7 +121,6 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l case WM_INITDIALOG: TranslateDialogDefault(hdlg); { - HWND hList = GetDlgItem(hdlg, IDC_LIST); LoadSessionToCombobox(hdlg, 1, 5, "UserSessionDsc", 0); LoadPosition(hdlg, "SaveDlg"); @@ -250,7 +249,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l return TRUE; } -INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) { static int ses_count; @@ -395,7 +394,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l return TRUE; } -INT_PTR CloseCurrentSession(WPARAM wparam, LPARAM lparam) +INT_PTR CloseCurrentSession(WPARAM, LPARAM) { HWND hWnd; int i = 0; @@ -422,7 +421,7 @@ INT_PTR CloseCurrentSession(WPARAM wparam, LPARAM lparam) return 0; } -int SaveSessionHandles(WPARAM wparam, LPARAM lparam) +int SaveSessionHandles(WPARAM, LPARAM lparam) { if (session_list[0] == 0) return 1; @@ -445,7 +444,7 @@ int SaveSessionHandles(WPARAM wparam, LPARAM lparam) return 0; } -INT_PTR SaveUserSessionHandles(WPARAM wparam, LPARAM lparam) +INT_PTR SaveUserSessionHandles(WPARAM, LPARAM) { if (g_hSDlg) { ShowWindow(g_hSDlg, SW_SHOW); @@ -456,7 +455,7 @@ INT_PTR SaveUserSessionHandles(WPARAM wparam, LPARAM lparam) return 0; } -INT_PTR OpenSessionsManagerWindow(WPARAM wparam, LPARAM lparam) +INT_PTR OpenSessionsManagerWindow(WPARAM, LPARAM) { if (g_hDlg) { ShowWindow(g_hDlg, SW_SHOW); @@ -535,7 +534,7 @@ INT_PTR LoadLastSession(WPARAM wparam, LPARAM lparam) return 0; } -int LoadSession(WPARAM wparam, LPARAM lparam) +int LoadSession(WPARAM, LPARAM lparam) { int dup = 0; int hidden[255] = { '0' }; @@ -659,7 +658,7 @@ int DeleteAutoSession(int ses_count) return 0; } -int SessionPreShutdown(WPARAM wparam, LPARAM lparam) +int SessionPreShutdown(WPARAM, LPARAM) { DONT = 1; @@ -674,7 +673,7 @@ int SessionPreShutdown(WPARAM wparam, LPARAM lparam) return 0; } -int OkToExit(WPARAM wparam, LPARAM lparam) +int OkToExit(WPARAM, LPARAM) { int exitmode = db_get_b(NULL, MODNAME, "ShutdownMode", 2); DONT = 1; @@ -690,7 +689,7 @@ int OkToExit(WPARAM wparam, LPARAM lparam) return 0; } -static int GetContactHandle(WPARAM wparam, LPARAM lParam) +static int GetContactHandle(WPARAM, LPARAM lParam) { MessageWindowEventData *MWeventdata = (MessageWindowEventData*)lParam; if (MWeventdata->uType == MSG_WINDOW_EVT_OPEN) { @@ -707,7 +706,7 @@ static int GetContactHandle(WPARAM wparam, LPARAM lParam) return 0; } -INT_PTR BuildFavMenu(WPARAM wparam, LPARAM lparam) +INT_PTR BuildFavMenu(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); @@ -720,7 +719,7 @@ INT_PTR BuildFavMenu(WPARAM wparam, LPARAM lparam) return 0; } -static int CreateButtons(WPARAM wparam, LPARAM lparam) +static int CreateButtons(WPARAM, LPARAM) { TTBButton ttb = { sizeof(ttb) }; ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE; @@ -747,7 +746,7 @@ static int CreateButtons(WPARAM wparam, LPARAM lparam) return 0; } -static INT_PTR LaunchSessions(WPARAM wParam, LPARAM lParam) +static INT_PTR LaunchSessions(WPARAM wParam, LPARAM) { CallService(MS_SYSTEM_REMOVEWAIT, wParam, 0); CloseHandle((HANDLE)wParam); @@ -764,7 +763,7 @@ static INT_PTR LaunchSessions(WPARAM wParam, LPARAM lParam) return 0; } -static int PluginInit(WPARAM wparam, LPARAM lparam) +static int PluginInit(WPARAM, LPARAM) { HookEvent(ME_MSG_WINDOWEVENT, GetContactHandle); HookEvent(ME_OPT_INITIALISE, OptionsInit); @@ -829,7 +828,7 @@ static int PluginInit(WPARAM wparam, LPARAM lparam) return 0; } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; } @@ -839,7 +838,7 @@ extern "C" __declspec(dllexport) int Unload(void) return 0; } -BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinst, DWORD, LPVOID) { g_hInst = hinst; return 1; diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 25f60daaba..fb29c64c81 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -42,7 +42,7 @@ RECT rc; POINT pt; BOOL bChecked = FALSE; -int OpLoadSessionContacts(WPARAM wparam, LPARAM lparam) +int OpLoadSessionContacts(WPARAM, LPARAM lparam) { memset(session_list_t, 0, sizeof(session_list_t)); @@ -488,7 +488,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l return 0; } -int OptionsInit(WPARAM wparam, LPARAM lparam) +int OptionsInit(WPARAM wparam, LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.position = 955000000; diff --git a/plugins/Sessions/Src/Sessions.h b/plugins/Sessions/Src/Sessions.h index abc6a27bf2..46649fce28 100644 --- a/plugins/Sessions/Src/Sessions.h +++ b/plugins/Sessions/Src/Sessions.h @@ -65,7 +65,7 @@ extern HINSTANCE g_hInst; extern MCONTACT session_list_recovered[255]; extern MCONTACT session_list[255]; extern int g_ses_limit; -extern int g_ses_count; +extern size_t g_ses_count; extern bool g_bExclHidden; extern bool g_bWarnOnHidden; extern bool g_bOtherWarnings; diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 5143b637db..8101b7272b 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -50,7 +50,7 @@ void AddSessionMark(MCONTACT hContact, int mode, char bit) else pszBuffer = szValue.detouch(); char temp_1 = pszBuffer[0]; - for (int i = 0; i < g_ses_count; i++) { + for (size_t i = 0; i < g_ses_count; i++) { char temp_2 = pszBuffer[i + 1]; pszBuffer[i + 1] = temp_1; temp_1 = temp_2; @@ -126,8 +126,6 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count) void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) { - char szDst[256] = { '\0' }; - char szFormNumBuf[100]; mir_snprintf(szFormNumBuf, SIZEOF(szFormNumBuf), "%02u", ordernum); @@ -203,8 +201,6 @@ int GetInSessionOrder(MCONTACT hContact, int mode, int count) void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int ordernum) { - int iOrder = 0; - char szTemp[3]; mir_snprintf(szTemp, SIZEOF(szTemp), "%02u", ordernum); @@ -226,10 +222,8 @@ void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int orde } } -BOOL ResaveSettings(char* szName, int iFirst, int iLimit, TCHAR* szBuffer) +BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer) { - BYTE marked, marked_t; - for (int i = iFirst; i < iLimit; i++) { if (szBuffer == NULL) break; @@ -241,9 +235,8 @@ BOOL ResaveSettings(char* szName, int iFirst, int iLimit, TCHAR* szBuffer) db_set_ts(NULL, MODNAME, szNameBuf, szBuffer); mir_free(szBuffer); - marked = IsMarkedUserDefSession(i); - MarkUserDefSession(i, (BYTE)((i == iFirst) ? IsMarkedUserDefSession(iFirst - 1) : marked_t)); - marked_t = marked; + BYTE marked = IsMarkedUserDefSession(i); + MarkUserDefSession(i, (BYTE)((i == iFirst) ? IsMarkedUserDefSession(iFirst - 1) : marked)); if (ptszTemp == NULL) // read failed return 0; @@ -255,7 +248,7 @@ BOOL ResaveSettings(char* szName, int iFirst, int iLimit, TCHAR* szBuffer) return 1; } -int AddToCurSession(MCONTACT wparam, LPARAM lparam) +int AddToCurSession(MCONTACT wparam, LPARAM) { if (CheckForDuplicate(session_list, wparam) == -1) { for (int i = 0;; i++) { @@ -268,7 +261,7 @@ int AddToCurSession(MCONTACT wparam, LPARAM lparam) return 0; } -int DelFromCurSession(MCONTACT wparam, LPARAM lparam) +int DelFromCurSession(MCONTACT wparam, LPARAM) { for (int i = 0; session_list[i] != 0; i++) { if (session_list[i] == wparam) { @@ -292,7 +285,6 @@ int CheckForDuplicate(MCONTACT contact_list[], MCONTACT lparam) if (s_list[i] == 0) return -1; } - return 0; } int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, int iFirstNum) -- cgit v1.2.3