diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:36:23 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:46:02 -0500 |
commit | c583a2520616c2736cffc389c89a48b159366e6c (patch) | |
tree | b4925f26506fcee96c16119431c01760f05db95d /gdb/ui-style.c | |
parent | ca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff) | |
download | binutils-users/simark/clang-format.zip binutils-users/simark/clang-format.tar.gz binutils-users/simark/clang-format.tar.bz2 |
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdb/ui-style.c')
-rw-r--r-- | gdb/ui-style.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/gdb/ui-style.c b/gdb/ui-style.c index 1ea224c..9c9316d 100644 --- a/gdb/ui-style.c +++ b/gdb/ui-style.c @@ -35,7 +35,7 @@ static const char ansi_regex_text[] = "[\x20-\x2f]*" /* End the first capture. */ ")" - /* The final byte. */ +/* The final byte. */ #define FINAL_SUBEXP 2 "([\x40-\x7e])"; @@ -52,14 +52,14 @@ static regex_t ansi_regex; xterm. */ static const uint8_t bright_colors[][3] = { - { 127, 127, 127 }, /* Black. */ - { 255, 0, 0 }, /* Red. */ - { 0, 255, 0 }, /* Green. */ - { 255, 255, 0 }, /* Yellow. */ - { 92, 92, 255 }, /* Blue. */ - { 255, 0, 255 }, /* Magenta. */ - { 0, 255, 255 }, /* Cyan. */ - { 255, 255, 255 } /* White. */ + { 127, 127, 127 }, /* Black. */ + { 255, 0, 0 }, /* Red. */ + { 0, 255, 0 }, /* Green. */ + { 255, 255, 0 }, /* Yellow. */ + { 92, 92, 255 }, /* Blue. */ + { 255, 0, 255 }, /* Magenta. */ + { 0, 255, 255 }, /* Cyan. */ + { 255, 255, 255 } /* White. */ }; /* See ui-style.h. */ @@ -84,8 +84,7 @@ ui_file_style::color::append_ansi (bool is_fg, std::string *str) const else { str->append (is_fg ? "38;2;" : "48;2;"); - str->append (std::to_string (m_red) - + ";" + std::to_string (m_green) + str->append (std::to_string (m_red) + ";" + std::to_string (m_green) + ";" + std::to_string (m_blue)); } return true; @@ -208,12 +207,9 @@ extended_color (const char *str, regoff_t *idx, ui_file_style::color *color) { /* 24-bit color. */ long r, g, b; - if (!read_semi_number (str, idx, &r) - || r > 255 - || !read_semi_number (str, idx, &g) - || g > 255 - || !read_semi_number (str, idx, &b) - || b > 255) + if (!read_semi_number (str, idx, &r) || r > 255 + || !read_semi_number (str, idx, &g) || g > 255 + || !read_semi_number (str, idx, &b) || b > 255) return false; *color = ui_file_style::color (r, g, b); } @@ -264,8 +260,7 @@ ui_file_style::parse (const char *buf, size_t *n_read) if (subexps[DATA_SUBEXP].rm_so == subexps[DATA_SUBEXP].rm_eo) *this = ui_file_style (); - for (regoff_t i = subexps[DATA_SUBEXP].rm_so; - i < subexps[DATA_SUBEXP].rm_eo; + for (regoff_t i = subexps[DATA_SUBEXP].rm_so; i < subexps[DATA_SUBEXP].rm_eo; ++i) { if (buf[i] == ';') @@ -405,6 +400,7 @@ skip_ansi_escape (const char *buf, int *n_read) } void _initialize_ui_style (); + void _initialize_ui_style () { |