Revert "Clean-up sign-conversion warnings in test code"

This reverts commit 227bfe62dd.
This commit is contained in:
Victor Zverovich
2019-12-08 15:47:24 -08:00
parent 227bfe62dd
commit 31de9a1b80
4 changed files with 24 additions and 26 deletions
+6 -7
View File
@@ -5,13 +5,12 @@
//
// For the license information refer to format.h.
#include "fmt/printf.h"
#include <cctype>
#include <climits>
#include <cstring>
#include "fmt/core.h"
#include "fmt/printf.h"
#include "gtest-extra.h"
#include "util.h"
@@ -301,15 +300,15 @@ void TestLength(const char* length_spec, U value) {
using fmt::internal::const_check;
if (const_check(max <= static_cast<unsigned>(max_value<int>()))) {
signed_value = static_cast<int>(value);
unsigned_value = static_cast<unsigned long long>(value);
unsigned_value = static_cast<unsigned>(value);
} else if (const_check(max <= max_value<unsigned>())) {
signed_value = static_cast<unsigned>(value);
unsigned_value = static_cast<unsigned long long>(value);
unsigned_value = static_cast<unsigned>(value);
}
if (sizeof(U) <= sizeof(int) && sizeof(int) < sizeof(T)) {
signed_value = static_cast<long long>(value);
unsigned_value = static_cast<unsigned long long>(
static_cast<typename std::make_unsigned<unsigned>::type>(value));
unsigned_value =
static_cast<typename std::make_unsigned<unsigned>::type>(value);
} else {
signed_value = static_cast<typename make_signed<T>::type>(value);
unsigned_value = static_cast<typename std::make_unsigned<T>::type>(value);
@@ -590,7 +589,7 @@ class custom_printf_arg_formatter : public formatter_t {
if (round(value * pow(10, specs()->precision)) == 0.0) value = 0;
return formatter_t::operator()(value);
}
}
};
typedef fmt::basic_format_args<context_t> format_args_t;