[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 0980e6e 1/3: Avoid unused-variable warnings
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 0980e6e 1/3: Avoid unused-variable warnings |
Date: |
Sat, 3 Mar 2018 05:03:06 -0500 (EST) |
branch: master
commit 0980e6e765e29e3d4f9cdd60449bb8ef6ea6138e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Avoid unused-variable warnings
---
cache_file_reads_test.cpp | 2 ++
currency_test.cpp | 3 +++
2 files changed, 5 insertions(+)
diff --git a/cache_file_reads_test.cpp b/cache_file_reads_test.cpp
index 11f9a1c..9ad5bec 100644
--- a/cache_file_reads_test.cpp
+++ b/cache_file_reads_test.cpp
@@ -103,12 +103,14 @@ void cache_file_reads_test::mete_uncached()
{
X const x("sample.ill");
std::string::size_type volatile z = x.s().size();
+ stifle_warning_for_unused_value(z);
}
void cache_file_reads_test::mete_cached()
{
X const& x(*X::read_via_cache("sample.ill"));
std::string::size_type volatile z = x.s().size();
+ stifle_warning_for_unused_value(z);
}
int test_main(int, char*[])
diff --git a/currency_test.cpp b/currency_test.cpp
index 98ba42a..acc42c5 100644
--- a/currency_test.cpp
+++ b/currency_test.cpp
@@ -24,6 +24,7 @@
#include "currency.hpp"
#include "materially_equal.hpp"
+#include "miscellany.hpp" // stifle_warning_for_unused_value()
#include "test_tools.hpp"
#include "timer.hpp"
@@ -265,9 +266,11 @@ void do_some_arithmetic(T t)
u += t - f;
u = convert_from_double<T>(std::floor(convert_to_double(u) * 1.03));
T volatile v(u);
+ stifle_warning_for_unused_value(v);
}
T volatile w(t);
+ stifle_warning_for_unused_value(w);
}
void mete_double()