Fix warnings
This commit is contained in:
parent
a5757c86df
commit
90a12b1bb2
@ -994,7 +994,7 @@ TEST(FormatterTest, RuntimePrecision) {
|
|||||||
FormatError, "number is too big");
|
FormatError, "number is too big");
|
||||||
EXPECT_THROW_MSG(format("{0:.{1}}", 0, -1l),
|
EXPECT_THROW_MSG(format("{0:.{1}}", 0, -1l),
|
||||||
FormatError, "negative precision");
|
FormatError, "negative precision");
|
||||||
if (sizeof(long) > sizeof(int)) {
|
if (fmt::internal::check(sizeof(long) > sizeof(int))) {
|
||||||
long value = INT_MAX;
|
long value = INT_MAX;
|
||||||
EXPECT_THROW_MSG(format("{0:.{1}}", 0, (value + 1)),
|
EXPECT_THROW_MSG(format("{0:.{1}}", 0, (value + 1)),
|
||||||
FormatError, "number is too big");
|
FormatError, "number is too big");
|
||||||
@ -1050,7 +1050,7 @@ void check_unknown_types(
|
|||||||
char format_str[BUFFER_SIZE], message[BUFFER_SIZE];
|
char format_str[BUFFER_SIZE], message[BUFFER_SIZE];
|
||||||
const char *special = ".0123456789}";
|
const char *special = ".0123456789}";
|
||||||
for (int i = CHAR_MIN; i <= CHAR_MAX; ++i) {
|
for (int i = CHAR_MIN; i <= CHAR_MAX; ++i) {
|
||||||
char c = i;
|
char c = static_cast<char>(i);
|
||||||
if (std::strchr(types, c) || std::strchr(special, c) || !c) continue;
|
if (std::strchr(types, c) || std::strchr(special, c) || !c) continue;
|
||||||
safe_sprintf(format_str, "{0:10%c}", c);
|
safe_sprintf(format_str, "{0:10%c}", c);
|
||||||
if (std::isprint(static_cast<unsigned char>(c)))
|
if (std::isprint(static_cast<unsigned char>(c)))
|
||||||
|
Loading…
Reference in New Issue
Block a user