summaryrefslogtreecommitdiffstats
path: root/Source/cmFileLock.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmFileLock.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Source/cmFileLock.cxx')
-rw-r--r--Source/cmFileLock.cxx40
1 files changed, 16 insertions, 24 deletions
diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx
index 0d41c53..828511f 100644
--- a/Source/cmFileLock.cxx
+++ b/Source/cmFileLock.cxx
@@ -19,49 +19,41 @@
cmFileLock::~cmFileLock()
{
- if (!this->Filename.empty())
- {
+ if (!this->Filename.empty()) {
const cmFileLockResult result = this->Release();
static_cast<void>(result);
assert(result.IsOk());
- }
+ }
}
-cmFileLockResult cmFileLock::Lock(
- const std::string& filename, unsigned long timeout)
+cmFileLockResult cmFileLock::Lock(const std::string& filename,
+ unsigned long timeout)
{
- if (filename.empty())
- {
+ if (filename.empty()) {
// Error is internal since all the directories and file must be created
// before actual lock called.
return cmFileLockResult::MakeInternal();
- }
+ }
- if (!this->Filename.empty())
- {
+ if (!this->Filename.empty()) {
// Error is internal since double-lock must be checked in class
// cmFileLockPool by the cmFileLock::IsLocked method.
return cmFileLockResult::MakeInternal();
- }
+ }
this->Filename = filename;
cmFileLockResult result = this->OpenFile();
- if (result.IsOk())
- {
- if (timeout == static_cast<unsigned long>(-1))
- {
+ if (result.IsOk()) {
+ if (timeout == static_cast<unsigned long>(-1)) {
result = this->LockWithoutTimeout();
- }
- else
- {
+ } else {
result = this->LockWithTimeout(timeout);
- }
}
+ }
- if (!result.IsOk())
- {
+ if (!result.IsOk()) {
this->Filename = "";
- }
+ }
return result;
}
@@ -72,7 +64,7 @@ bool cmFileLock::IsLocked(const std::string& filename) const
}
#if defined(_WIN32)
-# include "cmFileLockWin32.cxx"
+#include "cmFileLockWin32.cxx"
#else
-# include "cmFileLockUnix.cxx"
+#include "cmFileLockUnix.cxx"
#endif