From de1d03dceb962e7fd9e2e1e8372eb56fee579196 Mon Sep 17 00:00:00 2001 From: Nicolas Lesser Date: Thu, 13 Dec 2018 20:42:45 +0100 Subject: [PATCH] Try to fix gcc 4.4 bot. --- include/fmt/color.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index 5e4f8194..78243eb5 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -238,25 +238,25 @@ namespace internal { // color is a struct of either a rgb color or a terminal color. struct color_type { - FMT_CONSTEXPR color_type() FMT_NOEXCEPT {} + FMT_CONSTEXPR color_type() FMT_NOEXCEPT + : is_rgb(), value{} {} FMT_CONSTEXPR color_type(color rgb_color) FMT_NOEXCEPT - :is_rgb(true) { + : is_rgb(true), value{} { value.rgb_color = rgb_color; } FMT_CONSTEXPR color_type(rgb rgb_color) FMT_NOEXCEPT - : is_rgb(true) { + : is_rgb(true), value{} { value.rgb_color = rgb_color; } FMT_CONSTEXPR color_type(terminal_color term_color) FMT_NOEXCEPT - : is_rgb() { - value.term_color = term_color; + : is_rgb(), value{} { + value.term_color = static_cast(term_color); } union color_union { - FMT_CONSTEXPR color_union() FMT_NOEXCEPT : rgb_color(color::black) {} + uint8_t term_color; rgb rgb_color; - terminal_color term_color; } value; - bool is_rgb = false; + bool is_rgb; }; } // namespace internal @@ -403,7 +403,7 @@ struct ansi_color_escape { // sequence. if (!text_color.is_rgb) { bool is_background = esc == internal::data::BACKGROUND_COLOR; - uint8_t value = (uint8_t)text_color.value.term_color; + uint8_t value = text_color.value.term_color; // Background ASCII codes are the same as the foreground ones but with // 10 more. if (is_background)