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

Distinguish float type formatting from double #1360

Merged
merged 4 commits into from
Oct 12, 2019
Merged

Conversation

orivej
Copy link
Contributor

@orivej orivej commented Oct 12, 2019

This fixes #1353 and is the first half of the fix for #1336.

I suggest reviewing commits one by one.

This is needed to support more than the current 16 types.
Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! Just one minor comment.

char* sprintf_format<float>(float value, internal::buffer<char>& buf,
sprintf_specs specs) {
// printf does not have a float format modifier, it only supports double.
return sprintf_format(double(value), buf, specs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest replacing this with

return sprintf_format<double>(value, buf, specs);

to avoid cast.

It handles all floating point types, not just doubles.
@vitaut
Copy link
Contributor

vitaut commented Oct 12, 2019

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot override float processing
2 participants