[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master f530d5b 2/4: Resolve useless-cast warnings fo
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master f530d5b 2/4: Resolve useless-cast warnings for currency class |
Date: |
Thu, 6 Aug 2020 15:52:20 -0400 (EDT) |
branch: master
commit f530d5bf4d4e767dbefb58b9960cc939033c099c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Resolve useless-cast warnings for currency class
---
currency.hpp | 8 ++++----
workhorse.make | 3 ---
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/currency.hpp b/currency.hpp
index f0c5e5d..e1f8864 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -197,22 +197,22 @@ class currency
inline currency operator+(currency lhs, currency rhs)
{
- return currency(lhs) += rhs;
+ return lhs += rhs;
}
inline currency operator-(currency lhs, currency rhs)
{
- return currency(lhs) -= rhs;
+ return lhs -= rhs;
}
inline currency operator*(currency lhs, int rhs)
{
- return currency(lhs) *= rhs;
+ return lhs *= rhs;
}
inline currency operator*(int lhs, currency rhs)
{
- return currency(rhs) *= lhs;
+ return rhs *= lhs;
}
/// Insert the dollars-and-cents amount into a stream.
diff --git a/workhorse.make b/workhorse.make
index 83c8af5..6dea4f4 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -551,9 +551,6 @@ gcc_common_extra_warnings := \
bourn_cast_test.o: gcc_common_extra_warnings += \
-Wno-double-promotion \
-currency_test.o: gcc_common_extra_warnings += \
- -Wno-useless-cast \
-
# Some boost-1.33.1 libraries are incompatible with many warnings.
$(boost_filesystem_objects): gcc_common_extra_warnings += \