summaryrefslogtreecommitdiff
path: root/protocols/Yahoo/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-11-28 21:19:14 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-11-28 21:19:14 +0000
commit6895d635acb37ba42e53ba95ca3eee2ddbbef24d (patch)
treef85a1d97784c4597099864119acb027b9a3f2dba /protocols/Yahoo/src
parent8ef06acf351fdb6034b6e13670d84bfd79161956 (diff)
Massive code cleanup and fixes for a lot of warnings reported in #837
git-svn-id: http://svn.miranda-ng.org/main/trunk@11136 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo/src')
-rw-r--r--protocols/Yahoo/src/libyahoo2/libyahoo2.cpp2
-rw-r--r--protocols/Yahoo/src/options.cpp47
2 files changed, 28 insertions, 21 deletions
diff --git a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp
index 88bf217d28..1b178f580e 100644
--- a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp
+++ b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp
@@ -4484,7 +4484,7 @@ static void yahoo_process_search_connection(struct yahoo_input_data *yid, int ov
yct->age = atoi(cp);
break;
case 5:
- if (cp != "\005")
+ if (strcmp(cp,"\005"))
yct->location = cp;
k = 0;
break;
diff --git a/protocols/Yahoo/src/options.cpp b/protocols/Yahoo/src/options.cpp
index 9ca0b249ba..237f5e49ce 100644
--- a/protocols/Yahoo/src/options.cpp
+++ b/protocols/Yahoo/src/options.cpp
@@ -98,22 +98,25 @@ static INT_PTR CALLBACK DlgProcYahooOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
char str[128];
GetDlgItemTextA(hwndDlg, IDC_HANDLE, str, sizeof( str ));
- dbv.pszVal = NULL;
-
- if ( ppro->getString( YAHOO_LOGINID, &dbv) || lstrcmpA( str, dbv.pszVal ))
+ if (ppro->getString(YAHOO_LOGINID, &dbv)) {
reconnectRequired = true;
-
- if ( dbv.pszVal != NULL)
+ }
+ else {
+ if(lstrcmpA(str, dbv.pszVal))
+ reconnectRequired = true;
db_free(&dbv);
-
+ }
ppro->setString( YAHOO_LOGINID, str );
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof( str ));
- dbv.pszVal = NULL;
- if ( ppro->getString( YAHOO_PASSWORD, &dbv) || lstrcmpA( str, dbv.pszVal ))
+ if (ppro->getString(YAHOO_PASSWORD, &dbv)) {
reconnectRequired = true;
- if ( dbv.pszVal != NULL)
+ }
+ else {
+ if(lstrcmpA(str, dbv.pszVal))
+ reconnectRequired = true;
db_free(&dbv);
+ }
ppro->setString( YAHOO_PASSWORD, str );
GetDlgItemTextA(hwndDlg, IDC_NICK, str, sizeof( str ));
@@ -133,11 +136,12 @@ static INT_PTR CALLBACK DlgProcYahooOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
ppro->setByte("DisableYahoomail", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_DISABLEYAHOOMAIL));
ppro->setByte("ShowErrors", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ERRORS));
- if (reconnectRequired)
+ if (reconnectRequired) {
ppro->delSetting(YAHOO_PWTOKEN);
+ if (ppro->m_bLoggedIn )
+ MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the Yahoo network before they take effect"), TranslateT("YAHOO Options"), MB_OK );
- if ( reconnectRequired && ppro->m_bLoggedIn )
- MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK );
+ }
return TRUE;
}
@@ -207,29 +211,32 @@ static INT_PTR CALLBACK DlgProcYahooOptsConn(HWND hwndDlg, UINT msg, WPARAM wPar
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY )
{
- BOOL reconnectRequired = FALSE;
+ bool reconnectRequired = false;
char str[128];
GetDlgItemTextA(hwndDlg, IDC_LOGINSERVER, str, sizeof( str ));
DBVARIANT dbv;
- dbv.pszVal = NULL;
- if ( ppro->getString( YAHOO_LOGINSERVER, &dbv) || lstrcmpA( str, dbv.pszVal ))
- reconnectRequired = TRUE;
- if ( dbv.pszVal != NULL)
+ if (ppro->getString(YAHOO_LOGINSERVER, &dbv)) {
+ reconnectRequired = true;
+ }
+ else {
+ if(lstrcmpA(str, dbv.pszVal))
+ reconnectRequired = true;
db_free(&dbv);
+ }
ppro->setString(YAHOO_LOGINSERVER, str);
int port = GetDlgItemInt(hwndDlg, IDC_YAHOOPORT, NULL, FALSE );
if ( ppro->getWord(YAHOO_LOGINPORT, -1) != port)
- reconnectRequired = TRUE;
+ reconnectRequired = true;
ppro->setWord(YAHOO_LOGINPORT, port);
ppro->setByte("YahooJapan", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_YAHOO_JAPAN ));
if ( reconnectRequired && ppro->m_bLoggedIn )
- MessageBoxA(hwndDlg, Translate("The changes you have made require you to reconnect to the Yahoo network before they take effect"), Translate("YAHOO Options"), MB_OK );
+ MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the Yahoo network before they take effect"), TranslateT("YAHOO Options"), MB_OK );
return TRUE;
}
@@ -353,7 +360,7 @@ static INT_PTR CALLBACK DlgProcYahooOptsIgnore(HWND hwndDlg, UINT msg, WPARAM wP
* YahooOptInit - initialize/register our Options w/ Miranda.
*/
-int __cdecl CYahooProto::OnOptionsInit(WPARAM wParam,LPARAM lParam)
+int __cdecl CYahooProto::OnOptionsInit(WPARAM wParam,LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.position = -790000000;