mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-04 03:40:49 +02:00
Revert "Clean-up sign-conversion warnings in test code"
This reverts commit 227bfe62dd.
This commit is contained in:
+6
-7
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user