aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-style.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:36:23 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:46:02 -0500
commitc583a2520616c2736cffc389c89a48b159366e6c (patch)
treeb4925f26506fcee96c16119431c01760f05db95d /gdb/ui-style.h
parentca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff)
downloadgdb-users/simark/clang-format.zip
gdb-users/simark/clang-format.tar.gz
gdb-users/simark/clang-format.tar.bz2
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdb/ui-style.h')
-rw-r--r--gdb/ui-style.h55
1 files changed, 14 insertions, 41 deletions
diff --git a/gdb/ui-style.h b/gdb/ui-style.h
index 5d19fab..a5bdafd 100644
--- a/gdb/ui-style.h
+++ b/gdb/ui-style.h
@@ -73,7 +73,7 @@ struct ui_file_style
&& m_blue == other.m_blue);
}
- bool operator< (const color &other) const
+ bool operator<(const color &other) const
{
if (m_simple != other.m_simple)
return m_simple < other.m_simple;
@@ -92,10 +92,7 @@ struct ui_file_style
}
/* Return true if this is the "NONE" color, false otherwise. */
- bool is_none () const
- {
- return m_simple && m_value == NONE;
- }
+ bool is_none () const { return m_simple && m_value == NONE; }
/* Return true if this is one of the basic colors, false
otherwise. */
@@ -126,9 +123,11 @@ struct ui_file_style
private:
bool m_simple;
+
union
{
int m_value;
+
struct
{
uint8_t m_red, m_green, m_blue;
@@ -173,54 +172,31 @@ struct ui_file_style
otherwise. */
bool is_default () const
{
- return (m_foreground == NONE
- && m_background == NONE
- && m_intensity == NORMAL
- && !m_reverse);
+ return (m_foreground == NONE && m_background == NONE
+ && m_intensity == NORMAL && !m_reverse);
}
/* Return true if this style specified reverse display; false
otherwise. */
- bool is_reverse () const
- {
- return m_reverse;
- }
+ bool is_reverse () const { return m_reverse; }
/* Set/clear the reverse display flag. */
- void set_reverse (bool reverse)
- {
- m_reverse = reverse;
- }
+ void set_reverse (bool reverse) { m_reverse = reverse; }
/* Return the foreground color of this style. */
- const color &get_foreground () const
- {
- return m_foreground;
- }
+ const color &get_foreground () const { return m_foreground; }
/* Set the foreground color of this style. */
- void set_fg (color c)
- {
- m_foreground = c;
- }
+ void set_fg (color c) { m_foreground = c; }
/* Return the background color of this style. */
- const color &get_background () const
- {
- return m_background;
- }
+ const color &get_background () const { return m_background; }
/* Set the background color of this style. */
- void set_bg (color c)
- {
- m_background = c;
- }
+ void set_bg (color c) { m_background = c; }
/* Return the intensity of this style. */
- intensity get_intensity () const
- {
- return m_intensity;
- }
+ intensity get_intensity () const { return m_intensity; }
/* Parse an ANSI escape sequence in BUF, modifying this style. BUF
must begin with an ESC character. Return true if an escape
@@ -230,10 +206,7 @@ struct ui_file_style
bool parse (const char *buf, size_t *n_read);
/* We need this because we can't pass a reference via va_args. */
- const ui_file_style *ptr () const
- {
- return this;
- }
+ const ui_file_style *ptr () const { return this; }
private: