diff options
Diffstat (limited to 'plugins/Updater')
-rw-r--r-- | plugins/Updater/allocations.h | 6 | ||||
-rw-r--r-- | plugins/Updater/bzip2-1.0.3/bzlib.c | 2 | ||||
-rw-r--r-- | plugins/Updater/bzip2-1.0.3/dlltest.c | 20 | ||||
-rw-r--r-- | plugins/Updater/conf_comp_dialog.cpp | 6 | ||||
-rw-r--r-- | plugins/Updater/conf_dialog.cpp | 16 | ||||
-rw-r--r-- | plugins/Updater/extern.cpp | 10 | ||||
-rw-r--r-- | plugins/Updater/options.cpp | 14 | ||||
-rw-r--r-- | plugins/Updater/scan.cpp | 6 | ||||
-rw-r--r-- | plugins/Updater/services.cpp | 14 | ||||
-rw-r--r-- | plugins/Updater/socket.cpp | 2 | ||||
-rw-r--r-- | plugins/Updater/updater_10.vcxproj | 1 | ||||
-rw-r--r-- | plugins/Updater/updater_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | plugins/Updater/utils.cpp | 4 | ||||
-rw-r--r-- | plugins/Updater/xmldata.cpp | 14 | ||||
-rw-r--r-- | plugins/Updater/zbin/minizip/minizip.c | 8 | ||||
-rw-r--r-- | plugins/Updater/zbin/minizip/unzip.c | 2 | ||||
-rw-r--r-- | plugins/Updater/zbin/minizip/zip.c | 6 |
17 files changed, 65 insertions, 69 deletions
diff --git a/plugins/Updater/allocations.h b/plugins/Updater/allocations.h index 842d7daf01..719b42383a 100644 --- a/plugins/Updater/allocations.h +++ b/plugins/Updater/allocations.h @@ -40,14 +40,14 @@ __inline static void *safe_alloc(size_t bytes) { }
__inline static char *safe_strdup(const char *s) {
- if(!s) return 0;
+ if (!s) return 0;
char *ret = _strdup(s);
allocations.push_back(ret);
return ret;
}
__inline static wchar_t *safe_wstrdup(const wchar_t *s) {
- if(!s) return 0;
+ if (!s) return 0;
wchar_t *ret = _wcsdup(s);
allocations.push_back(ret);
return ret;
@@ -60,7 +60,7 @@ __inline static wchar_t *safe_wstrdup(const wchar_t *s) { #endif
__inline static BYTE *safe_bytedup(BYTE *bytes, int size) {
- if(!bytes || size == 0) return 0;
+ if (!bytes || size == 0) return 0;
BYTE *ret = (BYTE *)malloc(size + 1);
memcpy(ret, bytes, size);
diff --git a/plugins/Updater/bzip2-1.0.3/bzlib.c b/plugins/Updater/bzip2-1.0.3/bzlib.c index bd358a793b..a3015c2533 100644 --- a/plugins/Updater/bzip2-1.0.3/bzlib.c +++ b/plugins/Updater/bzip2-1.0.3/bzlib.c @@ -1518,7 +1518,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b) if (b==NULL) {return;} fp = ((bzFile *)b)->handle; - if(((bzFile*)b)->writing){ + if (((bzFile*)b)->writing){ BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); if(bzerr != BZ_OK){ BZ2_bzWriteClose(NULL,b,1,NULL,NULL); diff --git a/plugins/Updater/bzip2-1.0.3/dlltest.c b/plugins/Updater/bzip2-1.0.3/dlltest.c index 03fa14620e..b6e8339226 100644 --- a/plugins/Updater/bzip2-1.0.3/dlltest.c +++ b/plugins/Updater/bzip2-1.0.3/dlltest.c @@ -82,13 +82,13 @@ int main(int argc,char *argv[]) BZ2_LIBNAME, BZ2_bzlibVersion() );
#endif
while(++argv,--argc){
- if(**argv =='-' || **argv=='/'){
+ if (**argv =='-' || **argv=='/') {
char *p;
- for(p=*argv+1;*p;p++){
- if(*p=='d'){
+ for(p=*argv+1;*p;p++) {
+ if (*p=='d') {
decompress = 1;
- }else if('1'<=*p && *p<='9'){
+ }else if ('1'<=*p && *p<='9') {
level = *p - '0';
}else{
usage();
@@ -121,7 +121,7 @@ int main(int argc,char *argv[]) FILE *fp_w = NULL;
if(fn_w){
- if((fp_w = fopen(fn_w,"wb"))==NULL){
+ if ((fp_w = fopen(fn_w,"wb"))==NULL){
printf("can't open [%s]\n",fn_w);
perror("reason:");
exit(1);
@@ -129,8 +129,8 @@ int main(int argc,char *argv[]) }else{
fp_w = stdout;
}
- if((fn_r == NULL && (BZ2fp_r = BZ2_bzdopen(fileno(stdin),"rb"))==NULL)
- || (fn_r != NULL && (BZ2fp_r = BZ2_bzopen(fn_r,"rb"))==NULL)){
+ if ((fn_r == NULL && (BZ2fp_r = BZ2_bzdopen(fileno(stdin),"rb"))==NULL)
+ || (fn_r != NULL && (BZ2fp_r = BZ2_bzopen(fn_r,"rb"))==NULL)) {
printf("can't bz2openstream\n");
exit(1);
}
@@ -144,7 +144,7 @@ int main(int argc,char *argv[]) FILE *fp_r = NULL;
if(fn_r){
- if((fp_r = fopen(fn_r,"rb"))==NULL){
+ if ((fp_r = fopen(fn_r,"rb"))==NULL){
printf("can't open [%s]\n",fn_r);
perror("reason:");
exit(1);
@@ -156,8 +156,8 @@ int main(int argc,char *argv[]) mode[1] = '0' + level;
mode[2] = '\0';
- if((fn_w == NULL && (BZ2fp_w = BZ2_bzdopen(fileno(stdout),mode))==NULL)
- || (fn_w !=NULL && (BZ2fp_w = BZ2_bzopen(fn_w,mode))==NULL)){
+ if ((fn_w == NULL && (BZ2fp_w = BZ2_bzdopen(fileno(stdout),mode))==NULL)
+ || (fn_w !=NULL && (BZ2fp_w = BZ2_bzopen(fn_w,mode))==NULL)) {
printf("can't bz2openstream\n");
exit(1);
}
diff --git a/plugins/Updater/conf_comp_dialog.cpp b/plugins/Updater/conf_comp_dialog.cpp index b2ab25227a..7f7abca925 100644 --- a/plugins/Updater/conf_comp_dialog.cpp +++ b/plugins/Updater/conf_comp_dialog.cpp @@ -90,14 +90,14 @@ INT_PTR CALLBACK DlgProcConfirmComponents(HWND hwndDlg, UINT msg, WPARAM wParam, return TRUE;
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS)) {
+ if (((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS)) {
switch (((LPNMHDR) lParam)->code) {
case LVN_ITEMCHANGED:
if(GetWindowLongPtr(hwndDlg, GWLP_USERDATA)) {
NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
+ if ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
int size = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS));
bool enableOk = false;
@@ -172,7 +172,7 @@ INT_PTR CALLBACK DlgProcConfirmComponents(HWND hwndDlg, UINT msg, WPARAM wParam, int size = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS));
//bool enableOk = false;
for(int i = 0; i < size; i++) {
- if(!ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS), i)) {
+ if (!ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS), i)) {
// delete file
ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LIST_COMPONENTS), i, 0, p, MAX_PATH - path_len);
DeleteFile(fname_buff);
diff --git a/plugins/Updater/conf_dialog.cpp b/plugins/Updater/conf_dialog.cpp index a284952230..6eedb809b3 100644 --- a/plugins/Updater/conf_dialog.cpp +++ b/plugins/Updater/conf_dialog.cpp @@ -138,7 +138,7 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->hwndFrom == hwndList) {
+ if (((LPNMHDR) lParam)->hwndFrom == hwndList) {
switch (((LPNMHDR) lParam)->code) {
case LVN_ITEMCHANGED:
@@ -153,13 +153,13 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_GetItem(hwndList, &lvI);
//if(IsWindowVisible(hwndList) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)) {
- if((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
+ if ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) {
((UpdateInternal *)lvI.lParam)->update_options.enabled = ListView_GetCheckState(hwndList, nmlv->iItem) != 0;
char stored_setting[256];
mir_snprintf(stored_setting, 256, "DisabledVer%s", ((UpdateInternal *)lvI.lParam)->update.szComponentName);
- if(((UpdateInternal *)lvI.lParam)->update_options.enabled)
+ if (((UpdateInternal *)lvI.lParam)->update_options.enabled)
DBDeleteContactSetting(0, "Updater", stored_setting); // user has re-enabled update to this version - remove setting from db
else
DBWriteContactSettingString(0, "Updater", stored_setting, ((UpdateInternal *)lvI.lParam)->newVersion);
@@ -178,7 +178,7 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP EnableWindow(hwOk, enableOk ? TRUE : FALSE);
}
if(nmlv->uNewState & LVIS_SELECTED) {
- if((!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1)
+ if ((!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1)
|| (((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL))
{
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_CHANGELOG), TRUE);
@@ -202,10 +202,10 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP MessageBox(0, _T("LVN_GETDISPINFO (0)"), _T("msg"), MB_OK);
break;
case 1:
- ((NMLVDISPINFO *)lParam)->item.pszText = Translate( u->newVersion );
+ ((NMLVDISPINFO *)lParam)->item.pszText = TranslateTS( _A2T(u->newVersion));
break;
case 2:
- ((NMLVDISPINFO *)lParam)->item.pszText = Translate((char *)u->update.pbVersion);
+ ((NMLVDISPINFO *)lParam)->item.pszText = TranslateTS( _A2T((char *)u->update.pbVersion));
break;
}
}
@@ -231,10 +231,10 @@ INT_PTR CALLBACK DlgProcConfirm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvI.mask = LVIF_PARAM;
ListView_GetItem(hwndList, &lvI);
- if(!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1) {
+ if (!((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->file_id != -1) {
sprintf(url, MIM_CHANGELOG_URL_PREFIX "%d", ((UpdateInternal *)lvI.lParam)->file_id);
CallService(MS_UTILS_OPENURL, (WPARAM)TRUE, (LPARAM)url);
- } else if(((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL) {
+ } else if (((UpdateInternal *)lvI.lParam)->update_options.use_beta && ((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL) {
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)((UpdateInternal *)lvI.lParam)->update.szBetaChangelogURL);
}
diff --git a/plugins/Updater/extern.cpp b/plugins/Updater/extern.cpp index d33e0c2132..500c11c9de 100644 --- a/plugins/Updater/extern.cpp +++ b/plugins/Updater/extern.cpp @@ -87,7 +87,7 @@ int ExternProcess(bool restart) mir_free(plugins_folder);
/*
- if(!CallService(MS_SYSTEM_OKTOEXIT,0,0)) {
+ if (!CallService(MS_SYSTEM_OKTOEXIT,0,0)) {
DeleteFile(data_filename);
MessageBox(0, TranslateT("Miranda's not 'OK TO EXIT'."), TranslateT("Error"), MB_OK | MB_ICONERROR);
return;
@@ -202,7 +202,7 @@ void MoveFiles(HANDLE hLogFile, TCHAR *src_folder, TCHAR *dst_folder, TCHAR *bac {
// move files from src_folder to dst_folder
- if(!src_folder || _tcslen(src_folder) == 0) {
+ if (!src_folder || _tcslen(src_folder) == 0) {
MessageBox(0, _T("Your 'temporary files' folder is set to NULL. Install aborted."), _T("Updater Error"), MB_OK | MB_ICONERROR);
return;
}
@@ -251,7 +251,7 @@ void MoveFiles(HANDLE hLogFile, TCHAR *src_folder, TCHAR *dst_folder, TCHAR *bac {
// exception for langpack files - move to root_folder
// exception for dbtool.exe (e.g. translated) - move to root_folder
- if((_tcsnicmp(findData.cFileName, _T("dbtool.exe"), _tcslen(_T("dbtool.exe"))) == 0)
+ if ((_tcsnicmp(findData.cFileName, _T("dbtool.exe"), _tcslen(_T("dbtool.exe"))) == 0)
|| (_tcsnicmp(findData.cFileName, _T("langpack_"), _tcslen(_T("langpack_"))) == 0))
{
_sntprintf(szNewFileName, SIZEOF(szNewFileName), _T("%s\\%s"), root_folder, findData.cFileName);
@@ -271,7 +271,7 @@ void MoveFiles(HANDLE hLogFile, TCHAR *src_folder, TCHAR *dst_folder, TCHAR *bac move_file = true;
DeleteFile(szBackupFileName);
- if(!MoveFile(szNewFileName, szBackupFileName))
+ if (!MoveFile(szNewFileName, szBackupFileName))
{
// MessageBox(0, szNewFileName, __T("Could not backup!"), MB_OK | MB_ICONWARNING);
}
@@ -433,7 +433,7 @@ void CALLBACK ExternalUpdate(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmdLine, if (res == idContinue) {
//if the user chooses Continue then kill the application
TerminateProcess(hMiranda, 1);
- if((exitStatus = WaitForSingleObjectEx(hMiranda, 5 * 1000, FALSE)) == WAIT_TIMEOUT) {
+ if ((exitStatus = WaitForSingleObjectEx(hMiranda, 5 * 1000, FALSE)) == WAIT_TIMEOUT) {
//hMiranda = OpenProcess(SYNCHRONIZE, FALSE, mpi);
//if(hMiranda) {
//CloseHandle(hMiranda);
diff --git a/plugins/Updater/options.cpp b/plugins/Updater/options.cpp index 7315ca2858..22ace012a6 100644 --- a/plugins/Updater/options.cpp +++ b/plugins/Updater/options.cpp @@ -67,7 +67,7 @@ static int EnumerateFuncFillList(char *szComponentName, UpdateOptions *update_op lvI.mask = LVIF_TEXT;
lvI.iSubItem = 1;
//lvI.pszText = LPSTR_TEXTCALLBACK;
- if(((int)lvI.lParam & 4) == 4) {
+ if (((int)lvI.lParam & 4) == 4) {
lvI.pszText = (((int)lvI.lParam & 2) == 2 ? TranslateT("FORCED") : TranslateT("N/A"));
} else {
lvI.pszText = (((int)lvI.lParam & 2) == 2 ? TranslateT("TRUE") : TranslateT("FALSE"));
@@ -94,7 +94,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
CheckDlgButton(hwndDlg, IDC_CHK_ONCE, options.check_once);
CheckDlgButton(hwndDlg, IDC_CHK_DAILY, options.check_daily);
- if(!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
+ if (!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
HWND hw = GetDlgItem(hwndDlg, IDC_CHK_NOCONFIDLE);
EnableWindow(hw, (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAILY) ? TRUE : FALSE));
}
@@ -219,7 +219,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
return TRUE;
case IDC_CHK_DAILY:
- if(!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
+ if (!ServiceExists(MS_TRIGGER_REGISTERACTION)) {
HWND hw = GetDlgItem(hwndDlg, IDC_CHK_NOCONFIDLE);
EnableWindow(hw, (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAILY) ? TRUE : FALSE));
}
@@ -253,7 +253,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break;
case WM_NOTIFY:
- if(((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LST_REGISTERED)) {
+ if (((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LST_REGISTERED)) {
switch (((LPNMHDR) lParam)->code) {
case NM_CLICK:
if (((LPNMLISTVIEW)lParam)->iSubItem == 1) {
@@ -262,13 +262,13 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR lvi.iItem = ((LPNMLISTVIEW)lParam)->iItem;
lvi.iSubItem = 0;
SendMessage(GetDlgItem(hwndDlg, IDC_LST_REGISTERED), LVM_GETITEM, 0, (LPARAM)&lvi);
- if(((int)lvi.lParam & 4) == 0) {
+ if (((int)lvi.lParam & 4) == 0) {
lvi.lParam ^= 2;
ListView_SetItem(GetDlgItem(hwndDlg, IDC_LST_REGISTERED), &lvi);
lvi.iSubItem = 1;
lvi.mask = LVIF_TEXT;
- if(((int)lvi.lParam & 4) == 4) {
+ if (((int)lvi.lParam & 4) == 4) {
lvi.pszText = (((int)lvi.lParam & 2) == 2 ? TranslateT("FORCED") : TranslateT("N/A"));
} else {
lvi.pszText = (((int)lvi.lParam & 2) == 2 ? TranslateT("TRUE") : TranslateT("FALSE"));
@@ -300,7 +300,7 @@ static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR MessageBox(0, _T("LVN_GETDISPINFO (0)"), _T("msg"), MB_OK);
break;
case 1:
- if(((int)lvi.lParam & 4) == 4) {
+ if (((int)lvi.lParam & 4) == 4) {
((NMLVDISPINFO *)lParam)->item.pszText = ((lvi.lParam & 2) == 2 ? TranslateT("FORCED") : TranslateT("N/A"));
((NMLVDISPINFO *)lParam)->item.cchTextMax = (int)_tcslen(((NMLVDISPINFO *)lParam)->item.pszText);
} else {
diff --git a/plugins/Updater/scan.cpp b/plugins/Updater/scan.cpp index ac068ca347..ad8fa165e2 100644 --- a/plugins/Updater/scan.cpp +++ b/plugins/Updater/scan.cpp @@ -96,7 +96,7 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list) {
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
- if((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
+ if ((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
{
// *** This is a dodgy and unfair hack...
// In order to disable new plugins that may be unintentionally installed with an update,
@@ -204,7 +204,7 @@ bool GetLangpackData(const TCHAR *filename, LangpackData *ld) void ScanLangpacks(FilenameMap *fn_map, UpdateList *update_list)
{
- if(!XMLDataAvailable(MC_LOCALIZATION)) return;
+ if (!XMLDataAvailable(MC_LOCALIZATION)) return;
TCHAR mir_folder[MAX_PATH], langpack_path[MAX_PATH], *langpack_name;
@@ -276,7 +276,7 @@ bool RearrangeDllsWorker(char *shortName, StrList &filenames, TCHAR *basedir) {
dll_info_func = (Miranda_Plugin_Info)GetProcAddress(hModule, "MirandaPluginInfo");
dll_info_func_ex = (Miranda_Plugin_Info_Ex)GetProcAddress(hModule, "MirandaPluginInfoEx");
- if((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
+ if ((dll_info_func_ex && (pluginInfo = (PLUGININFO *)dll_info_func_ex(mirandaVersion))) || (dll_info_func && (pluginInfo = dll_info_func(mirandaVersion))))
{
bool found = !_stricmp(pluginInfo->shortName, shortName);
if (!found)
diff --git a/plugins/Updater/services.cpp b/plugins/Updater/services.cpp index 61e87c3665..8d3883b895 100644 --- a/plugins/Updater/services.cpp +++ b/plugins/Updater/services.cpp @@ -56,7 +56,7 @@ bool DownloadUpdates(UpdateList &todo, FilenameMap *map, bool dlls_only) { mir_snprintf(stored_setting, SIZEOF(stored_setting), "DisabledVer%s", todo[index].update.szComponentName);
DBVARIANT dbv;
bool download = todo[index].update_options.enabled;
- if(!DBGetContactSettingString(0, "Updater", stored_setting, &dbv))
+ if (!DBGetContactSettingString(0, "Updater", stored_setting, &dbv))
{
if(dbv.pszVal && strcmp(dbv.pszVal, todo[index].newVersion) == 0)
download = false;
@@ -129,7 +129,7 @@ bool DownloadUpdates(UpdateList &todo, FilenameMap *map, bool dlls_only) { //if(hwndPop) PostMessage(hwndPop, WMU_CLOSEPOP, 0, 0);
if (hwndPop) SendMessage(hwndPop, WMU_CLOSEPOP, 0, 0);
- if(!a_download_succeeded)
+ if (!a_download_succeeded)
{
for(int i = 0; i < todo.getCount(); ++i)
free(todo[i].newVersion);
@@ -179,7 +179,7 @@ void CheckForUpdatesWorker(void *param) if (checking) return;
/*
// this check doesn't work on some systems - not sure which or why
- if(!(GetSystemMetrics(SM_NETWORK) & 1)) {
+ if (!(GetSystemMetrics(SM_NETWORK) & 1)) {
ShowError(TranslateT("No network - aborting update check"));
NLog("worker thread aborting - no network");
return 1; // no network
@@ -231,7 +231,7 @@ void CheckForUpdatesWorker(void *param) ScanLangpacks(&fn_map, &update_list);
}
- if(!use_popup) SendMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Updating component file listing ids"), 0);
+ if (!use_popup) SendMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Updating component file listing ids"), 0);
UpdateFLIDs(update_list);
}
@@ -260,7 +260,7 @@ void CheckForUpdatesWorker(void *param) mir_free(temp_str);
}
- if(!use_popup) {
+ if (!use_popup) {
SendMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)msg, 0);
SendMessage(hwndProgress, WMU_SETPROGRESS, (WPARAM)(int)(index * 100.0 / count), 0);
} //else if(hwndPop) // disabled - just annoying
@@ -450,7 +450,7 @@ void LoadUpdateOptions(char *szComponentName, UpdateOptions *update_options) { char buff[256];
sprintf(buff, "Enable%s", szComponentName);
update_options->enabled = (DBGetContactSettingByte(0, MODULE, buff, 1) == 1);
- if(!update_options->fixed) {
+ if (!update_options->fixed) {
sprintf(buff, "UseBeta%s", szComponentName);
update_options->use_beta = (DBGetContactSettingByte(0, MODULE, buff, 0) == 1);
}
@@ -460,7 +460,7 @@ void SaveUpdateOptions(char *szComponentName, UpdateOptions *update_options) { char buff[256];
sprintf(buff, "Enable%s", szComponentName);
DBWriteContactSettingByte(0, MODULE, buff, update_options->enabled ? 1 : 0);
- if(!update_options->fixed) {
+ if (!update_options->fixed) {
sprintf(buff, "UseBeta%s", szComponentName);
DBWriteContactSettingByte(0, MODULE, buff, update_options->use_beta ? 1 : 0);
}
diff --git a/plugins/Updater/socket.cpp b/plugins/Updater/socket.cpp index 52a82bd6b1..7b921a42dd 100644 --- a/plugins/Updater/socket.cpp +++ b/plugins/Updater/socket.cpp @@ -15,7 +15,7 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo return false;
// ensure temp_folder exists
- if(!CreatePath(options.temp_folder)) {
+ if (!CreatePath(options.temp_folder)) {
NLogF("GetFile: error creating temp folder, code %u", GetLastError());
return false;
}
diff --git a/plugins/Updater/updater_10.vcxproj b/plugins/Updater/updater_10.vcxproj index 72e9ac10c8..935436291b 100644 --- a/plugins/Updater/updater_10.vcxproj +++ b/plugins/Updater/updater_10.vcxproj @@ -255,7 +255,6 @@ <None Include="ue.ico" />
</ItemGroup>
<ItemGroup>
- <ResourceCompile Include="resource.rc" />
<ResourceCompile Include="updater.rc" />
<ResourceCompile Include="version.rc" />
</ItemGroup>
diff --git a/plugins/Updater/updater_10.vcxproj.filters b/plugins/Updater/updater_10.vcxproj.filters index 7b7157ea9a..99e8f9da46 100644 --- a/plugins/Updater/updater_10.vcxproj.filters +++ b/plugins/Updater/updater_10.vcxproj.filters @@ -183,9 +183,6 @@ </None>
</ItemGroup>
<ItemGroup>
- <ResourceCompile Include="resource.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
<ResourceCompile Include="updater.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
diff --git a/plugins/Updater/utils.cpp b/plugins/Updater/utils.cpp index cd776782f9..6936a905ae 100644 --- a/plugins/Updater/utils.cpp +++ b/plugins/Updater/utils.cpp @@ -10,12 +10,12 @@ bool VersionFromString(const char *szVer, DWORD *pdwVer) int digit_count = 0;
while(*p && bytes <= 4 && digit_count <= 3)
{
- if(*p >= '0' && *p <= '9')
+ if (*p >= '0' && *p <= '9')
{
*pdwVer = (*pdwVer & 0xFFFFFF00) + (*pdwVer & 0xFF) * 10 + (*p - '0');
digit_count++;
}
- else if(*p == '.')
+ else if (*p == '.')
{
*pdwVer = *pdwVer << 8;
bytes++;
diff --git a/plugins/Updater/xmldata.cpp b/plugins/Updater/xmldata.cpp index 5a7aed440b..3bcf15f24c 100644 --- a/plugins/Updater/xmldata.cpp +++ b/plugins/Updater/xmldata.cpp @@ -126,7 +126,7 @@ bool SaveXMLData(const Category cat) { options.data_folder, (ts = GetTString(category_files[cat])));
mir_free(ts);
- if(!CreatePath(options.data_folder)) {
+ if (!CreatePath(options.data_folder)) {
return false;
}
@@ -144,7 +144,7 @@ bool SaveXMLData(const Category cat) { return false;
}
-extern "C" void bz_internal_error ( int errcode ){}
+extern "C" void bz_internal_error ( int errcode ) {}
bool bz2_decompress_xml(char *in_data, int in_data_length, BYTE **pDat, int *data_length) {
const int BLOCKSIZE = 1024 * 100;
@@ -238,7 +238,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec strcat(buff, category_files[cat]);
cgs.szSetting = buff;
cgs.pValue = &dbv;
- if(!CallService(MS_DB_CONTACT_GETSETTING, 0, (LPARAM)&cgs)) {
+ if (!CallService(MS_DB_CONTACT_GETSETTING, 0, (LPARAM)&cgs)) {
req.headersCount = 1;
req.headers = &etag_hdr;
etag_hdr.szName = "If-None-Match";
@@ -250,7 +250,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec req.cbSize = sizeof(req);
req.requestType = REQUEST_GET;
char URL[MAX_PATH];
- if(!redirect_url) {
+ if (!redirect_url) {
strcpy(URL, MIM_BACKEND_URL_PREFIX);
strcat(URL, category_files[cat]);
strcat(URL, ".bz2");
@@ -313,7 +313,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec }
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
resp = 0;
- if(!ret) return LoadOldXMLData(cat, false);
+ if (!ret) return LoadOldXMLData(cat, false);
return ret;
@@ -331,7 +331,7 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec // resp->resultCode == 200
hNetlibHttp = resp->nlc;
- if(!bz2_decompress_xml(resp->pData, resp->dataLength, &pData[cat], &dataLength[cat])) {
+ if (!bz2_decompress_xml(resp->pData, resp->dataLength, &pData[cat], &dataLength[cat])) {
ShowError(TranslateT("Failed to decompress XML data"));
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
resp = 0;
@@ -396,7 +396,7 @@ bool VersionLess(const char *current, const char *potential) { const char *FindVersion(int file_id, BYTE *pbVersionBytes, int cpbVersionBytes, const Category cat) {
- if(!doc[cat]) return 0;
+ if (!doc[cat]) return 0;
char version_string[128];
strncpy(version_string, (char *)pbVersionBytes, cpbVersionBytes);
diff --git a/plugins/Updater/zbin/minizip/minizip.c b/plugins/Updater/zbin/minizip/minizip.c index 7a4fa5a643..d979e14bf2 100644 --- a/plugins/Updater/zbin/minizip/minizip.c +++ b/plugins/Updater/zbin/minizip/minizip.c @@ -417,18 +417,18 @@ int main(argc,argv) } /*should the zip file contain any path at all?*/ - if( opt_exclude_path ) + if ( opt_exclude_path ) { const char *tmpptr; const char *lastslash = 0; - for( tmpptr = savefilenameinzip; *tmpptr; tmpptr++) + for ( tmpptr = savefilenameinzip; *tmpptr; tmpptr++) { - if( *tmpptr == '\\' || *tmpptr == '/') + if ( *tmpptr == '\\' || *tmpptr == '/') { lastslash = tmpptr; } } - if( lastslash != NULL ) + if ( lastslash != NULL ) { savefilenameinzip = lastslash+1; // base filename follows last slash. } diff --git a/plugins/Updater/zbin/minizip/unzip.c b/plugins/Updater/zbin/minizip/unzip.c index 44f9876160..2174e2f1c5 100644 --- a/plugins/Updater/zbin/minizip/unzip.c +++ b/plugins/Updater/zbin/minizip/unzip.c @@ -753,7 +753,7 @@ local unzFile unzOpenInternal (const void *path, s=(unz64_s*)ALLOC(sizeof(unz64_s)); - if( s != NULL) + if ( s != NULL) { *s=us; unzGoToFirstFile((unzFile)s); diff --git a/plugins/Updater/zbin/minizip/zip.c b/plugins/Updater/zbin/minizip/zip.c index 3c34fc8bd4..f672594071 100644 --- a/plugins/Updater/zbin/minizip/zip.c +++ b/plugins/Updater/zbin/minizip/zip.c @@ -1587,7 +1587,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s zi->ci.stream_initialised = 0; } #ifdef HAVE_BZIP2 - else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) { int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream); if (err==ZIP_OK) @@ -1650,7 +1650,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s { char* p = NULL; - if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree) + if ((uLong)(datasize + 4) > zi->ci.size_centralExtraFree) { // we can not write more data to the buffer that we have room for. return ZIP_BADZIPFILE; @@ -1967,7 +1967,7 @@ extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHe header = *(short*)p; dataSize = *(((short*)p)+1); - if( header == sHeader ) // Header found. + if ( header == sHeader ) // Header found. { p += dataSize + 4; // skip it. do not copy to temp buffer } |