diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2015-11-17 13:31:29 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-11-17 13:31:29 +0000 |
commit | 0c801b966379f7826fdd793b26ae879c2edf78d1 (patch) | |
tree | 7fbfb4292f6c342d0e0902a9d744c338355fa100 /gdb/c-exp.y | |
parent | 8d297bbf604c8318ffc72d5a7b3db654409c5ed9 (diff) | |
download | gdb-0c801b966379f7826fdd793b26ae879c2edf78d1.zip gdb-0c801b966379f7826fdd793b26ae879c2edf78d1.tar.gz gdb-0c801b966379f7826fdd793b26ae879c2edf78d1.tar.bz2 |
Convert c_string_type to an enum flags type
c_string_type contains values meant to be OR'ed together (even though
some bits are mutually exclusive), so it makes sense to make it an
enum flags type.
gdb/ChangeLog:
2015-11-17 Simon Marchi <simon.marchi@ericsson.com>
* c-exp.y (exp): Adjust, change enum c_string_type to
c_string_type.
(parse_string_or_char): Likewise.
* c-lang.c (charset_for_string_type): Likewise.
(classify_type): Likewise.
(c_printchar): Likewise.
(c_printstr): Likewise.
(evaluate_subexp_c): Likewise. And change cast to enum
c_string_type_values.
* c-lang.h: Include "common/enum_flags.h".
(enum c_string_type): Rename to...
(enum c_string_type_values): ...this.
(c_string_type): Define new enum flags type.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index f2de0ae..9127756 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -864,7 +864,7 @@ string_exp: exp : string_exp { int i; - enum c_string_type type = C_STRING; + c_string_type type = C_STRING; for (i = 0; i < $1.len; ++i) { @@ -878,7 +878,7 @@ exp : string_exp if (type != C_STRING && type != $1.tokens[i].type) error (_("Undefined string concatenation.")); - type = (enum c_string_type) $1.tokens[i].type; + type = (enum c_string_type_values) $1.tokens[i].type; break; default: /* internal error */ @@ -2164,7 +2164,7 @@ parse_string_or_char (const char *tokptr, const char **outptr, struct typed_stoken *value, int *host_chars) { int quote; - enum c_string_type type; + c_string_type type; int is_objc = 0; /* Build the gdb internal form of the input string in tempbuf. Note |