From 646829e34d4b410d08653a4af307f3682c419b67 Mon Sep 17 00:00:00 2001 From: vitaut Date: Sat, 21 Nov 2015 07:31:00 -0800 Subject: [PATCH] Fix MSVC warnings --- format.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/format.h b/format.h index b7c23a4c..2acd330e 100644 --- a/format.h +++ b/format.h @@ -227,6 +227,7 @@ typedef std::numeric_limits FPUtil; // if the latter are not available. inline DummyInt signbit(...) { return DummyInt(); } inline DummyInt _ecvt_s(...) { return DummyInt(); } +inline DummyInt _ecvt(...) { return DummyInt(); } inline DummyInt isinf(...) { return DummyInt(); } inline DummyInt _finite(...) { return DummyInt(); } inline DummyInt isnan(...) { return DummyInt(); } @@ -274,11 +275,10 @@ class numeric_limits : if (sizeof(_ecvt_s(0, 0, x, 0, 0, 0)) == sizeof(int)) { char buffer[2]; // The buffer size must be >= 2 or _ecvt_s will fail. _ecvt_s(buffer, sizeof(buffer), x, 0, &dec, &sign); - return sign; + return sign != 0; } - char *result = ecvt(x, 0, &dec, &sign); - (void)result; // Suppress a warning about unused return value of ecvt. - return sign; + _ecvt(x, 0, &dec, &sign); + return sign != 0; } }; } // namespace std