summaryrefslogtreecommitdiff
path: root/zen
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-07-10 20:36:59 +0000
committerB Stack <bgstack15@gmail.com>2019-07-10 20:36:59 +0000
commitb3eda3ab537804cfa07cc257944b6fc69bec59a8 (patch)
treecc720d69d3ca68b64ed0aa79438177b6953469a1 /zen
parentMerge branch '10.12' into 'master' (diff)
parent10.13 (diff)
downloadFreeFileSync-b3eda3ab537804cfa07cc257944b6fc69bec59a8.tar.gz
FreeFileSync-b3eda3ab537804cfa07cc257944b6fc69bec59a8.tar.bz2
FreeFileSync-b3eda3ab537804cfa07cc257944b6fc69bec59a8.zip
Merge branch '10.13' into 'master'10.13
10.13 See merge request opensource-tracking/FreeFileSync!10
Diffstat (limited to 'zen')
-rw-r--r--zen/file_access.cpp19
-rw-r--r--zen/file_io.h2
-rw-r--r--zen/globals.h2
-rw-r--r--zen/thread.h2
-rw-r--r--zen/zstring.h4
5 files changed, 3 insertions, 26 deletions
diff --git a/zen/file_access.cpp b/zen/file_access.cpp
index 8ac9eb3b..483d4b01 100644
--- a/zen/file_access.cpp
+++ b/zen/file_access.cpp
@@ -360,25 +360,6 @@ void zen::moveAndRenameItem(const Zstring& pathFrom, const Zstring& pathTo, bool
}
catch (ErrorTargetExisting&)
{
-#if 0 //"Work around pen drive failing to change file name case" => enable if needed: https://freefilesync.org/forum/viewtopic.php?t=4279
- const Zstring fileNameSrc = afterLast (pathFrom, FILE_NAME_SEPARATOR, IF_MISSING_RETURN_ALL);
- const Zstring fileNameTrg = afterLast (pathTo, FILE_NAME_SEPARATOR, IF_MISSING_RETURN_ALL);
- const Zstring parentPathSrc = beforeLast(pathFrom, FILE_NAME_SEPARATOR, IF_MISSING_RETURN_NONE);
- const Zstring parentPathTrg = beforeLast(pathTo, FILE_NAME_SEPARATOR, IF_MISSING_RETURN_NONE);
- //some (broken) devices may fail to rename case directly:
- if (equalNativePath(parentPathSrc, parentPathTrg))
- {
- if (fileNameSrc == fileNameTrg)
- return; //non-sensical request
-
- const Zstring tempFilePath = getTemporaryPath8Dot3(pathFrom); //throw FileError
- moveAndRenameFileSub(pathFrom, tempFilePath); //throw FileError, (ErrorMoveUnsupported), ErrorTargetExisting
- ZEN_ON_SCOPE_FAIL(moveAndRenameFileSub(tempFilePath, pathFrom)); //"try" our best to be "atomic" :>
- moveAndRenameFileSub(tempFilePath, pathTo); //throw FileError, (ErrorMoveUnsupported), ErrorTargetExisting
- return;
- }
-#endif
-
throw;
}
}
diff --git a/zen/file_io.h b/zen/file_io.h
index cf5ecc73..54bde5aa 100644
--- a/zen/file_io.h
+++ b/zen/file_io.h
@@ -31,7 +31,7 @@ public:
FileHandle getHandle() { return fileHandle_; }
- //Windows: use 64kB ?? https://technet.microsoft.com/en-us/library/cc938632
+ //Windows: use 64kB ?? https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938632%28v=technet.10%29
//Linux: use st_blksize?
//macOS: use f_iosize?
static size_t getBlockSize() { return 128 * 1024; };
diff --git a/zen/globals.h b/zen/globals.h
index 024147fa..e0bfd362 100644
--- a/zen/globals.h
+++ b/zen/globals.h
@@ -17,7 +17,7 @@ namespace zen
/*
Solve static destruction order fiasco by providing shared ownership and serialized access to global variables
-=>there may be accesses to "Global<T>::get()" during process shutdown e.g. _("") used by message in debug_minidump.cpp or by some detached thread assembling an error message!
+=> there may be accesses to "Global<T>::get()" during process shutdown e.g. _("") used by message in debug_minidump.cpp or by some detached thread assembling an error message!
=> use trivially-destructible POD only!!!
ATTENTION: function-static globals have the compiler generate "magic statics" == compiler-genenerated locking code which will crash or leak memory when accessed after global is "dead"
diff --git a/zen/thread.h b/zen/thread.h
index 52b85d7f..791aec67 100644
--- a/zen/thread.h
+++ b/zen/thread.h
@@ -75,7 +75,7 @@ Example:
Zstring dirPath = ...
auto ft = zen::runAsync([=]{ return zen::dirExists(dirPath); });
if (ft.wait_for(std::chrono::milliseconds(200)) == std::future_status::ready && ft.get())
- //dir exising
+ //dir existing
*/
template <class Function>
auto runAsync(Function&& fun);
diff --git a/zen/zstring.h b/zen/zstring.h
index d5a8c29b..f24e4299 100644
--- a/zen/zstring.h
+++ b/zen/zstring.h
@@ -148,8 +148,4 @@ const wchar_t MULT_SIGN = L'\u00D7'; //fancy "x"
//ZEN macro consistency checks:
-#if defined ZEN_WIN_PRE_VISTA || defined ZEN_WIN_VISTA_AND_LATER
- #error these macros are obsolete!
-#endif
-
#endif //ZSTRING_H_73425873425789
bgstack15