From d154673f93ad95197bce8cadb995daa5bc39f5d8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 21 Jan 2014 20:04:48 +0000 Subject: minor code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@7820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/database/database.cpp | 8 ++++---- src/modules/database/dbintf.cpp | 2 +- src/modules/database/dbutils.cpp | 18 +++++++++--------- src/modules/database/profilemanager.cpp | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/modules/database') diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index 303198d9d0..21a958ecd4 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -137,12 +137,12 @@ static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cc _tcsncpy(buf, src, SIZEOF(buf)); TCHAR *p = _tcsrchr(buf, '\\'); if (p) ++p; else p = buf; - if ( !isValidProfileName(buf) && *p) + if (!isValidProfileName(buf) && *p) _tcscat(buf, _T(".dat")); TCHAR profileName[MAX_PATH], newProfileDir[MAX_PATH]; _tcscpy(profileName, p); - if ( !isValidProfileName(profileName) && *p) + if (!isValidProfileName(profileName) && *p) _tcscat(profileName, _T(".dat")); _tcscpy(profileName, p); @@ -329,7 +329,7 @@ char* makeFileName(const TCHAR* tszOriginalName) szResult = mir_t2a(tszProfile); } - if ( !szResult) + if (!szResult) szResult = szFileName; else mir_free(szFileName); @@ -438,7 +438,7 @@ int LoadDatabaseModule(void) szProfile[0] = 0; // find out which profile to load - if ( !getProfile(szProfile, SIZEOF(szProfile))) + if (!getProfile(szProfile, SIZEOF(szProfile))) return 1; EnsureCheckerLoaded(false); // unload dbchecker diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp index 35a0557362..58b86606b6 100644 --- a/src/modules/database/dbintf.cpp +++ b/src/modules/database/dbintf.cpp @@ -48,7 +48,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM) static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM) { DBVARIANT dbv = {0}; - if ( !db_get_ts((HANDLE)wParam, "ContactPhoto", "File", &dbv)) { + if (!db_get_ts((HANDLE)wParam, "ContactPhoto", "File", &dbv)) { DeleteFile(dbv.ptszVal); db_free(&dbv); } diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index f57ce37446..977248f906 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -55,12 +55,12 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam) p->eventIcon = et->eventIcon; p->flags = et->flags; } - if ( !p->textService) { + if (!p->textService) { char szServiceName[100]; mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventText%d", p->module, p->eventType); p->textService = mir_strdup(szServiceName); } - if ( !p->iconService) { + if (!p->iconService) { char szServiceName[100]; mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType); p->iconService = mir_strdup(szServiceName); @@ -78,7 +78,7 @@ static INT_PTR DbEventTypeGet(WPARAM wParam, LPARAM lParam) tmp.module = (char*)wParam; tmp.eventType = lParam; - if ( !List_GetIndex((SortedList*)&eventTypes, &tmp, &idx)) + if (!List_GetIndex((SortedList*)&eventTypes, &tmp, &idx)) return 0; return (INT_PTR)eventTypes[idx]; @@ -215,13 +215,13 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam) } if (et && et->eventIcon) icon = Skin_GetIconByHandle(et->eventIcon); - if ( !icon) { + if (!icon) { char szName[100]; mir_snprintf(szName, sizeof(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType); icon = Skin_GetIcon(szName); } - if ( !icon) { + if (!icon) { switch(dbei->eventType) { case EVENTTYPE_URL: icon = LoadSkinIcon(SKINICON_EVENT_URL); @@ -279,7 +279,7 @@ static INT_PTR DbDeleteModule(WPARAM, LPARAM lParam) static INT_PTR GetProfilePath(WPARAM wParam, LPARAM lParam) { - if ( !wParam || !lParam) + if (!wParam || !lParam) return 1; char *dst = (char*)lParam; @@ -290,7 +290,7 @@ static INT_PTR GetProfilePath(WPARAM wParam, LPARAM lParam) static INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) { - if ( !wParam || !lParam) + if (!wParam || !lParam) return 1; char *dst = (char*)lParam; @@ -305,7 +305,7 @@ static INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) static INT_PTR GetProfilePathW(WPARAM wParam, LPARAM lParam) { - if ( !wParam || !lParam) + if (!wParam || !lParam) return 1; wchar_t *dst = (wchar_t*)lParam; @@ -354,7 +354,7 @@ int LoadEventsModule() void UnloadEventsModule() { - if ( !bModuleInitialized) + if (!bModuleInitialized) return; for (int i=0; i < eventTypes.getCount(); i++) { diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index c69a89de89..66b721b2d2 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -101,7 +101,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA mir_sntprintf(buf, SIZEOF(buf), _T("%s\\%s\\%s.dat"), szProfileDir, ffd.cFileName, ffd.cFileName); if (_taccess(buf, 0) == 0) { mir_sntprintf(profile, SIZEOF(profile), _T("%s.dat"), ffd.cFileName); - if ( !callback(buf, profile, lParam)) + if (!callback(buf, profile, lParam)) break; } } -- cgit v1.2.3