From 53d05354369c59a0c084bf0e4c72b1f25702746c Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Wed, 21 Jan 2015 19:55:46 +0000 Subject: YARelay: Minor cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@11888 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YARelay/src/main.cpp | 11 ++++++----- plugins/YARelay/src/options.cpp | 2 +- plugins/YARelay/src/stdafx.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins/YARelay/src') diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 668b5adf65..8a7974b621 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -54,7 +54,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) /** * Protocols àcknowledgement */ -int ProtoAck(WPARAM wparam,LPARAM lparam) +int ProtoAck(WPARAM,LPARAM lparam) { ACKDATA *pAck = (ACKDATA *)lparam; if (pAck->type != ACKTYPE_MESSAGE || pAck->result != ACKRESULT_SUCCESS) @@ -112,6 +112,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) case ID_STATUS_DND: statMask = STATUS_DND ;break; case ID_STATUS_FREECHAT: statMask = STATUS_FREECHAT ;break; case ID_STATUS_INVISIBLE:statMask = STATUS_INVISIBLE;break; + default: return 0; } if ((iForwardOnStatus & statMask) == 0) return 0; @@ -238,10 +239,10 @@ extern "C" int __declspec(dllexport) Load() iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA); - DBVARIANT dbv; - if (!db_get_ts(NULL, "yaRelay", "ForwardTemplate", &dbv)){ - _tcsncpy(tszForwardTemplate, dbv.ptszVal, SIZEOF(tszForwardTemplate)); - db_free(&dbv); + TCHAR *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate"); + if (szForwardTemplate){ + _tcsncpy(tszForwardTemplate, szForwardTemplate, SIZEOF(tszForwardTemplate)); + mir_free(szForwardTemplate); } else _tcsncpy(tszForwardTemplate, _T("%u: %m"), MAXTEMPLATESIZE-1); diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 5db185b7bd..6a6a42bd98 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -189,7 +189,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, /** * Init options panel */ -int OptionsInit(WPARAM wParam, LPARAM lParam) +int OptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.hInstance = hInst; diff --git a/plugins/YARelay/src/stdafx.h b/plugins/YARelay/src/stdafx.h index 5b1543f6c4..c2f40604ce 100644 --- a/plugins/YARelay/src/stdafx.h +++ b/plugins/YARelay/src/stdafx.h @@ -61,4 +61,4 @@ struct MESSAGE_PROC extern LIST arMessageProcs; -int OptionsInit(WPARAM wParam, LPARAM lParam); +int OptionsInit(WPARAM wParam, LPARAM); -- cgit v1.2.3