Fix tinyformat.h switch fallthrough warnings

This cherry-picks a tinyformat commit:

8a2812d848

The effect should be to remove all compilation warnings about implicit
switch fallthroughs.

Updating the entire header file to the latest release at once brings in
other changes that may be more invasive for 1.14.5, and this commit
should not interfere with a further update.
This commit is contained in:
chromatic 2021-08-29 17:55:20 -07:00
parent 18dbe3291b
commit 16a2776ea8
1 changed files with 4 additions and 0 deletions

View File

@ -705,23 +705,27 @@ inline const char* streamStateFromFormat(std::ostream& out, bool& spacePadPositi
break;
case 'X':
out.setf(std::ios::uppercase);
// Falls through
case 'x': case 'p':
out.setf(std::ios::hex, std::ios::basefield);
intConversion = true;
break;
case 'E':
out.setf(std::ios::uppercase);
// Falls through
case 'e':
out.setf(std::ios::scientific, std::ios::floatfield);
out.setf(std::ios::dec, std::ios::basefield);
break;
case 'F':
out.setf(std::ios::uppercase);
// Falls through
case 'f':
out.setf(std::ios::fixed, std::ios::floatfield);
break;
case 'G':
out.setf(std::ios::uppercase);
// Falls through
case 'g':
out.setf(std::ios::dec, std::ios::basefield);
// As in boost::format, let stream decide float format.