diff options
author | Tom Tromey <tromey@redhat.com> | 2014-10-22 06:08:20 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-02-27 17:29:11 +0000 |
commit | 570dc176ff0e33525c4c1db981de87aa0dce742e (patch) | |
tree | e5dea18a7b0303857dce008018167a9cb9134ecd /gdb/arm-tdep.c | |
parent | 68c14faadaf5bfd9816ac913dc8858116aa15a84 (diff) | |
download | gdb-570dc176ff0e33525c4c1db981de87aa0dce742e.zip gdb-570dc176ff0e33525c4c1db981de87aa0dce742e.tar.gz gdb-570dc176ff0e33525c4c1db981de87aa0dce742e.tar.bz2 |
Do not increment of decrement enums
In C++, we can't do arithmetic on enums. This patch fixes build errors like:
src/gdb/i386-tdep.c: In function ‘int i386_stap_parse_special_token(gdbarch*, stap_parse_info*)’:
src/gdb/i386-tdep.c:4309:7: error: no match for ‘operator++’ (operand type is ‘i386_stap_parse_special_token(gdbarch*, stap_parse_info*)::<anonymous enum>’)
++current_state;
^
...
src/gdb/rs6000-tdep.c:4265:18: error: no match for ‘operator++’ (operand type is ‘powerpc_vector_abi’)
src/gdb/arm-tdep.c:9428:71: error: no match for ‘operator++’ (operand type is ‘arm_float_model’)
src/gdb/arm-tdep.c:9465:64: error: no match for ‘operator++’ (operand type is ‘arm_abi_kind’)
...
gdb/ChangeLog:
2015-02-27 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com>
* arm-tdep.c (set_fp_model_sfunc, arm_set_abi): Use 'int' for
local used to iterate over enums.
* completer.c (signal_completer): Likewise.
* i386-tdep.c (i386_stap_parse_special_token): Likewise.
* rs6000-tdep.c (powerpc_set_vector_abi): Likewise.
* tui/tui-data.c (tui_next_win, tui_prev_win): Likewise.
* tui/tui-layout.c (next_layout, prev_layout): Likewise.
* tui/tui-win.c (tui_refresh_all_win, tui_rehighlight_all)
(tui_resize_all, tui_set_focus_command, tui_all_windows_info): Likewise.
* tui-wingeneral.c (tui_refresh_all): Likewise.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r-- | gdb/arm-tdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f3a6325..4f9bb40 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -9405,7 +9405,7 @@ static void set_fp_model_sfunc (char *args, int from_tty, struct cmd_list_element *c) { - enum arm_float_model fp_model; + int fp_model; for (fp_model = ARM_FLOAT_AUTO; fp_model != ARM_FLOAT_LAST; fp_model++) if (strcmp (current_fp_model, fp_model_strings[fp_model]) == 0) @@ -9442,7 +9442,7 @@ static void arm_set_abi (char *args, int from_tty, struct cmd_list_element *c) { - enum arm_abi_kind arm_abi; + int arm_abi; for (arm_abi = ARM_ABI_AUTO; arm_abi != ARM_ABI_LAST; arm_abi++) if (strcmp (arm_abi_string, arm_abi_strings[arm_abi]) == 0) |