aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:46:38 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:46:38 -0400
commit7813437494ac39f3aef392d06ed5416e84fe386b (patch)
tree15290bf5b2bd9d23c59103a6a42b99adc0111d6d /gdb/cli
parent67607e24d0413828acdfa9bc38f6fbac40b860b9 (diff)
downloadgdb-7813437494ac39f3aef392d06ed5416e84fe386b.zip
gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.gz
gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.bz2
gdb: remove TYPE_CODE macro
Remove TYPE_CODE, changing all the call sites to use type::code directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_CODE): Remove. Change all call sites to use type::code instead.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c4
-rw-r--r--gdb/cli/cli-utils.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 104d273..58e9cf3 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1912,8 +1912,8 @@ setting_cmd (const char *fnname, struct cmd_list_element *showlist,
struct type *type0 = check_typedef (value_type (argv[0]));
- if (TYPE_CODE (type0) != TYPE_CODE_ARRAY
- && TYPE_CODE (type0) != TYPE_CODE_STRING)
+ if (type0->code () != TYPE_CODE_ARRAY
+ && type0->code () != TYPE_CODE_STRING)
error (_("First argument of %s must be a string."), fnname);
const char *a0 = (const char *) value_contents (argv[0]);
diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
index 7d152a9..710fd52 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/cli/cli-utils.c
@@ -37,7 +37,7 @@ get_ulongest (const char **pp, int trailer)
if (val != NULL) /* Value history reference */
{
- if (TYPE_CODE (value_type (val)) == TYPE_CODE_INT)
+ if (value_type (val)->code () == TYPE_CODE_INT)
retval = value_as_long (val);
else
error (_("History value must have integer type."));
@@ -96,7 +96,7 @@ get_number_trailer (const char **pp, int trailer)
if (val) /* Value history reference */
{
- if (TYPE_CODE (value_type (val)) == TYPE_CODE_INT)
+ if (value_type (val)->code () == TYPE_CODE_INT)
retval = value_as_long (val);
else
{