[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) \
- [lmi-commits] [lmi] master updated (f43af72 -> bc7259f), Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master e1482a3 5/6: Add unit tests for stifle_unused_warning(), Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master bc7259f 6/6: Make stifle_unused_warning() constexpr, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master be063aa 4/6: Merge "stifle" function templates, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master 7f3f9c8 1/6: Clarify, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master de0234e 3/6: Use std::fabs as appropriate in f2c-translated code, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master 3899747 2/6: Avoid ambiguous abbreviations,
Greg Chicares <=