aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-float.c
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/target-float.c
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/target-float.c')
-rw-r--r--gdb/target-float.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/target-float.c b/gdb/target-float.c
index 1bdd3ef..83ef98a 100644
--- a/gdb/target-float.c
+++ b/gdb/target-float.c
@@ -1742,7 +1742,7 @@ mpfr_float_ops::compare (const gdb_byte *x, const struct type *type_x,
static void
match_endianness (const gdb_byte *from, const struct type *type, gdb_byte *to)
{
- gdb_assert (TYPE_CODE (type) == TYPE_CODE_DECFLOAT);
+ gdb_assert (type->code () == TYPE_CODE_DECFLOAT);
int len = TYPE_LENGTH (type);
int i;
@@ -1768,7 +1768,7 @@ match_endianness (const gdb_byte *from, const struct type *type, gdb_byte *to)
static void
set_decnumber_context (decContext *ctx, const struct type *type)
{
- gdb_assert (TYPE_CODE (type) == TYPE_CODE_DECFLOAT);
+ gdb_assert (type->code () == TYPE_CODE_DECFLOAT);
switch (TYPE_LENGTH (type))
{
@@ -2142,7 +2142,7 @@ static bool
target_float_same_category_p (const struct type *type1,
const struct type *type2)
{
- return TYPE_CODE (type1) == TYPE_CODE (type2);
+ return type1->code () == type2->code ();
}
/* Return whether TYPE1 and TYPE2 use the same floating-point format. */
@@ -2153,7 +2153,7 @@ target_float_same_format_p (const struct type *type1,
if (!target_float_same_category_p (type1, type2))
return false;
- switch (TYPE_CODE (type1))
+ switch (type1->code ())
{
case TYPE_CODE_FLT:
return floatformat_from_type (type1) == floatformat_from_type (type2);
@@ -2173,7 +2173,7 @@ target_float_same_format_p (const struct type *type1,
static int
target_float_format_length (const struct type *type)
{
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_FLT:
return floatformat_totalsize_bytes (floatformat_from_type (type));
@@ -2205,7 +2205,7 @@ enum target_float_ops_kind
static enum target_float_ops_kind
get_target_float_ops_kind (const struct type *type)
{
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_FLT:
{
@@ -2300,7 +2300,7 @@ get_target_float_ops (const struct type *type)
static const target_float_ops *
get_target_float_ops (const struct type *type1, const struct type *type2)
{
- gdb_assert (TYPE_CODE (type1) == TYPE_CODE (type2));
+ gdb_assert (type1->code () == type2->code ());
enum target_float_ops_kind kind1 = get_target_float_ops_kind (type1);
enum target_float_ops_kind kind2 = get_target_float_ops_kind (type2);
@@ -2315,10 +2315,10 @@ get_target_float_ops (const struct type *type1, const struct type *type2)
bool
target_float_is_valid (const gdb_byte *addr, const struct type *type)
{
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ if (type->code () == TYPE_CODE_FLT)
return floatformat_is_valid (floatformat_from_type (type), addr);
- if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
+ if (type->code () == TYPE_CODE_DECFLOAT)
return true;
gdb_assert_not_reached ("unexpected type code");
@@ -2329,11 +2329,11 @@ target_float_is_valid (const gdb_byte *addr, const struct type *type)
bool
target_float_is_zero (const gdb_byte *addr, const struct type *type)
{
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ if (type->code () == TYPE_CODE_FLT)
return (floatformat_classify (floatformat_from_type (type), addr)
== float_zero);
- if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
+ if (type->code () == TYPE_CODE_DECFLOAT)
return decimal_is_zero (addr, type);
gdb_assert_not_reached ("unexpected type code");
@@ -2347,7 +2347,7 @@ target_float_to_string (const gdb_byte *addr, const struct type *type,
{
/* Unless we need to adhere to a specific format, provide special
output for special cases of binary floating-point numbers. */
- if (format == nullptr && TYPE_CODE (type) == TYPE_CODE_FLT)
+ if (format == nullptr && type->code () == TYPE_CODE_FLT)
{
const struct floatformat *fmt = floatformat_from_type (type);