aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2016-12-02 17:12:37 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2016-12-02 17:12:37 -0500
commitbef721e278d9ba3178e679eda38ac86ef2dc0d5d (patch)
tree51e9142e61cac94c8f34ebaab19ef5855a365eaf /gdb/ui-out.h
parent107c2d628b924de1854d6d254d60e97e1887ce4a (diff)
Introduce enum_flag type for ui_out flags
This patch changes the ui_out flags to be an enum flag. gdb/ChangeLog: * ui-out.h: Include "common/enum-flags.h". (enum ui_flags): Rename to ... (enum ui_out_flag): ... this. (ui_out_flags): Define enum flag type. (ui_out_test_flags): Change type of parameter to ui_out_flags. (ui_out_new): Likewise. * ui-out.c (ui_out_test_flags): Likewise. (ui_out_new): Likewise. * cli-out.c (cli_out_new): Update variable type. * mi/mi-out.c (mi_out_new): Likewise. * tui/tui-out.c (tui_out_new): Likewise.
Diffstat (limited to 'gdb/ui-out.h')
-rw-r--r--gdb/ui-out.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 06c05e2f3a..cdf567148f 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -23,6 +23,8 @@
#ifndef UI_OUT_H
#define UI_OUT_H 1
+#include "common/enum-flags.h"
+
/* The ui_out structure */
struct ui_out;
@@ -45,12 +47,12 @@ enum ui_align
};
/* flags enum */
-enum ui_flags
+enum ui_out_flag
{
- ui_from_tty = 1,
- ui_source_list = 2
+ ui_source_list = (1 << 0),
};
+DEF_ENUM_FLAGS_TYPE (ui_out_flag, ui_out_flags);
/* Prototypes for ui-out API. */
@@ -127,7 +129,7 @@ extern void ui_out_wrap_hint (struct ui_out *uiout, const char *identstring);
extern void ui_out_flush (struct ui_out *uiout);
-extern int ui_out_test_flags (struct ui_out *uiout, int mask);
+extern int ui_out_test_flags (struct ui_out *uiout, ui_out_flags mask);
extern int ui_out_query_field (struct ui_out *uiout, int colno,
int *width, int *alignment,
@@ -222,9 +224,8 @@ extern void uo_field_string (struct ui_out *uiout, int fldno, int width,
/* Create a ui_out object */
-extern struct ui_out *ui_out_new (const struct ui_out_impl *impl,
- void *data,
- int flags);
+extern struct ui_out *ui_out_new (const struct ui_out_impl *impl, void *data,
+ ui_out_flags flags);
/* Redirect the ouptut of a ui_out object temporarily. */