/* Python interface to types.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GDB.
static PyObject *
typy_array (PyObject *self, PyObject *args)
{
- int n1, n2;
+ long n1, n2;
PyObject *n2_obj = NULL;
struct type *array = NULL;
struct type *type = ((type_object *) self)->type;
volatile struct gdb_exception except;
- if (! PyArg_ParseTuple (args, "i|O", &n1, &n2_obj))
+ if (! PyArg_ParseTuple (args, "l|O", &n1, &n2_obj))
return NULL;
if (n2_obj)
_("Array bound must be an integer"));
return NULL;
}
- n2 = (int) PyInt_AsLong (n2_obj);
- if (PyErr_Occurred ())
+
+ if (! gdb_py_int_as_long (n2_obj, &n2))
return NULL;
}
else
}
static struct type *
-typy_lookup_typename (char *type_name, struct block *block)
+typy_lookup_typename (const char *type_name, struct block *block)
{
struct type *type = NULL;
volatile struct gdb_exception except;
gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw)
{
static char *keywords[] = { "name", "block", NULL };
- char *type_name = NULL;
+ const char *type_name = NULL;
struct type *type = NULL;
PyObject *block_obj = NULL;
struct block *block = NULL;