diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:32:48 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:32:48 +0200 |
commit | 1249b507dd7b3ada7066b129d1a6552a90836084 (patch) | |
tree | dbe7be194c5b4ee57bd14198821ac1959b577262 /zen | |
parent | 6.3 (diff) | |
download | FreeFileSync-1249b507dd7b3ada7066b129d1a6552a90836084.tar.gz FreeFileSync-1249b507dd7b3ada7066b129d1a6552a90836084.tar.bz2 FreeFileSync-1249b507dd7b3ada7066b129d1a6552a90836084.zip |
6.4
Diffstat (limited to 'zen')
-rw-r--r-- | zen/file_handling.cpp | 5 | ||||
-rw-r--r-- | zen/string_base.h | 14 | ||||
-rw-r--r-- | zen/thread.h | 2 | ||||
-rw-r--r-- | zen/zstring.cpp | 4 |
4 files changed, 12 insertions, 13 deletions
diff --git a/zen/file_handling.cpp b/zen/file_handling.cpp index b1b2e026..87ffee62 100644 --- a/zen/file_handling.cpp +++ b/zen/file_handling.cpp @@ -1172,11 +1172,10 @@ void makeDirectoryRecursively(const Zstring& directory) //FileError, ErrorTarget { makeDirectoryRecursively(dirParent); //throw FileError, (ErrorTargetExisting) } - catch (const ErrorTargetExisting& e) { throw FileError(e.toString()); } - //yes it's pathological, but we do not want to emit ErrorTargetExisting when creating parent directories! + catch (const ErrorTargetExisting&) { /*parent directory created externally in the meantime? => NOT AN ERROR*/ } //now try again... - makeDirectoryPlain(directory, Zstring(), false); //throw FileError, ErrorTargetExisting, (ErrorTargetPathMissing) + makeDirectoryPlain(directory, Zstring(), false); //throw FileError, (ErrorTargetExisting), (ErrorTargetPathMissing) return; } throw; diff --git a/zen/string_base.h b/zen/string_base.h index 23cfcdf0..2d16e669 100644 --- a/zen/string_base.h +++ b/zen/string_base.h @@ -381,7 +381,7 @@ template <class Char, template <class, class> class SP, class AP> inline size_t Zbase<Char, SP, AP>::find(const Zbase& str, size_t pos) const { assert(pos <= length()); - const size_t len = length(); + const size_t len = length(); const Char* thisEnd = begin() + len; //respect embedded 0 const Char* it = std::search(begin() + std::min(pos, len), thisEnd, str.begin(), str.end()); @@ -393,7 +393,7 @@ template <class Char, template <class, class> class SP, class AP> inline size_t Zbase<Char, SP, AP>::find(const Char* str, size_t pos) const { assert(pos <= length()); - const size_t len = length(); + const size_t len = length(); const Char* thisEnd = begin() + len; //respect embedded 0 const Char* it = std::search(begin() + std::min(pos, len), thisEnd, str, str + strLength(str)); @@ -405,9 +405,9 @@ template <class Char, template <class, class> class SP, class AP> inline size_t Zbase<Char, SP, AP>::find(Char ch, size_t pos) const { assert(pos <= length()); - const size_t len = length(); + const size_t len = length(); const Char* thisEnd = begin() + len; //respect embedded 0 - const Char* it = std::find(begin() + std::min(pos, len), thisEnd, ch); + const Char* it = std::find(begin() + std::min(pos, len), thisEnd, ch); return it == thisEnd ? npos : it - begin(); } @@ -416,7 +416,7 @@ template <class Char, template <class, class> class SP, class AP> inline size_t Zbase<Char, SP, AP>::rfind(Char ch, size_t pos) const { assert(pos == npos || pos <= length()); - const size_t len = length(); + const size_t len = length(); const Char* currEnd = begin() + (pos == npos ? len : std::min(pos + 1, len)); const Char* it = find_last(begin(), currEnd, ch); return it == currEnd ? npos : it - begin(); @@ -428,8 +428,8 @@ size_t Zbase<Char, SP, AP>::rfind(const Char* str, size_t pos) const { assert(pos == npos || pos <= length()); const size_t strLen = strLength(str); - const size_t len = length(); - const Char* currEnd = begin() + (pos == npos ? len : std::min(pos + strLen, len)); + const size_t len = length(); + const Char* currEnd = begin() + (pos == npos ? len : std::min(pos + strLen, len)); const Char* it = search_last(begin(), currEnd, str, str + strLen); return it == currEnd ? npos : it - begin(); diff --git a/zen/thread.h b/zen/thread.h index 95cdf074..15ebb3c3 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -164,7 +164,7 @@ public: private: bool jobDone(size_t jobsTotal) const { return result_ || (jobsFinished >= jobsTotal); } //call while locked! - + #ifndef NDEBUG bool returnedResult; #endif diff --git a/zen/zstring.cpp b/zen/zstring.cpp index 8803d83e..3e579b1e 100644 --- a/zen/zstring.cpp +++ b/zen/zstring.cpp @@ -173,9 +173,9 @@ int z_impl::compareFilenamesNoCase(const wchar_t* lhs, const wchar_t* rhs, size_ if (::LCMapString(ZSTRING_INVARIANT_LOCALE, //__in LCID Locale, LCMAP_UPPERCASE, //__in DWORD dwMapFlags, strIn, //__in LPCTSTR lpSrcStr, - static_cast<int>(len), //__in int cchSrc, + static_cast<int>(len), //__in int cchSrc, strOut, //__out LPTSTR lpDestStr, - static_cast<int>(len)) == 0) //__in int cchDest + static_cast<int>(len)) == 0) //__in int cchDest throw std::runtime_error("Error comparing strings (LCMapString)."); }; |