mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 20:18:49 +00:00
Fix warnings.
This commit is contained in:
parent
61857356ea
commit
186734cf8b
@ -253,8 +253,8 @@ class ArgConverter : public fmt::internal::ArgVisitor<ArgConverter<T>, void> {
|
||||
arg_.int_value = static_cast<int>(static_cast<T>(value));
|
||||
} else {
|
||||
arg_.type = Arg::UINT;
|
||||
arg_.uint_value =
|
||||
static_cast<typename fmt::internal::MakeUnsigned<T>::Type>(value);
|
||||
arg_.uint_value = static_cast<unsigned>(
|
||||
static_cast<typename fmt::internal::MakeUnsigned<T>::Type>(value));
|
||||
}
|
||||
} else {
|
||||
if (is_signed) {
|
||||
|
@ -296,7 +296,8 @@ void TestLength(const char *length_spec, U value) {
|
||||
if (max <= std::numeric_limits<int>::max()) {
|
||||
signed_value = static_cast<int>(value);
|
||||
unsigned_value = static_cast<int>(value);
|
||||
} else if (max <= std::numeric_limits<unsigned>::max()) {
|
||||
} else if (static_cast<fmt::ULongLong>(max) <=
|
||||
std::numeric_limits<unsigned>::max()) {
|
||||
signed_value = static_cast<unsigned>(value);
|
||||
unsigned_value = static_cast<unsigned>(value);
|
||||
}
|
||||
@ -333,8 +334,10 @@ void TestLength(const char *length_spec) {
|
||||
TestLength<T>(length_spec, -42);
|
||||
TestLength<T>(length_spec, min);
|
||||
TestLength<T>(length_spec, max);
|
||||
if (min > std::numeric_limits<fmt::LongLong>::min())
|
||||
if (min >= 0 || static_cast<fmt::LongLong>(min) >
|
||||
std::numeric_limits<fmt::LongLong>::min()) {
|
||||
TestLength<T>(length_spec, fmt::LongLong(min) - 1);
|
||||
}
|
||||
if (max < std::numeric_limits<fmt::LongLong>::max())
|
||||
TestLength<T>(length_spec, fmt::LongLong(max) + 1);
|
||||
TestLength<T>(length_spec, std::numeric_limits<short>::min());
|
||||
|
Loading…
Reference in New Issue
Block a user