summaryrefslogtreecommitdiffstats
path: root/Source/cmFileTimeComparison.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2018-06-01 13:53:41 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-01 13:53:42 (GMT)
commitd7204e649ed4ebb19bb341b4e49eb51514364922 (patch)
treed9ac3ded5ae6899be7188795011743fe3e6da0a6 /Source/cmFileTimeComparison.cxx
parent12fed3edb107c949671043196fa94c542b45452a (diff)
downloadCMake-d7204e649ed4ebb19bb341b4e49eb51514364922.zip
CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.tar.gz
CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.tar.bz2
Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * 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/cmFileTimeComparison.cxx')
-rw-r--r--Source/cmFileTimeComparison.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 622c15e..8f6993d 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -9,12 +9,12 @@
// Use a platform-specific API to get file times efficiently.
#if !defined(_WIN32) || defined(__CYGWIN__)
-#include "cm_sys_stat.h"
-#define cmFileTimeComparison_Type struct stat
+# include "cm_sys_stat.h"
+# define cmFileTimeComparison_Type struct stat
#else
-#include "cmsys/Encoding.hxx"
-#include <windows.h>
-#define cmFileTimeComparison_Type FILETIME
+# include "cmsys/Encoding.hxx"
+# include <windows.h>
+# define cmFileTimeComparison_Type FILETIME
#endif
class cmFileTimeComparisonInternal
@@ -98,7 +98,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
cmFileTimeComparison_Type* s2)
{
#if !defined(_WIN32) || defined(__CYGWIN__)
-#if CMake_STAT_HAS_ST_MTIM
+# if CMake_STAT_HAS_ST_MTIM
// Compare using nanosecond resolution.
if (s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) {
return -1;
@@ -112,7 +112,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
return 1;
}
-#elif CMake_STAT_HAS_ST_MTIMESPEC
+# elif CMake_STAT_HAS_ST_MTIMESPEC
// Compare using nanosecond resolution.
if (s1->st_mtimespec.tv_sec < s2->st_mtimespec.tv_sec) {
return -1;
@@ -126,7 +126,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
if (s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) {
return 1;
}
-#else
+# else
// Compare using 1 second resolution.
if (s1->st_mtime < s2->st_mtime) {
return -1;
@@ -134,7 +134,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
if (s1->st_mtime > s2->st_mtime) {
return 1;
}
-#endif
+# endif
// Files have the same time.
return 0;
#else
@@ -147,7 +147,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
cmFileTimeComparison_Type* s2)
{
#if !defined(_WIN32) || defined(__CYGWIN__)
-#if CMake_STAT_HAS_ST_MTIM
+# if CMake_STAT_HAS_ST_MTIM
// Times are integers in units of 1ns.
long long bil = 1000000000;
long long t1 = s1->st_mtim.tv_sec * bil + s1->st_mtim.tv_nsec;
@@ -159,7 +159,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
return (t1 - t2) >= bil;
}
return false;
-#elif CMake_STAT_HAS_ST_MTIMESPEC
+# elif CMake_STAT_HAS_ST_MTIMESPEC
// Times are integers in units of 1ns.
long long bil = 1000000000;
long long t1 = s1->st_mtimespec.tv_sec * bil + s1->st_mtimespec.tv_nsec;
@@ -171,7 +171,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
return (t1 - t2) >= bil;
}
return false;
-#else
+# else
// Times are integers in units of 1s.
if (s1->st_mtime < s2->st_mtime) {
return (s2->st_mtime - s1->st_mtime) >= 1;
@@ -180,7 +180,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
return (s1->st_mtime - s2->st_mtime) >= 1;
}
return false;
-#endif
+# endif
#else
// Times are integers in units of 100ns.
LARGE_INTEGER t1;