diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /plugins/Dbx_mmap_SA/Dbtool | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mmap_SA/Dbtool')
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp | 6 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp | 4 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/disk.cpp | 6 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/encryption.cpp | 10 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp | 12 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp | 4 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp | 4 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/langpack.cpp | 18 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp | 6 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/progress.cpp | 6 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp | 12 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp | 8 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/user.cpp | 4 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/wizard.cpp | 10 | ||||
-rw-r--r-- | plugins/Dbx_mmap_SA/Dbtool/worker.cpp | 2 |
15 files changed, 56 insertions, 56 deletions
diff --git a/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp b/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp index 26312ea5b0..5ec62707f1 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp @@ -31,7 +31,7 @@ int WorkAggressive(int firstTime) BYTE *buf;
if(firstTime) {
- if(!opts.bAggressive) return ERROR_NO_MORE_ITEMS;
+ if (!opts.bAggressive) return ERROR_NO_MORE_ITEMS;
AddToStatus(STATUS_MESSAGE,TranslateT("Performing aggressive pass"));
ofsCurrent=0;
spaceProcessed=0;
@@ -43,13 +43,13 @@ int WorkAggressive(int firstTime) blockBytes-=3;
for(i=0;i<blockBytes;i++) {
if(buf[i]) {
- if((*(PDWORD)&buf[i]&0x00FFFFFF)!=0xDECADE)
+ if ((*(PDWORD)&buf[i]&0x00FFFFFF)!=0xDECADE)
AddToStatus(STATUS_WARNING,TranslateT("Aggressive: random junk at %08X: skipping"),ofsCurrent+i);
else {
//TODO: give user the option of placing manually
AddToStatus(STATUS_ERROR,TranslateT("Aggressive: unlinked data at %08X: can't automatically place"),ofsCurrent+i);
}
- for(;i<blockBytes;i++)
+ for (;i<blockBytes;i++)
if(buf[i]==0) {i--; break;}
}
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp b/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp index dd6d50556b..0452f90d0d 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp @@ -54,7 +54,7 @@ int WorkContactChain(int firstTime) FinishUp();
return ERROR_NO_MORE_ITEMS;
}
- if(!SignatureValid(ofsThisContact,DBCONTACT_SIGNATURE)) {
+ if (!SignatureValid(ofsThisContact,DBCONTACT_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("Contact chain corrupted, further entries ignored"));
FinishUp();
return ERROR_NO_MORE_ITEMS;
@@ -66,7 +66,7 @@ int WorkContactChain(int firstTime) ofsNextContact=dbc.ofsNext;
dbc.ofsNext=0;
if (!opts.bCheckOnly) {
- if((ofsDestThis=WriteSegment(WSOFS_END,&dbc,sizeof(dbc)))==WS_ERROR)
+ if ((ofsDestThis=WriteSegment(WSOFS_END,&dbc,sizeof(dbc)))==WS_ERROR)
return ERROR_HANDLE_DISK_FULL;
if(ofsDestPrevContact)
WriteSegment(ofsDestPrevContact+offsetof(DBContact,ofsNext),&ofsDestThis,sizeof(DWORD));
diff --git a/plugins/Dbx_mmap_SA/Dbtool/disk.cpp b/plugins/Dbx_mmap_SA/Dbtool/disk.cpp index 685f86569f..1ac84a3dc6 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/disk.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/disk.cpp @@ -55,7 +55,7 @@ int PeekSegment(DWORD ofs,PVOID buf,int cbBytes) CopyMemory(buf, opts.pFile+ofs, bytesRead);
- if((int)bytesRead<cbBytes) return ERROR_HANDLE_EOF;
+ if ((int)bytesRead<cbBytes) return ERROR_HANDLE_EOF;
return ERROR_SUCCESS;
}
@@ -88,7 +88,7 @@ DWORD WriteSegment(DWORD ofs,PVOID buf,int cbBytes) }
SetFilePointer(opts.hOutFile,ofs,NULL,FILE_BEGIN);
WriteFile(opts.hOutFile,buf,cbBytes,&bytesWritten,NULL);
- if((int)bytesWritten<cbBytes) {
+ if ((int)bytesWritten<cbBytes) {
AddToStatus(STATUS_FATAL,TranslateT("Can't write to output file - disk full? (%u)"),GetLastError());
return WS_ERROR;
}
@@ -105,7 +105,7 @@ int ReadWrittenSegment(DWORD ofs,PVOID buf,int cbBytes) SetFilePointer(opts.hOutFile,ofs,NULL,FILE_BEGIN);
ReadFile(opts.hOutFile,buf,cbBytes,&bytesRead,NULL);
- if((int)bytesRead<cbBytes)
+ if ((int)bytesRead<cbBytes)
return ERROR_READ_FAULT;
return ERROR_SUCCESS;
diff --git a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp index aabe3f98b2..cab515864c 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp @@ -59,7 +59,7 @@ void InitSecurity() TCHAR *str2;
GetModuleFileName(NULL,szMirandaDir,SIZEOF(szMirandaDir));
str2 = _tcsrchr(szMirandaDir,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
_tchdir(szMirandaDir);
}
@@ -105,7 +105,7 @@ void InitSecurity() }
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
AddToStatus(STATUS_MESSAGE,TranslateT("%d crypto modules loaded"), ModulesCount);
@@ -166,14 +166,14 @@ int CheckPassword(WORD checkWord, WORD cryptorUID, char * szDBName) {
int i;
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(cryptorUID == Modules[i]->cryptor->uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
AddToStatus(STATUS_FATAL, TranslateT("Sorry, but your database encrypted with unknown module"), MB_OK);
bCheckingPass = 0;
return 0;
@@ -277,7 +277,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam) UINT uid = LOWORD(wParam);
if(uid == IDOK){
- if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ if (!GetWindowLongPtr(hDlg,GWLP_USERDATA))
{
encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
EndDialog(hDlg,IDOK);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp b/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp index c48ab1b821..23dab85843 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp @@ -44,7 +44,7 @@ static void ConvertOldEvent( DBEvent*& dbei ) break;
} } }
else {
- if( !is_utf8_string(( char* )dbei->blob) )
+ if ( !is_utf8_string(( char* )dbei->blob) )
dbei->flags &= ~DBEF_UTF;
}
@@ -132,7 +132,7 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime) FinishUp(ofsDestPrevEvent,dbc);
return ERROR_NO_MORE_ITEMS;
}
- if(!SignatureValid(ofsThisEvent,DBEVENT_SIGNATURE))
+ if (!SignatureValid(ofsThisEvent,DBEVENT_SIGNATURE))
{
DWORD ofsNew = 0;
DWORD ofsTmp = dbc->ofsLastEvent;
@@ -163,7 +163,7 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime) }
if(firstTime) {
- if(!(dbeOld.flags&DBEF_FIRST)) {
+ if (!(dbeOld.flags&DBEF_FIRST)) {
AddToStatus(STATUS_WARNING,TranslateT("First event not marked as such: correcting"));
dbeOld.flags|=DBEF_FIRST;
}
@@ -180,7 +180,7 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime) dbeOld.flags&=(DBEF_FIRST|DBEF_READ|DBEF_SENT|DBEF_RTL|DBEF_UTF);
}
- if(!(dbeOld.flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbeOld.flags&(DBEF_READ|DBEF_SENT))) {
if(opts.bMarkRead) dbeOld.flags|=DBEF_READ;
else if(ofsFirstUnread==0) {
if(dbc->ofsFirstUnreadEvent!=ofsThisEvent || dbc->timestampFirstUnread!=dbeOld.timestamp)
@@ -211,12 +211,12 @@ int WorkEventChain(DWORD ofsContact,DBContact *dbc,int firstTime) return ERROR_NO_MORE_ITEMS;
}
- if((dbeNew->ofsModuleName=ConvertModuleNameOfs(dbeOld.ofsModuleName))==0) {
+ if ((dbeNew->ofsModuleName=ConvertModuleNameOfs(dbeOld.ofsModuleName))==0) {
ofsThisEvent=dbeOld.ofsNext;
return ERROR_SUCCESS;
}
- if(!firstTime && dbeOld.ofsPrev!=ofsPrevEvent)
+ if (!firstTime && dbeOld.ofsPrev!=ofsPrevEvent)
AddToStatus(STATUS_WARNING,TranslateT("Event not backlinked correctly: fixing"));
dbeNew->flags=dbeOld.flags;
diff --git a/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp b/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp index b7a99a5189..2ed8b7183d 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp @@ -72,7 +72,7 @@ int WorkFinalTasks(int firstTime) }
MoveFile(opts.filename,opts.backupFilename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to rename original file"));
}
- else if(!opts.bCheckOnly) DeleteFile(opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to delete original file"));
- if(!opts.bCheckOnly) MoveFile(opts.outputFilename,opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to rename output file"));
+ else if (!opts.bCheckOnly) DeleteFile(opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to delete original file"));
+ if (!opts.bCheckOnly) MoveFile(opts.outputFilename,opts.filename) || AddToStatus(STATUS_WARNING,TranslateT("Unable to rename output file"));
return ERROR_NO_MORE_ITEMS;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp b/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp index a2f621df46..385d31cb92 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp @@ -40,13 +40,13 @@ int WorkInitialChecks(int firstTime) }
bEncrypted = false;
if(memcmp(dbhdr.signature,&dbSignature,sizeof(dbhdr.signature))) {
- if(memcmp(dbhdr.signature,&dbSignatureEncrypted,sizeof(dbhdr.signature))){
+ if(memcmp(dbhdr.signature,&dbSignatureEncrypted,sizeof(dbhdr.signature))) {
AddToStatus(STATUS_FATAL,TranslateT("Database signature is corrupted, automatic repair is impossible"));
return ERROR_BAD_FORMAT;
}
AddToStatus(STATUS_SUCCESS,TranslateT("Database is Secured MMAP database"));
InitSecurity();
- if(CheckPassword(dbhdr.checkWord, dbhdr.cryptorUID, (char*)Translate("your database"))){
+ if(CheckPassword(dbhdr.checkWord, dbhdr.cryptorUID, (char*)Translate("your database"))) {
AddToStatus(STATUS_SUCCESS,TranslateT("Secured MMAP: authorization successful"));
bEncrypted = true;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp b/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp index 85df5cdf22..af251fe2f2 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp @@ -76,7 +76,7 @@ void ConvertBackslashes(char *str, UINT fileCp) char *pstr;
for (pstr = str; *pstr; pstr = CharNextExA(fileCp, pstr, 0))
{
- if( *pstr == '\\' )
+ if ( *pstr == '\\' )
{
switch( pstr[1] )
{
@@ -215,11 +215,11 @@ static int LoadLangPack(const TCHAR *szLangPack) pszColon=strchr(line,':');
if(pszColon==NULL) {fclose(fp); return 3;}
*pszColon=0;
- if(!lstrcmpA(line,"Language")) {_snprintf(langPack.language,sizeof(langPack.language),"%s",pszColon+1); TrimString(langPack.language);}
- else if(!lstrcmpA(line,"Last-Modified-Using")) {_snprintf(langPack.lastModifiedUsing,sizeof(langPack.lastModifiedUsing),"%s",pszColon+1); TrimString(langPack.lastModifiedUsing);}
- else if(!lstrcmpA(line,"Authors")) {_snprintf(langPack.authors,sizeof(langPack.authors),"%s",pszColon+1); TrimString(langPack.authors);}
- else if(!lstrcmpA(line,"Author-email")) {_snprintf(langPack.authorEmail,sizeof(langPack.authorEmail),"%s",pszColon+1); TrimString(langPack.authorEmail);}
- else if(!lstrcmpA(line, "Locale")) {
+ if (!lstrcmpA(line,"Language")) {_snprintf(langPack.language,sizeof(langPack.language),"%s",pszColon+1); TrimString(langPack.language);}
+ else if (!lstrcmpA(line,"Last-Modified-Using")) {_snprintf(langPack.lastModifiedUsing,sizeof(langPack.lastModifiedUsing),"%s",pszColon+1); TrimString(langPack.lastModifiedUsing);}
+ else if (!lstrcmpA(line,"Authors")) {_snprintf(langPack.authors,sizeof(langPack.authors),"%s",pszColon+1); TrimString(langPack.authors);}
+ else if (!lstrcmpA(line,"Author-email")) {_snprintf(langPack.authorEmail,sizeof(langPack.authorEmail),"%s",pszColon+1); TrimString(langPack.authorEmail);}
+ else if (!lstrcmpA(line, "Locale")) {
char szBuf[20], *stopped;
TrimString(pszColon + 1);
@@ -249,7 +249,7 @@ static int LoadLangPack(const TCHAR *szLangPack) pszLine = line+1;
line[lstrlenA(line)-1]='\0';
TrimStringSimple(line);
- if(++langPack.entryCount>entriesAlloced) {
+ if (++langPack.entryCount>entriesAlloced) {
entriesAlloced+=128;
langPack.entry=(struct LangPackEntry*)realloc(langPack.entry,sizeof(struct LangPackEntry)*entriesAlloced);
}
@@ -339,9 +339,9 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd,LPARAM lParam) int id = GetDlgCtrlID( hwnd );
GetClassName(hwnd,szClass,SIZEOF(szClass));
- if(!lstrcmpi(szClass,_T("static")) || !lstrcmpi(szClass,_T("hyperlink")) || !lstrcmpi(szClass,_T("button")) || !lstrcmpi(szClass,_T("MButtonClass")))
+ if (!lstrcmpi(szClass,_T("static")) || !lstrcmpi(szClass,_T("hyperlink")) || !lstrcmpi(szClass,_T("button")) || !lstrcmpi(szClass,_T("MButtonClass")))
TranslateWindow(hwnd);
- else if(!lstrcmpi(szClass,_T("edit"))) {
+ else if (!lstrcmpi(szClass,_T("edit"))) {
if ( GetWindowLong(hwnd,GWL_STYLE)&ES_READONLY)
TranslateWindow(hwnd);
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp b/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp index 515ec9bfbd..a93f1720e6 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp @@ -48,7 +48,7 @@ int WorkModuleChain(int firstTime) phase++;
return ERROR_SUCCESS;
}
- if(!SignatureValid(ofsCurrent,DBMODULENAME_SIGNATURE)) {
+ if (!SignatureValid(ofsCurrent,DBMODULENAME_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("Module chain corrupted, further entries ignored"));
phase++;
return ERROR_SUCCESS;
@@ -87,12 +87,12 @@ int WorkModuleChain(int firstTime) newModName=(DBModuleName*)_alloca(modChain[iCurrentModName].size);
if(ReadSegment(modChain[iCurrentModName].ofsOld,newModName,modChain[iCurrentModName].size)!=ERROR_SUCCESS)
return ERROR_NO_MORE_ITEMS;
- if((modChain[iCurrentModName].ofsNew=WriteSegment(WSOFS_END,newModName,modChain[iCurrentModName].size))==WS_ERROR)
+ if ((modChain[iCurrentModName].ofsNew=WriteSegment(WSOFS_END,newModName,modChain[iCurrentModName].size))==WS_ERROR)
return ERROR_HANDLE_DISK_FULL;
{ // check duplicated modulenames
int i, n=0;
for(i=iCurrentModName+1;i<modChainCount;i++)
- if(!strcmp(modChain[i].name, modChain[iCurrentModName].name)) {
+ if (!strcmp(modChain[i].name, modChain[iCurrentModName].name)) {
modChain[i].ofsNew = modChain[iCurrentModName].ofsNew;
n++;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/progress.cpp b/plugins/Dbx_mmap_SA/Dbtool/progress.cpp index 4b7d7979b4..caca179482 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/progress.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/progress.cpp @@ -42,7 +42,7 @@ int AddToStatus(DWORD flags, TCHAR* fmt,...) OutputDebugString(str);
OutputDebugStringA("\n");
#endif
- if((flags&STATUS_CLASSMASK)==STATUS_ERROR) errorCount++;
+ if ((flags&STATUS_CLASSMASK)==STATUS_ERROR) errorCount++;
return ret;
}
@@ -118,7 +118,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa TCHAR str[256];
int bold=0;
HFONT hoFont;
- if((int)dis->itemID==-1) break;
+ if ((int)dis->itemID==-1) break;
SendMessage(dis->hwndItem,LB_GETTEXT,dis->itemID,(LPARAM)str);
switch(dis->itemData&STATUS_CLASSMASK) {
case STATUS_MESSAGE:
@@ -175,7 +175,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa switch(LOWORD(wParam)) {
case IDC_BACK:
ResetEvent(hEventRun);
- if(!IsWindowEnabled(GetDlgItem(GetParent(hdlg),IDOK))) {
+ if (!IsWindowEnabled(GetDlgItem(GetParent(hdlg),IDOK))) {
if(MessageBox(hdlg,TranslateT("Processing has not yet completed, if you go back now then the changes that have currently been made will be rolled back and the original database will be restored. Do you still want to go back?"),TranslateT("Miranda Database Tool"),MB_YESNO)==IDYES) {
manualAbort=2;
SetEvent(hEventAbort);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp b/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp index d8fa36ed75..08bbd35016 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp @@ -27,7 +27,7 @@ void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath) GetPrivateProfileString(_T("Database"),_T("ProfileDir"),_T("./Profiles"),szProfileDir,SIZEOF(szProfileDir),szMirandaBootIni);
ExpandEnvironmentStrings(szProfileDir,szExpandedProfileDir,SIZEOF(szExpandedProfileDir));
_tchdir(szMirandaDir);
- if(!_tfullpath(szPath,szExpandedProfileDir,cbPath))
+ if (!_tfullpath(szPath,szExpandedProfileDir,cbPath))
lstrcpyn(szPath,szMirandaDir,cbPath);
if(szPath[lstrlen(szPath)-1]=='\\')
szPath[lstrlen(szPath)-1] = 0;
@@ -48,7 +48,7 @@ static int AddDatabaseToList(HWND hwndList, TCHAR* filename, TCHAR* dir) lvi.iSubItem=0;
for(lvi.iItem=ListView_GetItemCount(hwndList)-1;lvi.iItem>=0;lvi.iItem--) {
ListView_GetItem(hwndList,&lvi);
- if( !_tcsicmp(( TCHAR* )lvi.lParam,filename)) return lvi.iItem;
+ if ( !_tcsicmp(( TCHAR* )lvi.lParam,filename)) return lvi.iItem;
}
hDbFile=CreateFile(filename,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
if ( hDbFile == INVALID_HANDLE_VALUE )
@@ -59,7 +59,7 @@ static int AddDatabaseToList(HWND hwndList, TCHAR* filename, TCHAR* dir) broken = (bytesRead<sizeof(dbhdr) || memcmp(dbhdr.signature,&dbSignature,sizeof(dbhdr.signature)));
- if(!broken) {
+ if (!broken) {
wasted = dbhdr.slackSpace;
if (totalSize>dbhdr.ofsFileEnd)
wasted+=totalSize-dbhdr.ofsFileEnd;
@@ -166,7 +166,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa TCHAR *str2;
GetModuleFileName(NULL,szMirandaPath,SIZEOF(szMirandaPath));
str2 = _tcsrchr(szMirandaPath,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
}
{
@@ -181,7 +181,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa GetProfileDirectory(szMirandaPath,szProfileDir,SIZEOF(szProfileDir));
// search in profile dir (using ini file)
- if( lstrcmpi(szProfileDir,szMirandaProfiles) )
+ if ( lstrcmpi(szProfileDir,szMirandaProfiles) )
FindAdd(hdlg, szProfileDir, _T("[ini]\\"));
FindAdd(hdlg, szMirandaProfiles, _T("[prf]\\"));
@@ -191,7 +191,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPa // search in profile dir (using registry path + ini file)
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\miranda32.exe"),0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS) {
if(RegQueryValueEx(hKey,_T("Path"),NULL,NULL,(PBYTE)szMirandaPath,&cbData) == ERROR_SUCCESS) {
- if( lstrcmp(szProfileDir,szMirandaPath) ) {
+ if ( lstrcmp(szProfileDir,szMirandaPath) ) {
GetProfileDirectory(szMirandaPath,szProfileDir,SIZEOF(szProfileDir));
FindAdd(hdlg, szProfileDir, _T("[reg]\\"));
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp b/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp index 6c7b95febc..a6e7ecab3b 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp @@ -33,7 +33,7 @@ int WorkSettingsChain(DWORD ofsContact,DBContact *dbc,int firstTime) }
if(ofsThisSettings==0)
return ERROR_NO_MORE_ITEMS;
- if(!SignatureValid(ofsThisSettings,DBCONTACTSETTINGS_SIGNATURE)) {
+ if (!SignatureValid(ofsThisSettings,DBCONTACTSETTINGS_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("Settings chain corrupted, further entries ignored"));
return ERROR_NO_MORE_ITEMS;
}
@@ -45,12 +45,12 @@ int WorkSettingsChain(DWORD ofsContact,DBContact *dbc,int firstTime) return ERROR_SUCCESS;
}
dbcsNew=(DBContactSettings*)_alloca(offsetof(DBContactSettings,blob)+dbcsOld.cbBlob);
- if((ret=ReadSegment(ofsThisSettings,dbcsNew,offsetof(DBContactSettings,blob)+dbcsOld.cbBlob))!=ERROR_SUCCESS) {
+ if ((ret=ReadSegment(ofsThisSettings,dbcsNew,offsetof(DBContactSettings,blob)+dbcsOld.cbBlob))!=ERROR_SUCCESS) {
if(ret!=ERROR_HANDLE_EOF) { //eof is OK because blank space at the end doesn't matter
return ERROR_NO_MORE_ITEMS;
}
}
- if((dbcsNew->ofsModuleName=ConvertModuleNameOfs(dbcsOld.ofsModuleName))==0) {
+ if ((dbcsNew->ofsModuleName=ConvertModuleNameOfs(dbcsOld.ofsModuleName))==0) {
ofsThisSettings=dbcsOld.ofsNext;
return ERROR_SUCCESS;
}
@@ -61,7 +61,7 @@ int WorkSettingsChain(DWORD ofsContact,DBContact *dbc,int firstTime) }
dbcsNew->ofsNext=0;
//TODO? validate all settings in blob/compact if necessary
- if((ofsDestThis=WriteSegment(WSOFS_END,dbcsNew,offsetof(DBContactSettings,blob)+dbcsNew->cbBlob))==WS_ERROR) {
+ if ((ofsDestThis=WriteSegment(WSOFS_END,dbcsNew,offsetof(DBContactSettings,blob)+dbcsNew->cbBlob))==WS_ERROR) {
return ERROR_HANDLE_DISK_FULL;
}
if(ofsDestPrevSettings) WriteSegment(ofsDestPrevSettings+offsetof(DBContactSettings,ofsNext),&ofsDestThis,sizeof(DWORD));
diff --git a/plugins/Dbx_mmap_SA/Dbtool/user.cpp b/plugins/Dbx_mmap_SA/Dbtool/user.cpp index 79f30eace7..9922f1630f 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/user.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/user.cpp @@ -31,7 +31,7 @@ int WorkUser(int firstTime) if(firstTime) {
AddToStatus(STATUS_MESSAGE,TranslateT("Processing user data"));
- if(!SignatureValid(dbhdr.ofsUser,DBCONTACT_SIGNATURE)) {
+ if (!SignatureValid(dbhdr.ofsUser,DBCONTACT_SIGNATURE)) {
AddToStatus(STATUS_ERROR,TranslateT("User corrupted, this could cause major problems"));
return ERROR_NO_MORE_ITEMS;
}
@@ -41,7 +41,7 @@ int WorkUser(int firstTime) AddToStatus(STATUS_WARNING,TranslateT("More than one user contact: keeping only first"));
user.ofsNext=0;
}
- if((ofsUser=WriteSegment(WSOFS_END,&user,sizeof(DBContact)))==WS_ERROR)
+ if ((ofsUser=WriteSegment(WSOFS_END,&user,sizeof(DBContact)))==WS_ERROR)
return ERROR_HANDLE_DISK_FULL;
dbhdr.ofsUser=ofsUser;
phase=0;
diff --git a/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp b/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp index 499b420dd9..ab3c46f360 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/wizard.cpp @@ -31,11 +31,11 @@ static BOOL CALLBACK MyControlsEnumChildren(HWND hwnd,LPARAM lParam) int makeBold=0;
GetClassNameA(hwnd,szClass,sizeof(szClass));
- if(!strcmp(szClass,"Static")) {
- if(((style&SS_TYPEMASK)==SS_LEFT || (style&SS_TYPEMASK)==SS_CENTER || (style&SS_TYPEMASK)==SS_RIGHT) && exstyle&WS_EX_CLIENTEDGE)
+ if (!strcmp(szClass,"Static")) {
+ if (((style&SS_TYPEMASK)==SS_LEFT || (style&SS_TYPEMASK)==SS_CENTER || (style&SS_TYPEMASK)==SS_RIGHT) && exstyle&WS_EX_CLIENTEDGE)
makeBold=1;
}
- else if(!strcmp(szClass,"Button")) {
+ else if (!strcmp(szClass,"Button")) {
if(exstyle&WS_EX_CLIENTEDGE)
makeBold=1;
}
@@ -67,10 +67,10 @@ int DoMyControlProcessing(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam,INT *bReturn=(BOOL)GetStockObject(WHITE_BRUSH);
return TRUE;
}
- if((GetWindowLongPtr((HWND)lParam,GWL_STYLE)&0xFFFF)==0) {
+ if ((GetWindowLongPtr((HWND)lParam,GWL_STYLE)&0xFFFF)==0) {
TCHAR szText[256];
GetWindowText((HWND)lParam,szText,SIZEOF(szText));
- if(!_tcscmp(szText,_T("whiterect"))) {
+ if (!_tcscmp(szText,_T("whiterect"))) {
SetTextColor((HDC)wParam,RGB(255,255,255));
SetBkColor((HDC)wParam,RGB(255,255,255));
SetBkMode((HDC)wParam,OPAQUE);
diff --git a/plugins/Dbx_mmap_SA/Dbtool/worker.cpp b/plugins/Dbx_mmap_SA/Dbtool/worker.cpp index 7f22539f8f..dd73c83947 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/worker.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/worker.cpp @@ -59,7 +59,7 @@ void __cdecl WorkerThread(void *unused) ret=Workers[task](firstTime);
firstTime=0;
if(ret==ERROR_NO_MORE_ITEMS) {
- if(++task==sizeof(Workers)/sizeof(Workers[0])) {
+ if (++task==sizeof(Workers)/sizeof(Workers[0])) {
AddToStatus(STATUS_MESSAGE,TranslateT("Elapsed time: %d sec"), time(NULL)-ts);
if(errorCount)
AddToStatus(STATUS_SUCCESS,TranslateT("All tasks completed but with errors (%d)"),errorCount);
|