summaryrefslogtreecommitdiff
path: root/plugins/Db_autobackups/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:14 +0300
commit477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch)
tree247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/Db_autobackups/src
parent9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff)
all another C++'11 iterators
Diffstat (limited to 'plugins/Db_autobackups/src')
-rw-r--r--plugins/Db_autobackups/src/zip.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/Db_autobackups/src/zip.cpp b/plugins/Db_autobackups/src/zip.cpp
index c4a2b145f1..c0c7e08c43 100644
--- a/plugins/Db_autobackups/src/zip.cpp
+++ b/plugins/Db_autobackups/src/zip.cpp
@@ -9,17 +9,14 @@ int CreateZipFile(const char *szDestPath, OBJLIST<ZipFile> &lstFiles, const std:
zip_fileinfo fi = { 0 };
int ret = 0;
- for (int i = 0; i < lstFiles.getCount(); i++)
- {
+ for (int i = 0; i < lstFiles.getCount(); i++) {
ZipFile &zf = lstFiles[i];
HANDLE hSrcFile = CreateFileA(zf.sPath.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
- if (hSrcFile != INVALID_HANDLE_VALUE)
- {
+ if (hSrcFile != INVALID_HANDLE_VALUE) {
int iOpenRes = zipOpenNewFileInZip(hZip, zf.sZipPath.c_str(), &fi, nullptr, 0, nullptr, 0, "", Z_DEFLATED, Z_BEST_COMPRESSION);
- if (iOpenRes == ZIP_OK)
- {
+ if (iOpenRes == ZIP_OK) {
DWORD dwRead;
BYTE buf[0x40000];
@@ -27,17 +24,15 @@ int CreateZipFile(const char *szDestPath, OBJLIST<ZipFile> &lstFiles, const std:
zipCloseFileInZip(hZip);
CloseHandle(hSrcFile);
- if (!fnCallback(i))
- {
+ if (!fnCallback(i)) {
ret = 3;
break;
}
}
- else
- CloseHandle(hSrcFile);
+ else CloseHandle(hSrcFile);
}
}
zipClose(hZip, CMStringA(FORMAT, Translate("Miranda NG [%s] database backup"), g_szMirVer));
return ret;
-} \ No newline at end of file
+}