summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mmap_SA')
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/aggressive.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/contactchain.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/disk.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/encryption.cpp10
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/eventchain.cpp12
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/finaltasks.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/initialchecks.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/langpack.cpp18
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/progress.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/selectdb.cpp12
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/settingschain.cpp8
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/user.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/wizard.cpp10
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/worker.cpp2
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/encryption.c12
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirabilis.c34
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/miranda.c4
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c4
-rw-r--r--plugins/Dbx_mmap_SA/dbcache.c2
-rw-r--r--plugins/Dbx_mmap_SA/dbcontacts.c2
-rw-r--r--plugins/Dbx_mmap_SA/dbevents.c12
-rw-r--r--plugins/Dbx_mmap_SA/dbsettings.c14
-rw-r--r--plugins/Dbx_mmap_SA/dialogs.c28
-rw-r--r--plugins/Dbx_mmap_SA/security.c22
25 files changed, 123 insertions, 123 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);
diff --git a/plugins/Dbx_mmap_SA/Import_SA/encryption.c b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
index 6cb98d20c1..f261581041 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/encryption.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
@@ -62,7 +62,7 @@ void InitSecurity()
GetModuleFileName(NULL,szMirandaDir,SIZEOF(szMirandaDir));
str2 = _tcsrchr(szMirandaDir,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
_tchdir(szMirandaDir);
}
@@ -112,7 +112,7 @@ void InitSecurity()
}
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
AddMessage(LPGEN("%d crypto modules loaded"), ModulesCount);
@@ -173,14 +173,14 @@ int CheckPassword(WORD checkWord, WORD cryptorUID, TCHAR * 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){
AddMessage(LPGEN("Sorry, but your database encrypted with unknown module"), MB_OK);
bCheckingPass = 0;
return 0;
@@ -245,7 +245,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PASS));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_SETICON, 0, (LPARAM)hIcon);
- if(!wrongPass)
+ if (!wrongPass)
{
mir_sntprintf(tszHeaderTxt, SIZEOF(tszHeaderTxt), _T("%s\n%s"), TranslateT("Please type in your password for"), lParam);
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), tszHeaderTxt);
@@ -287,7 +287,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/Import_SA/mirabilis.c b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
index 6d99757d4d..130843205e 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
@@ -244,7 +244,7 @@ static int GetHighestIndexEntry(void)
DWORD ofs;
ofs=*(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) return ((struct TIdxDatEntry*)entry)->entryId;
if(entry->ofsHigher>=0xF0000000) ofs=entry->ofsInHere;
@@ -256,7 +256,7 @@ static int GetIdDatOfs(DWORD id)
{
struct TIdxIndexEntry *entry;
DWORD ofs = *(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) {
if(entry->entryIdHigh==id) return ((struct TIdxDatEntry*)entry)->datOfs;
@@ -389,7 +389,7 @@ DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult)
if ( SearchWord ) {
// Is this the property we are searching for?
- if(!lstrcmpA((char*)(pDat+nameOfs),SearchWord)){
+ if (!lstrcmpA((char*)(pDat+nameOfs),SearchWord)) {
*nSearchResult = 1;
return dwOffset;
} }
@@ -485,10 +485,10 @@ DWORD FindMyDetails(void)
DWORD dwOffset = GetIdDatOfs(1005);
if (!dwOffset) return 0;
- if(*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
- if(*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
- if(*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
- if(*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
+ if (*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
+ if (*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
return dwOffset;
}
@@ -527,7 +527,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x04; // ++ UNKNOWN ++
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook starts here
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -597,7 +597,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x08;
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -649,8 +649,8 @@ char* GetGroupName(DWORD dwGroupID)
switch (dwDBVersion) {
case DBV99A:
case DBV99B:
- for (n = 0; n < dwGroups; n++){
- if (dwGroupID == *(PDWORD)(pDat + dwOffset)){
+ for (n = 0; n < dwGroups; n++) {
+ if (dwGroupID == *(PDWORD)(pDat + dwOffset)) {
if (*(PWORD)(pDat + dwOffset + 4) > 1)
return 6 + (char*)(pDat + dwOffset);
@@ -665,10 +665,10 @@ char* GetGroupName(DWORD dwGroupID)
case DBV2000A:
case DBV2000B:
case DBV2001A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)) {
if (nSearchResult) {
- if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)){
+ if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)) {
strGroupName = 3 + (char*)(pDat + ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult));
if (nSearchResult) {
if ((DWORD)*(strGroupName - 2) > 1)
@@ -745,7 +745,7 @@ int ImportGroups()
switch (nFormat) {
case ENTRYV99A:
case ENTRYV99B:
- for (n = 0; n < dwGroups; n++){
+ for (n = 0; n < dwGroups; n++) {
if (*(PWORD)(pDat+dwOffset+4) > 1) {
if ( CreateGroup(DBVT_ASCIIZ, (char*)(pDat + dwOffset) + 6, NULL ))
nImported++;
@@ -758,8 +758,8 @@ int ImportGroups()
case ENTRYV2001A:
case ENTRYV2001B:
case ENTRYV2002A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)) {
if (nSearchResult) {
if (CreateGroup( DBVT_ASCIIZ, (char*)(pDat + tmpOfs + 3), NULL ))
nImported++;
diff --git a/plugins/Dbx_mmap_SA/Import_SA/miranda.c b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
index 6812557533..69b348d192 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/miranda.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
@@ -517,7 +517,7 @@ int CheckFileFormat(HANDLE hDbFile)
bEncrypted = FALSE;
if (memcmp(pdbHeader->signature, &dbSignature, sizeof(pdbHeader->signature))) {
// Unsane: if not encrypted signature
- if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))){
+ if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))) {
AddMessage( LPGEN("Signature mismatch" ));
return DB_INVALID;
}
@@ -525,7 +525,7 @@ int CheckFileFormat(HANDLE hDbFile)
// Unsane: check password
InitSecurity();
tszDbName = _tcsrchr(importFile, _T('\\')) + 1;
- if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)){
+ if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)) {
AddMessage(LPGEN("Secured MMAP: authorization successful"));
bEncrypted = TRUE;
}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
index 232d295f8d..ba7a923df7 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
@@ -92,7 +92,7 @@ static PBYTE ReadHistoryLines(FILE *fp,int *cbBlob)
blob=(char*)realloc(blob,*cbBlob+1);
lstrcpy(blob+ofs,str);
}
- if(*cbBlob) {
+ if (*cbBlob) {
(*cbBlob)--;
blob[*cbBlob-1]=0;
}
@@ -150,7 +150,7 @@ static void OldMirandaHistoryImport(HWND hdlgProgress)
tmEventTime.tm_mon=atoi(timeofs+10)-1;
tmEventTime.tm_year=atoi(timeofs+13)-1900;
dbei.timestamp=mktime(&tmEventTime)+_timezone;
- if(!(importOptions&historyTypeToOption[type])) continue;
+ if (!(importOptions&historyTypeToOption[type])) continue;
hContact=HistoryImportFindContact(hdlgProgress,uin,importOptions&IOPT_ADDUNKNOWN);
if(hContact==INVALID_HANDLE_VALUE) break;
dbei.flags=issent(type)?DBEF_SENT:DBEF_READ;
diff --git a/plugins/Dbx_mmap_SA/dbcache.c b/plugins/Dbx_mmap_SA/dbcache.c
index 8e177c6f6d..625d8aa775 100644
--- a/plugins/Dbx_mmap_SA/dbcache.c
+++ b/plugins/Dbx_mmap_SA/dbcache.c
@@ -144,7 +144,7 @@ static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR id
void DBFlush(int setting)
{
- if(!setting) {
+ if (!setting) {
log0("nflush1");
if(safetyMode && pDbCache) {
if (FlushViewOfFile(pDbCache, 0) == 0) {
diff --git a/plugins/Dbx_mmap_SA/dbcontacts.c b/plugins/Dbx_mmap_SA/dbcontacts.c
index 0803f1f746..51e533266d 100644
--- a/plugins/Dbx_mmap_SA/dbcontacts.c
+++ b/plugins/Dbx_mmap_SA/dbcontacts.c
@@ -153,7 +153,7 @@ static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
struct DBEvent *dbe;
int index;
- if((HANDLE)wParam==NULL) return 1;
+ if ((HANDLE)wParam==NULL) return 1;
EnterCriticalSection(&csDbAccess);
dbc=(struct DBContact*)DBRead(wParam,sizeof(struct DBContact),NULL);
if(dbc->signature!=DBCONTACT_SIGNATURE) {
diff --git a/plugins/Dbx_mmap_SA/dbevents.c b/plugins/Dbx_mmap_SA/dbevents.c
index afc3838b6d..6ecde67a55 100644
--- a/plugins/Dbx_mmap_SA/dbevents.c
+++ b/plugins/Dbx_mmap_SA/dbevents.c
@@ -135,7 +135,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
// Loop through the chain, starting at the end
ofsThis = dbc.ofsLastEvent;
dbeTest = (struct DBEvent*)DBRead(ofsThis, sizeof(struct DBEvent), NULL);
- for(;;) {
+ for (;;) {
// If the new event's timesstamp is equal to or greater than the
// current dbevent, it will be inserted after. If not, continue
// with the previous dbevent in chain.
@@ -159,7 +159,7 @@ static INT_PTR AddEvent(WPARAM wParam,LPARAM lParam)
}
}
dbc.eventCount++;
- if(!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe.flags&(DBEF_READ|DBEF_SENT))) {
if(dbe.timestamp<dbc.timestampFirstUnread || dbc.timestampFirstUnread==0) {
dbc.timestampFirstUnread=dbe.timestamp;
dbc.ofsFirstUnreadEvent=ofsNew;
@@ -209,7 +209,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
//check if this was the first unread, if so, recalc the first unread
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
dbeNext=&dbe;
- for(;;) {
+ for (;;) {
if(dbeNext->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -217,7 +217,7 @@ static INT_PTR DeleteEvent(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbeNext->ofsNext;
dbeNext=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbeNext->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbeNext->timestamp;
break;
@@ -390,7 +390,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
DBWrite(lParam,dbe,sizeof(struct DBEvent));
ret=(int)dbe->flags;
if(dbc.ofsFirstUnreadEvent==(DWORD)lParam) {
- for(;;) {
+ for (;;) {
if(dbe->ofsNext==0) {
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
@@ -398,7 +398,7 @@ static INT_PTR MarkEventRead(WPARAM wParam,LPARAM lParam)
}
ofsThis=dbe->ofsNext;
dbe=(struct DBEvent*)DBRead(ofsThis,sizeof(struct DBEvent),NULL);
- if(!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
+ if (!(dbe->flags&(DBEF_READ|DBEF_SENT))) {
dbc.ofsFirstUnreadEvent=ofsThis;
dbc.timestampFirstUnread=dbe->timestamp;
break;
diff --git a/plugins/Dbx_mmap_SA/dbsettings.c b/plugins/Dbx_mmap_SA/dbsettings.c
index bf876d0570..1d0fb69d62 100644
--- a/plugins/Dbx_mmap_SA/dbsettings.c
+++ b/plugins/Dbx_mmap_SA/dbsettings.c
@@ -327,7 +327,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
dbcgs->pValue->cchVal--;
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cchVal) dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
DecodeCopyMemory(dbcgs->pValue->pszVal,pBlob+3,dbcgs->pValue->cchVal);
dbcgs->pValue->pszVal[dbcgs->pValue->cchVal]=0;
dbcgs->pValue->cchVal=*(PWORD)(pBlob+1);
@@ -341,7 +341,7 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
case DBVT_BLOB:
NeedBytes(3+*(PWORD)(pBlob+1));
if(isStatic) {
- if(*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
+ if (*(PWORD)(pBlob+1)<dbcgs->pValue->cpbVal) dbcgs->pValue->cpbVal=*(PWORD)(pBlob+1);
DecodeCopyMemory(dbcgs->pValue->pbVal,pBlob+3,dbcgs->pValue->cpbVal);
}
else {
@@ -749,7 +749,7 @@ static INT_PTR WriteContactSetting(WPARAM wParam, LPARAM lParam)
else bytesRequired=tmp.value.type;
bytesRequired+=2+settingNameLen;
bytesRequired+=ofsBlobPtr+1-(ofsSettingsGroup+offsetof(struct DBContactSettings,blob));
- if((DWORD)bytesRequired>dbcs.cbBlob) {
+ if ((DWORD)bytesRequired>dbcs.cbBlob) {
//doesn't fit: move entire group
struct DBContactSettings *dbcsPrev;
DWORD ofsDbcsPrev,ofsNew;
@@ -879,7 +879,7 @@ static INT_PTR DeleteContactSetting(WPARAM wParam, LPARAM lParam)
MoveAlong(1+GetSettingValueLength(pBlob));
NeedBytes(1);
}
- if(!pBlob[0]) { //setting didn't exist
+ if (!pBlob[0]) { //setting didn't exist
LeaveCriticalSection(&csDbAccess);
return 1;
}
@@ -941,7 +941,7 @@ static INT_PTR EnumContactSettings(WPARAM wParam, LPARAM lParam)
return -1;
}
dbces->ofsSettings=GetSettingsGroupOfsByModuleNameOfs(dbc,ofsModuleName);
- if(!dbces->ofsSettings) {
+ if (!dbces->ofsSettings) {
LeaveCriticalSection(&csDbAccess);
return -1;
}
@@ -986,7 +986,7 @@ void EncodeContactSettings(HANDLE hContact)
struct DBContactSettings * setting;
DWORD offset;
- if(!hContact) hContact = (HANDLE)dbHeader.ofsUser;
+ if (!hContact) hContact = (HANDLE)dbHeader.ofsUser;
contact = (struct DBContact *)DBRead((DWORD)hContact, sizeof(struct DBContact), NULL);
if(contact -> ofsFirstSettings){
setting = (struct DBContactSettings *)DBRead(contact -> ofsFirstSettings, sizeof(struct DBContactSettings), NULL);
@@ -1059,7 +1059,7 @@ void DecodeContactSettings(HANDLE hContact)
DWORD offset;
- if(!hContact) hContact = (HANDLE)dbHeader.ofsUser;
+ if (!hContact) hContact = (HANDLE)dbHeader.ofsUser;
contact = (struct DBContact *)DBRead((DWORD)hContact, sizeof(struct DBContact), NULL);
if(contact -> ofsFirstSettings){
setting = (struct DBContactSettings *)DBRead(contact -> ofsFirstSettings, sizeof(struct DBContactSettings), NULL);
diff --git a/plugins/Dbx_mmap_SA/dialogs.c b/plugins/Dbx_mmap_SA/dialogs.c
index 48c13183f8..15405ff5ee 100644
--- a/plugins/Dbx_mmap_SA/dialogs.c
+++ b/plugins/Dbx_mmap_SA/dialogs.c
@@ -212,7 +212,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
uid = DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", 0);
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
char buf[100];
item.mask = LVIF_TEXT;
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if ( hdr && hdr->hdr.code == LVN_ITEMCHANGED && IsWindowVisible(hdr->hdr.hwndFrom) && hdr->iItem != (-1) ) {
iIndex = hdr->iItem;
if(hdr->uNewState & 0x2000){
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(i != iIndex) ListView_SetCheckState(hwndList, i, 0);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -296,19 +296,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
int alg = -1;
- for(i = 0; i < ModulesCount; i++){
- if(ListView_GetCheckState(hwndList, i)){
+ for(i = 0; i < ModulesCount; i++) {
+ if(ListView_GetCheckState(hwndList, i)) {
alg = i;
break;
}
}
if(alg > -1){
- if(!bEncoding){
+ if (!bEncoding){
DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", Modules[alg]->cryptor->uid);
EncryptDB();
}else{
- if(Modules[alg]->cryptor->uid != DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", -1)){
+ if(Modules[alg]->cryptor->uid != DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", -1)) {
DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", Modules[alg]->cryptor->uid);
RecryptDB();
}
@@ -321,7 +321,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
uid = DBGetContactSettingWord(NULL, "SecureMMAP", "CryptoModule", 0);
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(uid == Modules[i]->cryptor->uid && bEncoding)
ListView_SetCheckState(hwndList, i, 1);
@@ -374,7 +374,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON2));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_SETICON, 0, (LPARAM)hIcon);
- if(!wrongPass)
+ if (!wrongPass)
{
tszDbName = mir_a2t((char*)lParam);
mir_sntprintf(tszHeaderTxt, SIZEOF(tszHeaderTxt), _T("%s\n%s"), TranslateT("Please type in your password for"), tszDbName);
@@ -419,7 +419,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);
@@ -485,7 +485,7 @@ BOOL CALLBACK DlgStdNewPass(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))
{
char pass1[255], pass2[255];
if(GetDlgItemTextA(hDlg, IDC_USERPASS1, pass1, 254) < 3){
@@ -496,7 +496,7 @@ BOOL CALLBACK DlgStdNewPass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
}else{
GetDlgItemTextA(hDlg, IDC_USERPASS2, pass2, 254);
- if(!strcmp(pass1, pass2)){
+ if (!strcmp(pass1, pass2)) {
encryptKeyLength = strlen(pass1);
strcpy(encryptKey, pass1);
EndDialog(hDlg,IDOK);
@@ -573,7 +573,7 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
if(uid == IDOK){
char pass1[255], pass2[255], oldpass[255];
GetDlgItemTextA(hDlg, IDC_OLDPASS, oldpass, 254);
- if(strcmp(oldpass, encryptKey)){
+ if(strcmp(oldpass, encryptKey)) {
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), TranslateT("Wrong password!"));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_NCPAINT, 0, 0);
break;
@@ -584,7 +584,7 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
}else{
GetDlgItemTextA(hDlg, IDC_NEWPASS2, pass2, 254);
- if(!strcmp(pass1, pass2)){
+ if (!strcmp(pass1, pass2)) {
strcpy(newPass, pass1);
EndDialog(hDlg,IDOK);
}else{
@@ -597,7 +597,7 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
}else if(uid == IDREMOVE){
char oldpass[255];
GetDlgItemTextA(hDlg, IDC_OLDPASS, oldpass, 254);
- if(strcmp(oldpass, encryptKey)){
+ if(strcmp(oldpass, encryptKey)) {
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), TranslateT("Wrong password!"));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_NCPAINT, 0, 0);
break;
diff --git a/plugins/Dbx_mmap_SA/security.c b/plugins/Dbx_mmap_SA/security.c
index 92a82a4bfe..f4b9b06004 100644
--- a/plugins/Dbx_mmap_SA/security.c
+++ b/plugins/Dbx_mmap_SA/security.c
@@ -59,7 +59,7 @@ void InitSecurity()
}
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
}
@@ -78,7 +78,7 @@ void UnloadSecurity()
void EncoderInit()
{
- if(!bEncoding) return;
+ if (!bEncoding) return;
encryptKey[encryptKeyLength] = 0;
key = CryptoEngine->GenerateKey(encryptKey);
@@ -88,7 +88,7 @@ void EncodeCopyMemory(void * dst, void * src, size_t size )
{
memcpy(dst, src, size);
- if(!bEncoding)
+ if (!bEncoding)
return;
CryptoEngine->EncryptMem(dst, (int)size, key);
@@ -98,7 +98,7 @@ void DecodeCopyMemory(void * dst, void * src, size_t size )
{
memcpy(dst, src, size);
- if(!bEncoding)
+ if (!bEncoding)
return;
CryptoEngine->DecryptMem(dst, (int)size, key);
@@ -152,14 +152,14 @@ int CheckPassword(WORD checkWord, char * szDBName)
{
int i;
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(dbHeader.cryptorUID == Modules[i]->cryptor->uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
MessageBoxA(0, "Sorry, but your database encrypted with unknown module", "Error", MB_OK);
bCheckingPass = 0;
return 0;
@@ -208,14 +208,14 @@ int SelectEncoder()
}
else{
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(Modules[i]->cryptor->uid == uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
MessageBox(0, TranslateT("Crypto module hasn't been chosen, using first one found"), TranslateT("Notice"), MB_OK);
DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", Modules[0]->cryptor->uid);
CryptoEngine = Modules[0]->cryptor;
@@ -302,14 +302,14 @@ void EncryptDB()
return;
}
- if(SelectEncoder()){
+ if(SelectEncoder()) {
return;
}
bEncProcess = 1;
action = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_NEWPASS), NULL, (DLGPROC)DlgStdNewPass, (LPARAM)NULL);
- if(action != IDOK || !strlen(encryptKey)){
+ if(action != IDOK || !strlen(encryptKey)) {
bEncProcess = 0;
DBWriteContactSettingByte(NULL, "SecureMMAP", "CryptoModule", 0);
return;
@@ -336,7 +336,7 @@ void DecryptDB()
char oldKey[255];
strcpy(oldKey, encryptKey);
- if(!CheckPassword(dbHeader.checkWord, Translate("current database"))){strcpy(encryptKey, oldKey); encryptKeyLength = strlen(oldKey); return;}
+ if (!CheckPassword(dbHeader.checkWord, Translate("current database"))){strcpy(encryptKey, oldKey); encryptKeyLength = strlen(oldKey); return;}
WritePlainHeader();