summaryrefslogtreecommitdiff
path: root/gdb/python/py-type.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-type.c')
-rw-r--r--gdb/python/py-type.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 4b57e1638ed..dbe25ad8f6c 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -1150,7 +1150,7 @@ typy_length (PyObject *self)
if (type == NULL)
return -1;
- return TYPE_NFIELDS (type);
+ return type->num_fields ();
}
/* Implements boolean evaluation of gdb.Type. Handle this like other
@@ -1193,7 +1193,7 @@ typy_getitem (PyObject *self, PyObject *key)
if (type == NULL)
return NULL;
- for (i = 0; i < TYPE_NFIELDS (type); i++)
+ for (i = 0; i < type->num_fields (); i++)
{
const char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -1251,7 +1251,7 @@ typy_has_key (PyObject *self, PyObject *args)
if (type == NULL)
return NULL;
- for (i = 0; i < TYPE_NFIELDS (type); i++)
+ for (i = 0; i < type->num_fields (); i++)
{
const char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -1336,7 +1336,7 @@ typy_iterator_iternext (PyObject *self)
typy_iterator_object *iter_obj = (typy_iterator_object *) self;
struct type *type = iter_obj->source->type;
- if (iter_obj->field < TYPE_NFIELDS (type))
+ if (iter_obj->field < type->num_fields ())
{
gdbpy_ref<> result = make_fielditem (type, iter_obj->field,
iter_obj->kind);