lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] odd/multiarch 2651914 1/5: Merge branch 'master' int


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/multiarch 2651914 1/5: Merge branch 'master' into odd/multiarch
Date: Fri, 12 Apr 2019 08:32:58 -0400 (EDT)

branch: odd/multiarch
commit 265191494592239e52f935be10468b3aa79d884e
Merge: 11efcd0 dd7fa69
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Merge branch 'master' into odd/multiarch
    
    Incorporated half a dozen unrelated commits done on master in April.
---
 calendar_date.cpp           |  7 +++----
 version.hpp                 |  2 +-
 wx_test_pdf_create.cpp      |  3 +--
 wx_test_validate_output.cpp |  4 +---
 wx_utility.cpp              |  5 ++---
 zero_test.cpp               | 28 ++++++++++------------------
 6 files changed, 18 insertions(+), 31 deletions(-)

diff --git a/calendar_date.cpp b/calendar_date.cpp
index f80ade5..6524f1f 100644
--- a/calendar_date.cpp
+++ b/calendar_date.cpp
@@ -738,8 +738,7 @@ class birthdate_limit
 
     double operator()(double candidate)
         {
-        // Double parentheses circumvent the most vexing parse.
-        calendar_date z((jdn_t(bourn_cast<int>(candidate))));
+        calendar_date const z {jdn_t(bourn_cast<int>(candidate))};
         return offset_ + notional_age(z, as_of_date_, alb_anb_) - limit_age_;
         }
 
@@ -821,13 +820,13 @@ std::string month_name(int month)
 
 calendar_date const& gregorian_epoch()
 {
-    static calendar_date const z((jdn_t(calendar_date::gregorian_epoch_jdn)));
+    static calendar_date const z {jdn_t(calendar_date::gregorian_epoch_jdn)};
     return z;
 }
 
 calendar_date const& last_yyyy_date()
 {
-    static calendar_date const z((jdn_t(calendar_date::last_yyyy_date_jdn)));
+    static calendar_date const z {jdn_t(calendar_date::last_yyyy_date_jdn)};
     return z;
 }
 
diff --git a/version.hpp b/version.hpp
index fcf477a..7c7c7ac 100644
--- a/version.hpp
+++ b/version.hpp
@@ -22,6 +22,6 @@
 
 #include "config.hpp"
 
-#define LMI_VERSION "20190201T1954Z"
+#define LMI_VERSION "20190402T1521Z"
 
 #endif // version_hpp
diff --git a/wx_test_pdf_create.cpp b/wx_test_pdf_create.cpp
index 2240c86..a8009f0 100644
--- a/wx_test_pdf_create.cpp
+++ b/wx_test_pdf_create.cpp
@@ -94,8 +94,7 @@ LMI_WX_TEST_CASE(pdf_illustration)
     };
 
     // Create a new billion-dollar illustration.
-    // Double parentheses circumvent the most vexing parse.
-    wx_test_new_illustration ill((billion_dollar_illustration()));
+    wx_test_new_illustration ill {billion_dollar_illustration()};
 
     // Ensure that the output file doesn't exist in the first place.
     output_pdf_existence_checker output_pdf(get_current_document_name());
diff --git a/wx_test_validate_output.cpp b/wx_test_validate_output.cpp
index 9f31ad7..ca679d0 100644
--- a/wx_test_validate_output.cpp
+++ b/wx_test_validate_output.cpp
@@ -486,9 +486,7 @@ LMI_WX_TEST_CASE(validate_output_illustration)
     };
 
     // Create a new illustration with the special comment.
-
-    // Double parentheses circumvent the most vexing parse.
-    wx_test_new_illustration ill((enter_comment_in_illustration_dialog()));
+    wx_test_new_illustration ill {enter_comment_in_illustration_dialog()};
     ill.close_discard_changes();
 
     // And check that this resulted in the creation of the expected file.
diff --git a/wx_utility.cpp b/wx_utility.cpp
index b5c6432..78cadc0 100644
--- a/wx_utility.cpp
+++ b/wx_utility.cpp
@@ -152,7 +152,7 @@ bool operator==(wxDateTime const& wx_date, calendar_date 
const& lmi_date)
 
 void TestDateConversions()
 {
-    calendar_date const z((jdn_t(calendar_date::min_verified_jdn)));
+    calendar_date const z {jdn_t(calendar_date::min_verified_jdn)};
     int const low  = z               .julian_day_number();
     int const high = last_yyyy_date().julian_day_number();
     status()
@@ -165,8 +165,7 @@ void TestDateConversions()
         ;
     for(int j = low; j <= high; ++j)
         {
-        // Double parentheses circumvent the most vexing parse.
-        calendar_date const lmi_date0((jdn_t(j)));
+        calendar_date const lmi_date0 {jdn_t(j)};
         calendar_date const lmi_date1 =
             ConvertDateFromWx
                 (ConvertDateToWx
diff --git a/zero_test.cpp b/zero_test.cpp
index 9692117..d8d32b6 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -36,9 +36,9 @@ namespace
 template<typename F>
 void test_zero(double bound0, double bound1, int dec, F f, double exact_root)
 {
-    root_type rn = decimal_root((bound0), (bound1), bias_none,   (dec), (f));
-    root_type rl = decimal_root((bound0), (bound1), bias_lower,  (dec), (f));
-    root_type rh = decimal_root((bound0), (bound1), bias_higher, (dec), (f));
+    root_type rn = decimal_root(bound0, bound1, bias_none,   dec, f);
+    root_type rl = decimal_root(bound0, bound1, bias_lower,  dec, f);
+    root_type rh = decimal_root(bound0, bound1, bias_higher, dec, f);
 
     BOOST_TEST(root_is_valid == rn.second);
     BOOST_TEST(root_is_valid == rl.second);
@@ -47,7 +47,7 @@ void test_zero(double bound0, double bound1, int dec, F f, 
double exact_root)
     BOOST_TEST(rl.first <= rn.first && rn.first <= rh.first);
 
     double tol =
-            std::pow(10.0, -(dec))
+            std::pow(10.0, -dec)
         +   6.0 * epsilon * std::max
                 (std::fabs(rl.first), std::fabs(rh.first)
                 )
@@ -55,16 +55,16 @@ void test_zero(double bound0, double bound1, int dec, F f, 
double exact_root)
     BOOST_TEST((rh.first - rl.first) <= tol);
 
     double toll =
-            std::pow(10.0, -(dec))
+            std::pow(10.0, -dec)
         +   6.0 * epsilon * std::fabs(rl.first)
         ;
-    BOOST_TEST((rl.first - (exact_root)) <= toll);
+    BOOST_TEST((rl.first - exact_root) <= toll);
 
     double tolh =
-            std::pow(10.0, -(dec))
+            std::pow(10.0, -dec)
         +   6.0 * epsilon * std::fabs(rh.first)
         ;
-    BOOST_TEST((rh.first - (exact_root)) <= tolh);
+    BOOST_TEST((rh.first - exact_root) <= tolh);
 }
 
 double e_function(double z)
@@ -110,16 +110,8 @@ struct e_former_rounding_problem
 int test_main(int, char*[])
 {
     // Test use with function.
-    //
-    // This would be more natural:
-    //  root_type r = decimal_root(0.5, 5.0, bias_none, 9, e_function);
-    // but borland compilers reject it:
-    //  Could not find a match for
-    //  'decimal_root<FunctionalType>(double,double,root_bias,int,double 
(*)(double))'
-    // even though 14.8.2.4/9 says T(*)(T) is deducible.
-
-    double(*f)(double) = e_function;
-    root_type r = decimal_root(0.5, 5.0, bias_none, 9, f);
+
+    root_type r = decimal_root(0.5, 5.0, bias_none, 9, e_function);
     BOOST_TEST(root_is_valid == r.second);
 
     // Test use with function object.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]