From 16a2776ea84858bf20326a776037a3571e1fa531 Mon Sep 17 00:00:00 2001 From: chromatic Date: Sun, 29 Aug 2021 17:55:20 -0700 Subject: [PATCH] Fix tinyformat.h switch fallthrough warnings This cherry-picks a tinyformat commit: https://github.com/c42f/tinyformat/commit/8a2812d8480bfb66923eea0bb5cdda79fe4f17ba 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. --- src/tinyformat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tinyformat.h b/src/tinyformat.h index 17f0360c4..01ef7ccdd 100644 --- a/src/tinyformat.h +++ b/src/tinyformat.h @@ -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.