Skip to content

Commit

Permalink
Explicitly cast int -> char to prevent conversion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu343726 committed Aug 12, 2017
1 parent 032c838 commit 29a7e2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ class ArgVisitor {
FMT_ASSERT(false, "invalid argument type");
break;
case Arg::INT:
return FMT_DISPATCH(visit_int(arg.int_value));
return FMT_DISPATCH(visit_int(static_cast<char>(arg.int_value)));
case Arg::UINT:
return FMT_DISPATCH(visit_uint(arg.uint_value));
case Arg::LONG_LONG:
Expand All @@ -1681,7 +1681,7 @@ class ArgVisitor {
case Arg::BOOL:
return FMT_DISPATCH(visit_bool(arg.int_value != 0));
case Arg::CHAR:
return FMT_DISPATCH(visit_char(arg.int_value));
return FMT_DISPATCH(visit_char(static_cast<char>(arg.int_value)));
case Arg::DOUBLE:
return FMT_DISPATCH(visit_double(arg.double_value));
case Arg::LONG_DOUBLE:
Expand Down

0 comments on commit 29a7e2c

Please sign in to comment.