diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-03-12 12:04:51 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-03-12 12:04:51 +0000 |
commit | 454e1d9c3dd95d332f2a31c261991cf4ba450bcc (patch) | |
tree | 107705e96bf2d08c0d0572dec609bc4ffe57854e /plugins/MirOTR/src | |
parent | ec639ecbdf49731a0bec26240efb76eb203087bc (diff) |
MirOTR: Minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@16468 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/src')
-rw-r--r-- | plugins/MirOTR/src/dbfilter.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/src/dialogs.cpp | 21 | ||||
-rw-r--r-- | plugins/MirOTR/src/dialogs.h | 1 | ||||
-rw-r--r-- | plugins/MirOTR/src/dllmain.cpp | 6 | ||||
-rw-r--r-- | plugins/MirOTR/src/options.cpp | 8 | ||||
-rw-r--r-- | plugins/MirOTR/src/otr.cpp | 37 | ||||
-rw-r--r-- | plugins/MirOTR/src/svcs_menu.cpp | 12 |
7 files changed, 50 insertions, 39 deletions
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index 6c881c326f..131cf2b273 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -16,7 +16,7 @@ struct DeleteEventHead { }; static DeleteEventHead DeleteEvents = {0,0}; -VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { +void CALLBACK DeleteTimerProc(HWND, UINT, UINT_PTR, DWORD) { if (!DeleteEvents.first) return; mir_cslock lck(RemoveChainCS); DeleteEventNode *prev =0, *current, *next; @@ -163,7 +163,7 @@ void FinishSession(MCONTACT hContact) return; } -int WindowEvent(WPARAM wParam, LPARAM lParam) +int WindowEvent(WPARAM, LPARAM lParam) { MessageWindowEventData *mwd = (MessageWindowEventData *)lParam; if (mwd->uType == MSG_WINDOW_EVT_CLOSE && options.end_window_close) { diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index 2af5c8fd56..6f3e24a5ba 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -133,6 +133,7 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, case IDOK: smp_for_contact.erase(context->app_data); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL); + // fall through case IDCANCEL: DestroyWindow(hwndDlg); break; @@ -408,25 +409,24 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam { ConnContext *context = (ConnContext*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); MCONTACT hContact = (UINT_PTR)context->app_data; - TCHAR msg[1024]; + TCHAR szMsg[1024]; switch (LOWORD(wParam)) { case IDCANCEL: DestroyWindow(hwndDlg); break; case IDOK: - GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, msg, 255); - if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_QUESTION), 255) == 0) { + GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, szMsg, _countof(szMsg)); + if (_tcsncmp(szMsg, TranslateT(LANG_SMPTYPE_QUESTION), _countof(szMsg)) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { - TCHAR msg[512]; - mir_sntprintf(msg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); - ShowError(msg); + mir_sntprintf(szMsg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + ShowError(szMsg); } else { int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, WM_GETTEXTLENGTH, 0, 0); TCHAR *question = new TCHAR[len + 1]; GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, question, len + 1); T2Utf quest(question); - delete question; + delete[] question; len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0); TCHAR *answer = new TCHAR[len + 1]; @@ -439,11 +439,10 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam } } - else if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_PASSWORD), 255) == 0) { + else if (_tcsncmp(szMsg, TranslateT(LANG_SMPTYPE_PASSWORD), _countof(szMsg)) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { - TCHAR msg[512]; - mir_sntprintf(msg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); - ShowError(msg); + mir_sntprintf(szMsg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + ShowError(szMsg); } else { int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0); diff --git a/plugins/MirOTR/src/dialogs.h b/plugins/MirOTR/src/dialogs.h index 39db06189f..3e259d2797 100644 --- a/plugins/MirOTR/src/dialogs.h +++ b/plugins/MirOTR/src/dialogs.h @@ -1,7 +1,6 @@ #pragma once void VerifyContextDialog(ConnContext* context); void SMPInitDialog(ConnContext* context); -INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void SMPDialogUpdate(ConnContext *context, int percent); void SMPDialogReply(ConnContext *context, const char* question); diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp index 6e0e771756..218f53e94a 100644 --- a/plugins/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/src/dllmain.cpp @@ -21,18 +21,18 @@ PLUGININFOEX pluginInfo={ {0x12d8faad, 0x78ab, 0x4e3c, {0x98, 0x54, 0x32, 0xe, 0x9e, 0xa5, 0xcc, 0x9f}}
};
-BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
+BOOL APIENTRY DllMain(HMODULE hModule, DWORD, LPVOID)
{
hInst = hModule;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
lib_cs_lock();
otr_user_state = otrl_userstate_create();
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 456635bf13..a5259ae98e 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -26,7 +26,7 @@ void SetFilenames(const TCHAR *path) mir_sntprintf(g_instag_filename, _T("%s\\") _T(INSTAG_FILENAME), path); } -int FoldersChanged(WPARAM wParam, LPARAM lParam) +int FoldersChanged(WPARAM, LPARAM) { TCHAR path[MAX_PATH]; if ( FoldersGetCustomPathT(hPATH_MIROTR, path, _countof(path), _T(""))) @@ -112,7 +112,7 @@ void SaveOptions() db_set_b(0, MODULENAME, "EndWindowClose", options.end_window_close ? 1 : 0); } -extern "C" void set_context_contact(void *data, ConnContext *context) +extern "C" void set_context_contact(void *, ConnContext *context) { MCONTACT hContact = find_contact(context->username, context->protocol); context->app_data = (void*)hContact; @@ -382,7 +382,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP case IDC_CMB_PROTO_POLICY: int proto = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS)); if (proto == -1) break; - int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETCURSEL, 0, 0); + sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETCURSEL, 0, 0); if (sel == CB_ERR) break; int len = SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETLBTEXTLEN, sel, 0); if (len < 0) break; @@ -815,7 +815,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w ///////////////////////////////////////////////////////////////////////////////////////// -static int OpenOptions(WPARAM wParam, LPARAM lParam) +static int OpenOptions(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.position = 100; diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index 1c1f476041..b346bf9b09 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -46,7 +46,7 @@ static unsigned int CALLBACK generate_key_thread(void* param) return 0; } -INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: { @@ -101,7 +101,8 @@ extern "C" { /* Create a private key for the given accountname/protocol if * desired. */ - void otr_gui_create_privkey(void *opdata, const char *account_name, const char *protocol) { + // otr_gui_create_privkey(void *opdata, const char *account_name, const char *protocol) { + void otr_gui_create_privkey(void *opdata, const char *, const char *protocol) { DEBUGOUT_T("OTR_GUI_CREATE_PRIVKEY\n"); if (opdata) { protocol = GetContactProto((UINT_PTR)opdata); @@ -117,7 +118,8 @@ extern "C" { * If you return 1, messages such as heartbeats or other * notifications may be sent to the user, which could result in "not * logged in" errors if you're wrong. */ - int otr_gui_is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient) { + //int otr_gui_is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient) { + int otr_gui_is_logged_in(void *opdata, const char *, const char *, const char *) { DEBUGOUT_T("OTR_GUI_IS_LOGGED_IN\n"); MCONTACT hContact = (UINT_PTR)opdata; if (hContact) { @@ -131,7 +133,8 @@ extern "C" { /* Send the given IM to the given recipient from the given * accountname/protocol. */ - void otr_gui_inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) { + //void otr_gui_inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) { + void otr_gui_inject_message(void *opdata, const char *, const char *protocol, const char *, const char *message) { DEBUGOUT_T("OTR_GUI_INJECT_MESSAGE\n"); MCONTACT hContact = (UINT_PTR)opdata; if (db_get_w(hContact, protocol, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) @@ -140,7 +143,8 @@ extern "C" { /* When the list of ConnContexts changes (including a change in * state), this is called so the UI can be updated. */ - void otr_gui_update_context_list(void *opdata) { + //void otr_gui_update_context_list(void *opdata) { + void otr_gui_update_context_list(void *) { //MessageBox(0, "Update Context List", "OTR Callback", MB_OK); DEBUGOUT_T("OTR: Update Context List\n"); } @@ -158,7 +162,8 @@ extern "C" { } /* The list of known fingerprints has changed. Write them to disk. */ - void otr_gui_write_fingerprints(void *opdata) { + //void otr_gui_write_fingerprints(void *opdata) { + void otr_gui_write_fingerprints(void *) { DEBUGOUT_T("OTR_GUI_WRITE_FINGERPRINTS\n"); //if(MessageBox(0, Translate("Would you like to save the current fingerprint list?"), Translate(MODULE), MB_YESNO) == IDYES) otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); @@ -256,21 +261,26 @@ extern "C" { return CallProtoService(proto, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, (LPARAM)opdata); } - const char *account_name(void *opdata, const char *account, const char *protocol) { + //const char *account_name(void *opdata, const char *account, const char *protocol) { + const char *account_name(void *, const char *account, const char *) { return account; } - void account_name_free(void *opdata, const char *account_name) { + //void account_name_free(void *opdata, const char *account_name) { + void account_name_free(void *, const char *) { } void add_appdata(void *data, ConnContext *context) { if (context) context->app_data = data; } - const char* resent_msg_prefix(void *opdata, ConnContext *context){ + //const char* resent_msg_prefix(void *opdata, ConnContext *context) { + const char* resent_msg_prefix(void *, ConnContext *){ return "[resent]"; } - void resent_msg_prefix_free(void *opdata, const char *prefix){ + + //void resent_msg_prefix_free(void *opdata, const char *prefix) { + void resent_msg_prefix_free(void *, const char *){ return; } @@ -286,6 +296,7 @@ extern "C" { break; case OTRL_SMPEVENT_CHEATED: otrl_message_abort_smp(otr_user_state, &ops, opdata, context); + // fall through case OTRL_SMPEVENT_IN_PROGRESS: case OTRL_SMPEVENT_SUCCESS: case OTRL_SMPEVENT_FAILURE: @@ -298,7 +309,8 @@ extern "C" { } } - void handle_msg_event(void *opdata, OtrlMessageEvent msg_event, ConnContext *context, const char *message, gcry_error_t err) { + //void handle_msg_event(void *opdata, OtrlMessageEvent msg_event, ConnContext *context, const char *message, gcry_error_t err) { + void handle_msg_event(void *opdata, OtrlMessageEvent msg_event, ConnContext *, const char *message, gcry_error_t err) { DEBUGOUTA("HANDLE_MSG_EVENT\n"); MCONTACT hContact = (UINT_PTR)opdata; const TCHAR* contact = contact_get_nameT(hContact); @@ -385,7 +397,8 @@ extern "C" { msgfunc(hContact, msg); } - void otr_create_instag(void *opdata, const char *accountname, const char *protocol){ + //void otr_create_instag(void *opdata, const char *accountname, const char *protocol) { + void otr_create_instag(void *, const char *accountname, const char *protocol){ DEBUGOUT_T("OTR_CREATE_INSTAG\n"); FILE* instagf = _tfopen(g_instag_filename, _T("w+b")); if (!instagf) diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index 7ba2cc629a..15a139bef8 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -48,7 +48,7 @@ int StartOTR(MCONTACT hContact) { return 0; } -INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM lParam) +INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM) { TCHAR buff[512]; @@ -68,7 +68,7 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM lParam) return StartOTR(hContact); } -INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM lParam) +INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM) { TCHAR buff[512]; @@ -108,7 +108,7 @@ int otr_disconnect_contact(MCONTACT hContact) return 0; } -INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM lParam) +INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM) { // prevent this filter from acting on injeceted messages for metas, when they are passed though the subcontact's proto send chain if (otr_disconnect_contact(hContact)) return 0; @@ -121,7 +121,7 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM lParam) return 0; } -INT_PTR SVC_VerifyOTR(WPARAM hContact, LPARAM lParam) +INT_PTR SVC_VerifyOTR(WPARAM hContact, LPARAM) { MCONTACT hSub = db_mc_getMostOnline(hContact); if(hSub != 0) @@ -136,7 +136,7 @@ INT_PTR SVC_VerifyOTR(WPARAM hContact, LPARAM lParam) return 0; } -INT_PTR SVC_ToggleHTMLOTR(WPARAM hContact, LPARAM lParam) +INT_PTR SVC_ToggleHTMLOTR(WPARAM hContact, LPARAM) { MCONTACT hSub = db_mc_getMostOnline(hContact); if (hSub != 0) @@ -177,7 +177,7 @@ void InitMenu() HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SVC_PrebuildContactMenu); } -int SVC_PrebuildContactMenu(WPARAM hContact, LPARAM lParam) +int SVC_PrebuildContactMenu(WPARAM hContact, LPARAM) { const char *proto = GetContactProto(hContact); DWORD pol = CONTACT_DEFAULT_POLICY; |