lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 3899747 2/6: Avoid ambiguous abbreviations


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 3899747 2/6: Avoid ambiguous abbreviations
Date: Wed, 27 Oct 2021 18:22:21 -0400 (EDT)

branch: master
commit 3899747364b2a0c120096e2e37d3c916f33b2c2e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Avoid ambiguous abbreviations
    
    'exp' suggests std::exp() (with "std::" missing).
---
 math_functions_test.cpp | 12 ++++++------
 test_tools.hpp          | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/math_functions_test.cpp b/math_functions_test.cpp
index c8234e0..6a324b2 100644
--- a/math_functions_test.cpp
+++ b/math_functions_test.cpp
@@ -253,24 +253,24 @@ void mete3()
 
 void mete4()
 {
-    double volatile base = 10.0;
-    int    volatile exp  = 9;
+    double volatile base     = 10.0;
+    int    volatile exponent = 9;
     double volatile x;
     for(int j = 0; j < 100000; ++j)
         {
-        x = 1.0 / nonstd::power(base, exp);
+        x = 1.0 / nonstd::power(base, exponent);
         }
     stifle_warning_for_unused_value(x);
 }
 
 void mete5()
 {
-    double volatile base = 10.0;
-    int    volatile exp  = -9;
+    double volatile base     = 10.0;
+    int    volatile exponent = -9;
     double volatile x;
     for(int j = 0; j < 100000; ++j)
         {
-        x = std::pow(base, exp);
+        x = std::pow(base, exponent);
         }
     stifle_warning_for_unused_value(x);
 }
diff --git a/test_tools.hpp b/test_tools.hpp
index 77d220c..adadb1b 100644
--- a/test_tools.hpp
+++ b/test_tools.hpp
@@ -76,8 +76,8 @@
     << ", line " << __LINE__ << "]\n" \
     << std::flush                     \
 
-#define LMI_TEST(exp)               \
-    if(exp)                         \
+#define LMI_TEST(expr)              \
+    if(expr)                        \
         {                           \
         lmi_test::record_success(); \
         }                           \
@@ -85,7 +85,7 @@
         {                           \
         lmi_test::record_error();   \
         lmi_test::error_stream()    \
-            << (exp)                \
+            << (expr)               \
             << LMI_TEST_FLUSH       \
             ;                       \
         }                           \
@@ -201,14 +201,14 @@ bool whats_what(std::string const& observed, what_regex 
const& expected);
         }                                                     \
     }                                                         \
 
-#define INVOKE_LMI_TEST(exp,file,line)      \
-    if(!(exp))                              \
+#define INVOKE_LMI_TEST(expr,file,line)     \
+    if(!(expr))                             \
         {                                   \
         lmi_test::record_error();           \
         lmi_test::error_stream()            \
             << lmi_test::error_prefix       \
             << "test failed: "              \
-            << (exp)                        \
+            << (expr)                       \
             << "\n[invoked from "           \
             << "file " << (file) << ", "    \
             << "line: " << (line)           \



reply via email to

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