From ae4dea0483145ec6e57a818907d3f007875a6009 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 28 Apr 2017 00:30:59 +0300 Subject: MinGW GCC happy (reorder inline functions, parentheses) --- butl/filesystem.cxx | 2 +- butl/standard-version | 17 ++++++++++++++++- butl/standard-version.ixx | 18 ------------------ 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/butl/filesystem.cxx b/butl/filesystem.cxx index 5258a57..16c633a 100644 --- a/butl/filesystem.cxx +++ b/butl/filesystem.cxx @@ -573,7 +573,7 @@ namespace butl throw_system_error (ec); } - if (s.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY != 0) + if ((s.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) return timestamp_nonexistent; // Time in FILETIME is in 100 nanosecond "ticks" since "Windows epoch" diff --git a/butl/standard-version b/butl/standard-version index 59056ac..71bd5be 100644 --- a/butl/standard-version +++ b/butl/standard-version @@ -69,7 +69,22 @@ namespace butl earliest () const noexcept; int - compare (const standard_version&) const noexcept; + compare (const standard_version& v) const noexcept + { + if (epoch != v.epoch) + return epoch < v.epoch ? -1 : 1; + + if (version != v.version) + return version < v.version ? -1 : 1; + + if (snapshot_sn != v.snapshot_sn) + return snapshot_sn < v.snapshot_sn ? -1 : 1; + + if (revision != v.revision) + return revision < v.revision ? -1 : 1; + + return 0; + } // Parse the version. Throw std::invalid_argument if the format is not // recognizable or components are invalid. diff --git a/butl/standard-version.ixx b/butl/standard-version.ixx index 332eb02..a2de26c 100644 --- a/butl/standard-version.ixx +++ b/butl/standard-version.ixx @@ -83,22 +83,4 @@ namespace butl { return version % 10000 == 1 && !snapshot (); } - - inline int standard_version:: - compare (const standard_version& v) const noexcept - { - if (epoch != v.epoch) - return epoch < v.epoch ? -1 : 1; - - if (version != v.version) - return version < v.version ? -1 : 1; - - if (snapshot_sn != v.snapshot_sn) - return snapshot_sn < v.snapshot_sn ? -1 : 1; - - if (revision != v.revision) - return revision < v.revision ? -1 : 1; - - return 0; - } } -- cgit v1.1