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 20, 2017
1 parent 032c838 commit 9e15ef7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ArgConverter : public ArgVisitor<ArgConverter<T>, void> {
visit_any_int(value);
}

void visit_char(char value) {
void visit_char(int value) {
if (type_ != 's')
visit_any_int(value);
}
Expand Down

0 comments on commit 9e15ef7

Please sign in to comment.