Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack to get char and byte to play well #56

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class fmt::internal::ArgFormatter :

void visit_char(int value) {
if (spec_.type_ && spec_.type_ != 'c')
fmt::internal::ReportUnknownType(spec_.type_, "char");
return visit_any_int(value);
typedef typename fmt::BasicWriter<Char>::CharPtr CharPtr;
CharPtr out = CharPtr();
if (spec_.width_ > 1) {
Expand Down
6 changes: 4 additions & 2 deletions format.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,10 @@ struct Arg {
// Integer types should go first,
INT, UINT, LONG_LONG, ULONG_LONG, LAST_INTEGER_TYPE = ULONG_LONG,
// followed by floating-point types.
DOUBLE, LONG_DOUBLE, LAST_NUMERIC_TYPE = LONG_DOUBLE,
CHAR, STRING, WSTRING, POINTER, CUSTOM
DOUBLE, LONG_DOUBLE,
// fringe number hybrid type
CHAR, LAST_NUMERIC_TYPE = CHAR,
STRING, WSTRING, POINTER, CUSTOM,
};
Type type;

Expand Down