* varobj.c (update_dynamic_varobj_children): Make 'name' const.
[deliverable/binutils-gdb.git] / gdb / python / py-type.c
index 82324366d1bbaf75149486fdda1a7a26c6d54611..8ab18cfa82f1bd2cf09774da765ef3f8a28ba970 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -276,13 +276,13 @@ typy_strip_typedefs (PyObject *self, PyObject *args)
 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)
@@ -293,8 +293,8 @@ typy_array (PyObject *self, PyObject *args)
                           _("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
@@ -497,7 +497,7 @@ typy_get_sizeof (PyObject *self, void *closure)
 }
 
 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;
@@ -1020,7 +1020,7 @@ PyObject *
 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;
This page took 0.033176 seconds and 4 git commands to generate.