From 30ab6ceb71842f003f649b3d62b89af010cf40d1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Jun 2012 17:00:14 +0000 Subject: - direct call of MS_SKIN_ADDNEWSOUND replaced with Skin_AddSound() call; - obsolete structure SKINSOUNDDESC removed - dynamically translated hot keys; - checked correct LPGEN'ing of the sounds creation; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@500 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/contact.cpp | 20 ++++++++++---------- plugins/Variables/help.cpp | 24 ++++++++++++------------ plugins/Variables/options.cpp | 2 +- plugins/Variables/parse_alias.cpp | 12 ++++++------ plugins/Variables/parse_external.cpp | 10 +++++----- plugins/Variables/parse_inet.cpp | 4 ++-- plugins/Variables/parse_logic.cpp | 14 +++++++------- plugins/Variables/parse_miranda.cpp | 16 ++++++++-------- plugins/Variables/parse_str.cpp | 28 ++++++++++++++-------------- plugins/Variables/parse_system.cpp | 30 +++++++++++++++--------------- plugins/Variables/parse_variables.cpp | 8 ++++---- plugins/Variables/tokenregister.cpp | 2 +- plugins/Variables/variables.cpp | 22 +++++++++++----------- 13 files changed, 96 insertions(+), 96 deletions(-) (limited to 'plugins/Variables') diff --git a/plugins/Variables/contact.cpp b/plugins/Variables/contact.cpp index c6b7b8f566..b6d48ee1e3 100644 --- a/plugins/Variables/contact.cpp +++ b/plugins/Variables/contact.cpp @@ -339,7 +339,7 @@ int getContactFromString( CONTACTSINFO* ci ) free(tmp); } - if ( (tszContact == NULL) || (_tcslen(tszContact) == 0) ) + if ( (tszContact == NULL) || (_tcslen(tszContact) == 0)) return -1; ci->hContacts = NULL; @@ -394,7 +394,7 @@ int getContactFromString( CONTACTSINFO* ci ) tszProto = a2u(szProto); - if ( (tszProto != NULL) && (szFind != NULL) ) { + if ( (tszProto != NULL) && (szFind != NULL)) { wsprintf(szFind, _T("<%s:%s>"), tszProto, cInfo); free(cInfo); free(tszProto); @@ -407,7 +407,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // id (exact) - if ( (ci->flags&CI_UNIQUEID) && (!bMatch) ) { + if ( (ci->flags&CI_UNIQUEID) && (!bMatch)) { szFind = getContactInfoT(CNF_UNIQUEID, hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) @@ -417,7 +417,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // nick (not exact) - if ( (ci->flags&CI_NICK) && (!bMatch) ) { + if ( (ci->flags&CI_NICK) && (!bMatch)) { szFind = getContactInfoT(CNF_NICK, hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) @@ -427,7 +427,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // list name (not exact) - if ( (ci->flags&CI_LISTNAME) && (!bMatch) ) { + if ( (ci->flags&CI_LISTNAME) && (!bMatch)) { szFind = getContactInfoT(CNF_DISPLAY, hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) @@ -437,7 +437,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // firstname (exact) - if ( (ci->flags&CI_FIRSTNAME) && (!bMatch) ) { + if ( (ci->flags&CI_FIRSTNAME) && (!bMatch)) { szFind = getContactInfoT(CNF_FIRSTNAME, hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) { @@ -447,7 +447,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // lastname (exact) - if ( (ci->flags&CI_LASTNAME) && (!bMatch) ) { + if ( (ci->flags&CI_LASTNAME) && (!bMatch)) { szFind = getContactInfoT(CNF_LASTNAME, hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) { @@ -457,7 +457,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // email (exact) - if ( (ci->flags&CI_EMAIL) && (!bMatch) ) { + if ( (ci->flags&CI_EMAIL) && (!bMatch)) { szFind = getContactInfoT(CNF_EMAIL, hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) { @@ -467,7 +467,7 @@ int getContactFromString( CONTACTSINFO* ci ) } } // CNF_ (exact) - if ( (ci->flags&CI_CNFINFO) && (!bMatch) ) { + if ( (ci->flags&CI_CNFINFO) && (!bMatch)) { szFind = getContactInfoT((BYTE)(ci->flags&~(CI_CNFINFO|CI_TCHAR)), hContact, ci->flags&CI_TCHAR); if (szFind != NULL) { if (!_tcscmp(tszContact, szFind)) { @@ -533,7 +533,7 @@ static int contactSettingChanged(WPARAM wParam, LPARAM lParam) ((!strcmp(dbw->szSetting, "e-mail")) && (cce[i].flags&CI_EMAIL)) || ((!strcmp(dbw->szSetting, "MyHandle")) && (cce[i].flags&CI_LISTNAME)) || (cce[i].flags & CI_CNFINFO) != 0 || // lazy; always invalidate CNF info cache entries - (( ((int)uid != CALLSERVICE_NOTFOUND) && (uid != NULL) ) && (!strcmp(dbw->szSetting, uid)) && (cce[i].flags & CI_UNIQUEID))) + (( ((int)uid != CALLSERVICE_NOTFOUND) && (uid != NULL)) && (!strcmp(dbw->szSetting, uid)) && (cce[i].flags & CI_UNIQUEID))) { /* remove from cache */ free(cce[i].tszContact); diff --git a/plugins/Variables/help.cpp b/plugins/Variables/help.cpp index 3fe5915cb2..5231294de3 100644 --- a/plugins/Variables/help.cpp +++ b/plugins/Variables/help.cpp @@ -163,7 +163,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM free(tszContact); } } - if ( (hContact != INVALID_HANDLE_VALUE) && (hContact != NULL) ) + if ( (hContact != INVALID_HANDLE_VALUE) && (hContact != NULL)) hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); else hItem = NULL; @@ -429,7 +429,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg,UINT msg,WPARAM wParam i += 1; tszHelpDesc = tszTokenDesc = NULL; tr = getTokenRegister(i); - if ( (tr == NULL) || (tr->tszTokenString == NULL) ) { + if ( (tr == NULL) || (tr->tszTokenString == NULL)) { continue; } else if (hdd != NULL) { @@ -498,7 +498,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg,UINT msg,WPARAM wParam else { text = NULL; } - if ( (text != NULL) && ((last == NULL) || (_tcsicmp(last, text))) ) { + if ( (text != NULL) && ((last == NULL) || (_tcsicmp(last, text)))) { lvItem.mask = LVIF_TEXT; lvItem.pszText = text; ListView_InsertItem(hList, &lvItem); @@ -521,7 +521,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg,UINT msg,WPARAM wParam } case WM_NOTIFY: - if ( (((NMHDR*)lParam)->idFrom == IDC_TOKENLIST) && (((NMHDR*)lParam)->code == NM_DBLCLK) ) { + if ( (((NMHDR*)lParam)->idFrom == IDC_TOKENLIST) && (((NMHDR*)lParam)->code == NM_DBLCLK)) { HWND hList, hwndInputDlg; LVITEM lvItem; int len, item; @@ -940,7 +940,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar ShowWindow(hPage, SW_HIDE); TabCtrl_InsertItem(hTab, tabCount++, &tci); hShow = hShow==0?hPage:hShow; - if ( (dat->vhs->fi != NULL) && (dat->vhs->fi->szFormat != NULL) ) { + if ( (dat->vhs->fi != NULL) && (dat->vhs->fi->szFormat != NULL)) { if (dat->vhs->fi->flags & FIF_UNICODE) SendMessage(hwndDlg, VARM_SETINPUTTEXT, 0, (LPARAM)dat->vhs->fi->tszFormat); else { @@ -966,7 +966,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar } } if ( (dat->vhs->flags&VHF_SUBJECT) || - ((dat->vhs->flags&VHF_INPUT) && (((dat->vhs->fi != NULL) && (dat->vhs->fi->hContact != NULL)) || (dat->vhs->flags&VHF_SETLASTSUBJECT))) ) { + ((dat->vhs->flags&VHF_INPUT) && (((dat->vhs->fi != NULL) && (dat->vhs->fi->hContact != NULL)) || (dat->vhs->flags&VHF_SETLASTSUBJECT)))) { // subject window is created, but not necessarily shown dat->hwndSubjectDlg = hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CLIST_DIALOG), hwndDlg, clistDlgProc, (LPARAM)GetParent(hwndDlg)); if (pfnEnableThemeDialogTexture) { @@ -976,7 +976,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar MoveWindow(hPage, (rcTabs.left - rcParent.left), (rcTabs.top - rcParent.top), (rcTabs.right - rcTabs.left) - 2*iFrameX, (rcTabs.bottom - rcTabs.top) - 2*iFrameY, TRUE); ShowWindow(hPage, SW_HIDE); - if ((dat->vhs->fi != NULL) && (dat->vhs->fi->hContact != NULL) ) + if ((dat->vhs->fi != NULL) && (dat->vhs->fi->hContact != NULL)) SendMessage(hwndDlg, VARM_SETSUBJECT, (WPARAM)dat->vhs->fi->hContact, 0); else if (dat->vhs->flags&VHF_SETLASTSUBJECT) SendMessage(hwndDlg, VARM_SETSUBJECT, (WPARAM)INVALID_HANDLE_VALUE, 0); @@ -991,7 +991,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar } } if ( (dat->vhs->flags&VHF_EXTRATEXT) || - ((dat->vhs->flags&VHF_INPUT) && (dat->vhs->fi != NULL) && (dat->vhs->fi->tszExtraText != NULL)) ) { + ((dat->vhs->flags&VHF_INPUT) && (dat->vhs->fi != NULL) && (dat->vhs->fi->tszExtraText != NULL))) { // extratext window is created, but not necessarily shown dat->hwndExtraTextDlg = hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_EXTRATEXT_DIALOG), hwndDlg, extratextDlgProc, (LPARAM)GetParent(hwndDlg)); if (pfnEnableThemeDialogTexture) @@ -999,7 +999,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar MoveWindow(hPage, (rcTabs.left - rcParent.left), (rcTabs.top - rcParent.top), (rcTabs.right - rcTabs.left) - 2*iFrameX, (rcTabs.bottom - rcTabs.top) - 2*iFrameY, TRUE); ShowWindow(hPage, SW_HIDE); - if ( (dat->vhs->fi != NULL) && (dat->vhs->fi->tszExtraText != NULL) ) { + if ( (dat->vhs->fi != NULL) && (dat->vhs->fi->tszExtraText != NULL)) { if (dat->vhs->fi->flags & FIF_UNICODE) SendMessage(hwndDlg, VARM_SETEXTRATEXT, 0, (LPARAM)dat->vhs->fi->tszExtraText); else { @@ -1042,7 +1042,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_OK: - if ( (dat->vhs->fi != NULL) && (!(dat->vhs->flags&VHF_DONTFILLSTRUCT)) ) { + if ( (dat->vhs->fi != NULL) && (!(dat->vhs->flags&VHF_DONTFILLSTRUCT))) { int len = SendMessage(hwndDlg, VARM_GETINPUTTEXTLENGTH, 0, 0); if (len > 0) { @@ -1081,7 +1081,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar (LPARAM)dat->vhs->hwndCtrl); } - if ( (dat->vhs->flags&VHF_FULLFILLSTRUCT) && (dat->vhs->fi != NULL) ) { + if ( (dat->vhs->flags&VHF_FULLFILLSTRUCT) && (dat->vhs->fi != NULL)) { int len; len = SendMessage(hwndDlg, VARM_GETEXTRATEXTLENGTH, 0, 0); @@ -1217,7 +1217,7 @@ static BOOL CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar } case WM_NOTIFY: - if ( (((NMHDR*)lParam)->idFrom == IDC_TABS) ) { + if ( (((NMHDR*)lParam)->idFrom == IDC_TABS)) { if (((NMHDR*)lParam)->code == TCN_SELCHANGING) { TCITEM tci; diff --git a/plugins/Variables/options.cpp b/plugins/Variables/options.cpp index b4a720094f..175baff0f0 100644 --- a/plugins/Variables/options.cpp +++ b/plugins/Variables/options.cpp @@ -43,7 +43,7 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA break; case WM_COMMAND: - if ( (HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED) ) { + if ( (HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) { switch (LOWORD(wParam)) { case IDC_PARSEATSTARTUP: case IDC_STRIPCRLF: diff --git a/plugins/Variables/parse_alias.cpp b/plugins/Variables/parse_alias.cpp index 7f90e0eb04..2fe4164d15 100644 --- a/plugins/Variables/parse_alias.cpp +++ b/plugins/Variables/parse_alias.cpp @@ -29,7 +29,7 @@ static ALIASREGISTER *searchAliasRegister(TCHAR *szAlias) { unsigned int i; res = NULL; - if ( (szAlias == NULL) || (_tcslen(szAlias) == 0) ) { + if ( (szAlias == NULL) || (_tcslen(szAlias) == 0)) { return NULL; } EnterCriticalSection(&csAliasRegister); @@ -55,12 +55,12 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg) { cur = ecur = 0; while (*(res+cur) != _T('\0')) { - if ( (*(res+cur) == _T('(')) || (*(res+cur) == _T(',')) ) { + if ( (*(res+cur) == _T('(')) || (*(res+cur) == _T(','))) { ecur = ++cur; - while ( (*(res+ecur) != _T(')')) && (*(res+ecur) != _T(',')) ) { + while ( (*(res+ecur) != _T(')')) && (*(res+ecur) != _T(','))) { ecur++; } - if ( ((signed int)_tcslen(tArg) == (ecur-cur)) && (!_tcsncmp(tArg, res+cur, _tcslen(tArg))) ) { + if ( ((signed int)_tcslen(tArg) == (ecur-cur)) && (!_tcsncmp(tArg, res+cur, _tcslen(tArg)))) { if (_tcslen(rArg) > _tcslen(tArg)) { res = ( TCHAR* )realloc(res, (_tcslen(res) + (_tcslen(rArg)-_tcslen(tArg)) + 1)*sizeof(TCHAR)); if (res == NULL) @@ -83,7 +83,7 @@ static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai) { ALIASREGISTER *areg; areg = searchAliasRegister(ai->targv[0]); - if ( (areg == NULL) || (areg->argc != ai->argc-1) ) { + if ( (areg == NULL) || (areg->argc != ai->argc-1)) { return NULL; } res = _tcsdup(areg->szTranslation); @@ -188,7 +188,7 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) { if (i != argc-1) _tcscat(szArgs, _T(",")); } - if ( (szArgs != NULL) && (argc > 0) ) { + if ( (szArgs != NULL) && (argc > 0)) { szArgsA = u2a(szArgs); diff --git a/plugins/Variables/parse_external.cpp b/plugins/Variables/parse_external.cpp index a93f6ba44f..65226fb0e4 100644 --- a/plugins/Variables/parse_external.cpp +++ b/plugins/Variables/parse_external.cpp @@ -73,7 +73,7 @@ static TCHAR *parseWinampSong(ARGUMENTSINFO *ai) { } scur = _tcschr(szTitle, _T('.')); cur = _tcsstr(scur, _T(" - Winamp")); - if ( (scur == NULL) || (cur == NULL) || (scur >= cur) || (scur > (szTitle + _tcslen(szTitle) - 2)) || (cur > (szTitle + _tcslen(szTitle))) ) { + if ( (scur == NULL) || (cur == NULL) || (scur >= cur) || (scur > (szTitle + _tcslen(szTitle) - 2)) || (cur > (szTitle + _tcslen(szTitle)))) { free(szTitle); return NULL; } @@ -101,15 +101,15 @@ static TCHAR *parseWinampState(ARGUMENTSINFO *ai) { } scur = _tcschr(szTitle, _T('.')); cur = _tcsstr(scur, _T(" - Winamp")); - if ( (scur == NULL) || (cur == NULL) ) { + if ( (scur == NULL) || (cur == NULL)) { free(szTitle); return _tcsdup(TranslateT("Stopped")); } - if ( (!_tcsncmp(cur+10, _T("[Stopped]"), 9)) ) { + if ( (!_tcsncmp(cur+10, _T("[Stopped]"), 9))) { free(szTitle); return _tcsdup(TranslateT("Stopped")); } - if ( (!_tcsncmp(cur+10, _T("[Paused]"), 8)) ) { + if ( (!_tcsncmp(cur+10, _T("[Paused]"), 8))) { free(szTitle); return _tcsdup(TranslateT("Paused")); } @@ -135,7 +135,7 @@ static unsigned int checkAMIP() { } log_debugA("AMIP failed to initialized"); if (lastAMIPFailure == 0) { - /* if this is the first failure after a succesful init, call uninit for a cleanup (maybe it'll help for the next try ;) ) */ + /* if this is the first failure after a succesful init, call uninit for a cleanup (maybe it'll help for the next try ;)) */ acUninit(); } lastAMIPFailure = GetTickCount(); diff --git a/plugins/Variables/parse_inet.cpp b/plugins/Variables/parse_inet.cpp index 21938b21ad..41481e3b60 100644 --- a/plugins/Variables/parse_inet.cpp +++ b/plugins/Variables/parse_inet.cpp @@ -37,7 +37,7 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) { } cur = 0; while (cur < strlen(res)) { - if ( ( (*(res+cur) >= '0') && (*(res+cur) <= '9') ) || ( (*(res+cur) >= 'a') && (*(res+cur) <= 'z') ) || ( (*(res+cur) >= 'A') && (*(res+cur) <= 'Z') ) ) { + if ( ( (*(res+cur) >= '0') && (*(res+cur) <= '9')) || ( (*(res+cur) >= 'a') && (*(res+cur) <= 'z')) || ( (*(res+cur) >= 'A') && (*(res+cur) <= 'Z')) ) { cur++; continue; } @@ -75,7 +75,7 @@ static TCHAR *parseUrlDec(ARGUMENTSINFO *ai) { } cur = 0; while (cur < strlen(res)) { - if ( (*(res+cur) == '%') && (strlen(res+cur) >= 3) ) { + if ( (*(res+cur) == '%') && (strlen(res+cur) >= 3)) { memset(hex, '\0', sizeof(hex)); strncpy(hex, res+cur+1, 2); *(res+cur) = (char)strtol(hex, NULL, 16); diff --git a/plugins/Variables/parse_logic.cpp b/plugins/Variables/parse_logic.cpp index 36a5f664e3..23f8badca8 100644 --- a/plugins/Variables/parse_logic.cpp +++ b/plugins/Variables/parse_logic.cpp @@ -141,7 +141,7 @@ static TCHAR *parseIfequal(ARGUMENTSINFO *ai) tszFirst = formatString(&fi); fi.szFormat = ai->argv[2]; tszSecond = formatString(&fi); - if ( (tszFirst == NULL) || (tszSecond == NULL) ) { + if ( (tszFirst == NULL) || (tszSecond == NULL)) { if (tszFirst != NULL) free(tszFirst); @@ -150,7 +150,7 @@ static TCHAR *parseIfequal(ARGUMENTSINFO *ai) return NULL; } - if ( (ttoi(tszFirst)) == (ttoi(tszSecond)) ) { + if ( (ttoi(tszFirst)) == (ttoi(tszSecond))) { free(tszFirst); free(tszSecond); return _tcsdup(ai->targv[3]); @@ -176,7 +176,7 @@ static TCHAR *parseIfgreater(ARGUMENTSINFO *ai) { tszFirst = formatString(&fi); fi.szFormat = ai->argv[2]; tszSecond = formatString(&fi); - if ( (tszFirst == NULL) || (tszSecond == NULL) ) { + if ( (tszFirst == NULL) || (tszSecond == NULL)) { if (tszFirst != NULL) { free(tszFirst); } @@ -185,7 +185,7 @@ static TCHAR *parseIfgreater(ARGUMENTSINFO *ai) { } return NULL; } - if ( (ttoi(tszFirst)) > (ttoi(tszSecond)) ) { + if ( (ttoi(tszFirst)) > (ttoi(tszSecond))) { free(tszFirst); free(tszSecond); return _tcsdup(ai->targv[3]); @@ -210,7 +210,7 @@ static TCHAR *parseIflonger(ARGUMENTSINFO *ai) { tszFirst = formatString(&fi); fi.szFormat = ai->argv[2]; tszSecond = formatString(&fi); - if ( (tszFirst == NULL) || (tszSecond == NULL) ) { + if ( (tszFirst == NULL) || (tszSecond == NULL)) { if (tszFirst != NULL) { free(tszFirst); } @@ -219,7 +219,7 @@ static TCHAR *parseIflonger(ARGUMENTSINFO *ai) { } return NULL; } - if ( _tcslen(tszFirst) > _tcslen(tszSecond) ) { + if ( _tcslen(tszFirst) > _tcslen(tszSecond)) { free(tszFirst); free(tszSecond); return _tcsdup(ai->targv[3]); @@ -302,7 +302,7 @@ static TCHAR *parseLonger(ARGUMENTSINFO *ai) if (ai->argc != 3) return NULL; - if ( _tcslen(ai->targv[1]) <= _tcslen(ai->targv[2]) ) + if ( _tcslen(ai->targv[1]) <= _tcslen(ai->targv[2])) ai->flags |= AIF_FALSE; return _tcsdup(_T("")); diff --git a/plugins/Variables/parse_miranda.cpp b/plugins/Variables/parse_miranda.cpp index e941a91e89..7a4e26567e 100644 --- a/plugins/Variables/parse_miranda.cpp +++ b/plugins/Variables/parse_miranda.cpp @@ -430,7 +430,7 @@ static TCHAR *parseLastSeenStatus(ARGUMENTSINFO *ai) { ci.tszContact = ai->targv[1]; ci.flags = 0xFFFFFFFF^(CI_TCHAR==0?CI_UNICODE:0); count = getContactFromString( &ci ); - if ( (count == 1) && (ci.hContacts != NULL) ) { + if ( (count == 1) && (ci.hContacts != NULL)) { hContact = ci.hContacts[0]; free(ci.hContacts); } @@ -598,7 +598,7 @@ static BOOL isValidDbEvent(DBEVENTINFO *dbe, int flags) ((dbe->eventType == EVENTTYPE_STATUSCHANGE) && (flags&DBE_STATUSCHANGE)) || ((flags&DBE_OTHER)); bEventFlags = (dbe->flags&DBEF_SENT)?(flags&DBE_SENT):(flags&DBE_RCVD); - bEventFlags = (bEventFlags && ((dbe->flags&DBEF_READ)?(flags&DBE_READ):(flags&DBE_UNREAD)) ); + bEventFlags = (bEventFlags && ((dbe->flags&DBEF_READ)?(flags&DBE_READ):(flags&DBE_UNREAD))); return (bEventType && bEventFlags); } @@ -614,9 +614,9 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) dbe.cbBlob = 0; dbe.pBlob = NULL; if (hContact != NULL) { - if ( (flags & DBE_FIRST) && (flags & DBE_UNREAD) ) { + if ( (flags & DBE_FIRST) && (flags & DBE_UNREAD)) { hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0); - if ( hDbEvent == NULL && (flags & DBE_READ) ) + if ( hDbEvent == NULL && (flags & DBE_READ)) hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRST, (WPARAM)hContact, 0); } else if (flags & DBE_FIRST) @@ -673,7 +673,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags); dbe.cbBlob = 0; if (!CallService(MS_DB_EVENT_GET, (WPARAM)hSearchEvent, (LPARAM)&dbe)) { - if (((dbe.timestamp < matchTimestamp) || (matchTimestamp == 0) ) && (dbe.timestamp > priorTimestamp)) { + if (((dbe.timestamp < matchTimestamp) || (matchTimestamp == 0)) && (dbe.timestamp > priorTimestamp)) { hMatchEvent = hSearchEvent; matchTimestamp = dbe.timestamp; } @@ -691,7 +691,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags); dbe.cbBlob = 0; if (!CallService(MS_DB_EVENT_GET, (WPARAM)hSearchEvent, (LPARAM)&dbe)) { - if ( ((dbe.timestamp > matchTimestamp) || (matchTimestamp == 0)) && (dbe.timestamp < priorTimestamp) ) { + if ( ((dbe.timestamp > matchTimestamp) || (matchTimestamp == 0)) && (dbe.timestamp < priorTimestamp)) { hMatchEvent = hSearchEvent; matchTimestamp = dbe.timestamp; } @@ -717,7 +717,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) flags &= ~DBE_LAST; } } - } while ( (!bEventOk) && (hDbEvent != NULL) ); + } while ( (!bEventOk) && (hDbEvent != NULL)); return hDbEvent; } @@ -806,7 +806,7 @@ static TCHAR *parseDbEvent(ARGUMENTSINFO *ai) ci.tszContact = ai->targv[1]; ci.flags = 0xFFFFFFFF^(CI_TCHAR==0?CI_UNICODE:0); count = getContactFromString( &ci ); - if ( (count == 1) && (ci.hContacts != NULL) ) { + if ( (count == 1) && (ci.hContacts != NULL)) { hContact = ci.hContacts[0]; free(ci.hContacts); } diff --git a/plugins/Variables/parse_str.cpp b/plugins/Variables/parse_str.cpp index d8edcf642d..df1739a815 100644 --- a/plugins/Variables/parse_str.cpp +++ b/plugins/Variables/parse_str.cpp @@ -32,7 +32,7 @@ static TCHAR *parseCaps(ARGUMENTSINFO *ai) { *cur = (TCHAR)CharUpper((LPTSTR)*cur); cur++; while (*cur != _T('\0')) { - if ( (*cur == _T(' ')) && (*(cur+1) != _T('\0')) ) { + if ( (*cur == _T(' ')) && (*(cur+1) != _T('\0'))) { cur++; if (IsCharLower(*cur)) *cur = (TCHAR)CharUpper((LPTSTR)*cur); @@ -58,7 +58,7 @@ static TCHAR *parseCaps2(ARGUMENTSINFO *ai) { *cur = (TCHAR)CharUpper((LPTSTR)*cur); cur++; while (*cur != _T('\0')) { - if ( (*cur == _T(' ')) && (*(cur+1) != _T('\0')) ) { + if ( (*cur == _T(' ')) && (*(cur+1) != _T('\0'))) { cur++; if (IsCharLower(*cur)) *cur = (TCHAR)CharUpper((LPTSTR)*cur); @@ -87,7 +87,7 @@ static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai) { cur = res; do { cur = _tcschr(cur, _T('\n')); - if ( (cur == NULL) || ((cur > res) && (*(cur-1) == '\r')) ) { + if ( (cur == NULL) || ((cur > res) && (*(cur-1) == '\r'))) { continue; } log_debug(cur); @@ -116,7 +116,7 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai) { return NULL; } cur = ai->targv[1]; - while ( (_tcscmp(cur, _T("\r\n"))) && (*cur != _T('\n')) && (*cur != _T('\0')) ) { + while ( (_tcscmp(cur, _T("\r\n"))) && (*cur != _T('\n')) && (*cur != _T('\0'))) { cur++; } if (*cur == '\0') { @@ -445,7 +445,7 @@ static TCHAR *parseReplace(ARGUMENTSINFO *ai) { TCHAR *res, *cur; unsigned int i, pos; - if ( (ai->argc < 4) || (ai->argc%2 != 0) ) { + if ( (ai->argc < 4) || (ai->argc%2 != 0)) { return NULL; } pos = 0; @@ -556,7 +556,7 @@ static TCHAR *parseStrchr(ARGUMENTSINFO *ai) { } ZeroMemory(szVal, sizeof(szVal)); c = _tcschr(ai->targv[1], *ai->targv[2]); - if ( (c == NULL) || (*c == _T('\0')) ) { + if ( (c == NULL) || (*c == _T('\0'))) { return _tcsdup(_T("0")); } @@ -650,7 +650,7 @@ static TCHAR *parseStrrchr(ARGUMENTSINFO *ai) { return NULL; } c = _tcsrchr(ai->targv[1], *ai->targv[2]); - if ( (c == NULL) || (*c == _T('\0')) ) { + if ( (c == NULL) || (*c == _T('\0'))) { return _tcsdup(_T("0")); } @@ -665,7 +665,7 @@ static TCHAR *parseStrstr(ARGUMENTSINFO *ai) { return NULL; } c = _tcsstr(ai->targv[1], ai->targv[2]); - if ( (c == NULL) || (*c == _T('\0')) ) { + if ( (c == NULL) || (*c == _T('\0'))) { return _tcsdup(_T("0")); } @@ -705,7 +705,7 @@ static TCHAR *parseSelect(ARGUMENTSINFO *ai) { return NULL; } n = ttoi(ai->targv[1]); - if ( (n > (signed int)ai->argc-2) || (n <= 0) ) { + if ( (n > (signed int)ai->argc-2) || (n <= 0)) { return NULL; } @@ -739,7 +739,7 @@ static TCHAR *parseTrim(ARGUMENTSINFO *ai) { scur++; } ecur = ai->targv[1] + _tcslen(ai->targv[1])-1; - while ( (*ecur == _T(' ')) && (ecur > ai->targv[1]) ) { + while ( (*ecur == _T(' ')) && (ecur > ai->targv[1])) { ecur--; } if (scur >= ecur) { @@ -761,7 +761,7 @@ static TCHAR *parseTab(ARGUMENTSINFO *ai) { TCHAR *res, *cur; count = 1; - if ( (ai->argc == 2) && (_tcslen(ai->targv[1]) > 0) ) { + if ( (ai->argc == 2) && (_tcslen(ai->targv[1]) > 0)) { count = ttoi(ai->targv[1]); } if (count < 0) { @@ -809,7 +809,7 @@ static TCHAR *getNthWord(TCHAR *szString, int w) { scur++; } count+=1; - while ( (count < w) && (scur < szString+_tcslen(szString)) ) { + while ( (count < w) && (scur < szString+_tcslen(szString))) { if (*scur == _T(' ')) { while (*scur == _T(' ')) { scur++; @@ -824,7 +824,7 @@ static TCHAR *getNthWord(TCHAR *szString, int w) { return NULL; } ecur = scur; - while ( (*ecur != _T(' ')) && (*ecur != _T('\0')) ) { + while ( (*ecur != _T(' ')) && (*ecur != _T('\0'))) { ecur++; } res = ( TCHAR* )malloc((ecur-scur+1)*sizeof(TCHAR)); @@ -855,7 +855,7 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai) { } else to = from; - if ( (from == 0) || (to == 0) || (from > to) ) + if ( (from == 0) || (to == 0) || (from > to)) return NULL; for (i=from;i<=to;i++) { diff --git a/plugins/Variables/parse_system.cpp b/plugins/Variables/parse_system.cpp index 65e75ffc9a..9ede81bf4a 100644 --- a/plugins/Variables/parse_system.cpp +++ b/plugins/Variables/parse_system.cpp @@ -194,7 +194,7 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai) { ecur = ai->targv[1]+_tcslen(ai->targv[1]); while (depth > 0) { - while ( (*ecur != _T('\\')) && (ecur > ai->targv[1]) ) + while ( (*ecur != _T('\\')) && (ecur > ai->targv[1])) ecur--; if (*ecur != _T('\\')) @@ -204,7 +204,7 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai) { ecur--; } scur = ecur; - while ( (*scur != _T('\\')) && (scur > ai->targv[1]) ) + while ( (*scur != _T('\\')) && (scur > ai->targv[1])) scur--; if (*scur == _T('\\')) @@ -239,7 +239,7 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai) { ecur = ai->targv[1]+_tcslen(ai->targv[1]); while (depth > 0) { - while ( (*ecur != _T('\\')) && (ecur > ai->targv[1]) ) + while ( (*ecur != _T('\\')) && (ecur > ai->targv[1])) ecur--; if (*ecur != _T('\\')) @@ -456,12 +456,12 @@ static TCHAR *parseListDir(ARGUMENTSINFO *ai) { if (hFind == INVALID_HANDLE_VALUE) { return NULL; } - if ( ((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles)) ) { + if ( ((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) { tszRes = ( TCHAR* )malloc((_tcslen(ffd.cFileName) + _tcslen(tszSeperator) + 1)*sizeof(TCHAR)); _tcscpy(tszRes, ffd.cFileName); } while (FindNextFile(hFind, &ffd) != 0) { - if ( ((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles)) ) { + if ( ((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) { if (tszRes != NULL) { _tcscat(tszRes, tszSeperator); tszRes = ( TCHAR* )realloc(tszRes, (_tcslen(tszRes) + _tcslen(ffd.cFileName) + _tcslen(tszSeperator) + 1)*sizeof(TCHAR)); @@ -484,7 +484,7 @@ static BOOL CALLBACK MyProcessEnumerator(DWORD dwPID, WORD wTask, char *szProces char **szProc; szProc = (char **)lParam; - if ( (*szProc != NULL) && (!_stricmp(*szProc, szProcess)) ) { + if ( (*szProc != NULL) && (!_stricmp(*szProc, szProcess))) { *szProc = NULL; } @@ -558,7 +558,7 @@ static TCHAR *parseRegistryValue(ARGUMENTSINFO *ai) { } ZeroMemory(res, len); err = RegQueryValueEx(hKey, ai->targv[2], NULL, &type, (BYTE*)res, &len); - if ( (err != ERROR_SUCCESS) || (type != REG_SZ) ) { + if ( (err != ERROR_SUCCESS) || (type != REG_SZ)) { RegCloseKey(hKey); free(res); return NULL; @@ -602,7 +602,7 @@ static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai) { if (timestamp == 0) { return NULL; } - if ( (ai->argc == 2) || ((ai->argc > 2) && (_tcslen(ai->targv[2]) == 0)) ) { + if ( (ai->argc == 2) || ((ai->argc > 2) && (_tcslen(ai->targv[2]) == 0))) { szFormat = NULL; } else { @@ -638,7 +638,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai) { if (timestamp == 0) { return NULL; } - if ( (ai->argc == 2) || ((ai->argc > 2) && (_tcslen(ai->targv[2]) == 0)) ) { + if ( (ai->argc == 2) || ((ai->argc > 2) && (_tcslen(ai->targv[2]) == 0))) { szFormat = NULL; } else { @@ -755,7 +755,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { } } } - } while ( (totalReadSz < fileSz) && (readSz > 0) ); + } while ( (totalReadSz < fileSz) && (readSz > 0)); if (lineNo < 0) { lineNo = lineCount + lineNo + 1; } @@ -796,12 +796,12 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { } } } - if ( ((tUC) && (*(TCHAR *)pCur == _T('\r'))) || ((!tUC) && (*(char *)pCur == '\r')) ) { + if ( ((tUC) && (*(TCHAR *)pCur == _T('\r'))) || ((!tUC) && (*(char *)pCur == '\r'))) { // in case the \r was at the end of the buffer, \n could be next SetFilePointer(hFile, -1*csz, NULL, FILE_CURRENT); totalReadSz -= csz; } - } while ( (totalReadSz < fileSz) && (readSz > 0) ); + } while ( (totalReadSz < fileSz) && (readSz > 0)); if (linePos < 0) { CloseHandle(hFile); free(pBuf); @@ -823,7 +823,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { } for (pCur = pBuf;(pCur < pBuf+readSz);pCur+=csz) { if ((tUC) && ((!_tcsncmp((TCHAR *)pCur, _T("\r\n"), 2)) || (*(TCHAR *)pCur == _T('\n'))) || - ((!tUC) && (((!strncmp((char *)pCur, "\r\n", 2)) || (*(char *)pCur == '\n')))) ) { + ((!tUC) && (((!strncmp((char *)pCur, "\r\n", 2)) || (*(char *)pCur == '\n'))))) { CloseHandle(hFile); if (tUC) { *(TCHAR *)pCur = _T('\0'); @@ -843,7 +843,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { return res; } } - if ( ((DWORD)(linePos+(pCur-pBuf)) == fileSz) ) { // eof + if ( ((DWORD)(linePos+(pCur-pBuf)) == fileSz)) { // eof CloseHandle(hFile); if (tUC) { @@ -859,7 +859,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { if (readSz == bufSz-csz) { // buffer must be increased bufSz += TXTFILEBUFSZ*csz; - if ( ((tUC) && (*(TCHAR *)pCur == _T('\r'))) || ((!tUC) && (*(char *)pCur == '\r')) ) { + if ( ((tUC) && (*(TCHAR *)pCur == _T('\r'))) || ((!tUC) && (*(char *)pCur == '\r'))) { pCur -= csz; } icur = pCur - pBuf; diff --git a/plugins/Variables/parse_variables.cpp b/plugins/Variables/parse_variables.cpp index 19f5a39c20..58520f1087 100644 --- a/plugins/Variables/parse_variables.cpp +++ b/plugins/Variables/parse_variables.cpp @@ -28,12 +28,12 @@ static int addToVariablesRegister(TCHAR *szName, TCHAR *szText) { int i; - if ( (szName == NULL) || (szText == NULL) || (_tcslen(szName) <= 0) ) { + if ( (szName == NULL) || (szText == NULL) || (_tcslen(szName) <= 0)) { return -1; } EnterCriticalSection(&csVarRegister); for (i=0;iargc == 0) || (ai->targv[0] == NULL) ) { + if ( (ai == NULL) || (ai->argc == 0) || (ai->targv[0] == NULL)) { return NULL; } callRes = 0; diff --git a/plugins/Variables/variables.cpp b/plugins/Variables/variables.cpp index 69adcd87f0..5f81c35eb3 100644 --- a/plugins/Variables/variables.cpp +++ b/plugins/Variables/variables.cpp @@ -61,7 +61,7 @@ TCHAR *getArguments(TCHAR *string, TCHAR ***aargv, int *aargc) { cur++; scur = cur-1; bDontParse = bNewArg = bDone = FALSE; - while ( (!bDone) && (*cur != _T('\0')) ) { + while ( (!bDone) && (*cur != _T('\0'))) { switch (*cur) { case _T(DONTPARSE_CHAR): if (bDontParse) { @@ -73,7 +73,7 @@ TCHAR *getArguments(TCHAR *string, TCHAR ***aargv, int *aargc) { break; case _T(','): - if ( (!bDontParse) && (brackets == 0) ) { + if ( (!bDontParse) && (brackets == 0)) { bNewArg = TRUE; } break; @@ -85,10 +85,10 @@ TCHAR *getArguments(TCHAR *string, TCHAR ***aargv, int *aargc) { break; case _T(')'): - if ( (brackets == 0) && (!bDontParse) ) { + if ( (brackets == 0) && (!bDontParse)) { bDone = bNewArg = TRUE; } - else if ( (brackets > 0) && (!bDontParse) ) { + else if ( (brackets > 0) && (!bDontParse)) { brackets -= 1; } break; @@ -207,12 +207,12 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) continue; } // remove end of lines - else if ( (!_tcsncmp(cur, _T("\r\n"), 2)) && (gParseOpts.bStripEOL) ) { + else if ( (!_tcsncmp(cur, _T("\r\n"), 2)) && (gParseOpts.bStripEOL)) { MoveMemory(cur, cur+2, (_tcslen(cur+2)+1)*sizeof(TCHAR)); pos = cur-string-1; continue; } - else if ( ((*cur == _T('\n')) && (gParseOpts.bStripEOL)) || ((*cur == _T(' ')) && (gParseOpts.bStripWS)) ) { + else if ( ((*cur == _T('\n')) && (gParseOpts.bStripEOL)) || ((*cur == _T(' ')) && (gParseOpts.bStripWS))) { MoveMemory(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); pos = cur - string - 1; continue; @@ -232,7 +232,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) pos = scur-string-1; continue; } - else if ( (*cur != _T(FIELD_CHAR)) && (*cur != _T(FUNC_CHAR)) && (*cur != _T(FUNC_ONCE_CHAR)) ) { + else if ( (*cur != _T(FIELD_CHAR)) && (*cur != _T(FUNC_CHAR)) && (*cur != _T(FUNC_ONCE_CHAR))) { if (gParseOpts.bStripAll) { MoveMemory(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); pos = cur - string - 1; @@ -283,12 +283,12 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) } cur += len+1; } - else if ( (*cur == _T(FUNC_CHAR)) || (*cur == _T(FUNC_ONCE_CHAR)) ) { + else if ( (*cur == _T(FUNC_CHAR)) || (*cur == _T(FUNC_ONCE_CHAR))) { TCHAR *argcur; cur += _tcslen(tr->tszTokenString)+1; argcur = getArguments(cur, &argv, &argc); - if ( (argcur == cur) || (argcur == NULL) ) { + if ( (argcur == cur) || (argcur == NULL)) { fi->eCount += 1; // error getting arguments continue; @@ -348,7 +348,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) // 'special' chars need to be taken care of (DONTPARSE, TRYPARSE, \r\n) // if the var contains the escape character, this character must be doubled, we don't want it to act as an esacpe char /*for (tcur=parsedToken;*tcur != '\0';tcur++) { - if (*tcur == DONTPARSE_CHAR) {//|| (*(var+pos) == ')') ) { + if (*tcur == DONTPARSE_CHAR) {//|| (*(var+pos) == ')')) { parsedToken = realloc(parsedToken, strlen(parsedToken) + 2); if (parsedToken == NULL) { fi->err = EMEM; @@ -572,7 +572,7 @@ int LoadVarModule() { HMODULE hUxTheme; - if ( (initTokenRegister() != 0) || (initContactModule() != 0) ) { + if ( (initTokenRegister() != 0) || (initContactModule() != 0)) { return -1; } -- cgit v1.2.3