COMP: fix warnings about major()/minor() name conflicts (closes #883)

- major() and minor() are GNU macros in sys/sysmacros.h
  and generates warning on some systems (eg, Ubuntu 18.04)

  use getMajor() and getMinor() as method names instead.
This commit is contained in:
Mark Olesen
2018-06-18 15:37:24 +02:00
parent dad09c5e7d
commit 48dafdedcf

View File

@ -117,14 +117,14 @@ public:
return number_; return number_;
} }
//- The major version number //- Return the major version number.
inline int major() const noexcept inline int getMajor() const noexcept
{ {
return int(number_ / 10); return int(number_ / 10);
} }
//- The minor version number //- Return the minor version number
inline int minor() const noexcept inline int getMinor() const noexcept
{ {
return int(number_ % 10); return int(number_ % 10);
} }
@ -132,7 +132,10 @@ public:
//- A string representation of major.minor //- A string representation of major.minor
std::string str() const std::string str() const
{ {
return std::to_string(major()) + '.' + std::to_string(minor()); return
std::to_string(getMajor())
+ '.'
+ std::to_string(getMinor());
} }