Try to fix gcc 4.4 bot.

This commit is contained in:
Nicolas Lesser 2018-12-13 20:42:45 +01:00
parent 2ed1f9e9cf
commit de1d03dceb
No known key found for this signature in database
GPG Key ID: 55F9BC675F85A2DF

View File

@ -238,25 +238,25 @@ namespace internal {
// color is a struct of either a rgb color or a terminal color. // color is a struct of either a rgb color or a terminal color.
struct color_type { 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 FMT_CONSTEXPR color_type(color rgb_color) FMT_NOEXCEPT
:is_rgb(true) { : is_rgb(true), value{} {
value.rgb_color = rgb_color; value.rgb_color = rgb_color;
} }
FMT_CONSTEXPR color_type(rgb rgb_color) FMT_NOEXCEPT FMT_CONSTEXPR color_type(rgb rgb_color) FMT_NOEXCEPT
: is_rgb(true) { : is_rgb(true), value{} {
value.rgb_color = rgb_color; value.rgb_color = rgb_color;
} }
FMT_CONSTEXPR color_type(terminal_color term_color) FMT_NOEXCEPT FMT_CONSTEXPR color_type(terminal_color term_color) FMT_NOEXCEPT
: is_rgb() { : is_rgb(), value{} {
value.term_color = term_color; value.term_color = static_cast<uint8_t>(term_color);
} }
union color_union { union color_union {
FMT_CONSTEXPR color_union() FMT_NOEXCEPT : rgb_color(color::black) {} uint8_t term_color;
rgb rgb_color; rgb rgb_color;
terminal_color term_color;
} value; } value;
bool is_rgb = false; bool is_rgb;
}; };
} // namespace internal } // namespace internal
@ -403,7 +403,7 @@ struct ansi_color_escape {
// sequence. // sequence.
if (!text_color.is_rgb) { if (!text_color.is_rgb) {
bool is_background = esc == internal::data::BACKGROUND_COLOR; 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 // Background ASCII codes are the same as the foreground ones but with
// 10 more. // 10 more.
if (is_background) if (is_background)