aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-12-18 14:17:55 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-01-06 20:55:07 +0300
commit6876fd23ef84487c016e7be46d3deb7d1e695cef (patch)
tree4ea4cf65e129a79f2d7a82489228c67e85d3e034
parent3bf1846063ad30ecc0fc90d34490bf70776faef0 (diff)
Fix standard_version constructors
-rw-r--r--libbutl/standard-version.ixx17
-rw-r--r--libbutl/standard-version.mxx2
2 files changed, 12 insertions, 7 deletions
diff --git a/libbutl/standard-version.ixx b/libbutl/standard-version.ixx
index c488284..66dccba 100644
--- a/libbutl/standard-version.ixx
+++ b/libbutl/standard-version.ixx
@@ -70,6 +70,9 @@ namespace butl
return version % 10000 == 1 && !snapshot () && !stub ();
}
+ // Note: in the following constructors we subtract one from AAABBBCCC if
+ // DDDE is not zero (see standard-version.hxx for details).
+ //
inline standard_version::
standard_version (std::uint16_t ep,
std::uint16_t mj,
@@ -82,7 +85,8 @@ namespace butl
(mj * 10000000000ULL +
mi * 10000000ULL +
pa * 10000ULL +
- pr * 10ULL),
+ pr * 10ULL -
+ (pr != 0 ? 10000ULL : 0ULL)),
"" /* snapshot */,
rv)
{
@@ -99,11 +103,12 @@ namespace butl
std::uint16_t rv)
: standard_version (ep,
// AAABBBCCCDDDE
- (mj * 10000000000ULL +
- mi * 10000000ULL +
- pa * 10000ULL +
- pr * 10ULL +
- /**/ 1ULL /* snapshot */),
+ (mj * 10000000000ULL +
+ mi * 10000000ULL +
+ pa * 10000ULL +
+ pr * 10ULL +
+ 1ULL /* snapshot */ -
+ 10000ULL),
sn,
si,
rv)
diff --git a/libbutl/standard-version.mxx b/libbutl/standard-version.mxx
index 0415318..1cc557b 100644
--- a/libbutl/standard-version.mxx
+++ b/libbutl/standard-version.mxx
@@ -190,7 +190,7 @@ LIBBUTL_MODEXPORT namespace butl
flags = none);
// Version as separate major, minor, patch, and pre-release components.
- // Note that the pre-release here is in the DDD form, that is, incremenetd
+ // Note that the pre-release here is in the DDD form, that is, incremented
// by 500 for betas.
//
standard_version (std::uint16_t epoch,