Add copyright header in gdb.base/return.c
[deliverable/binutils-gdb.git] / gdb / jv-typeprint.c
index 972edf27af86bf519e140d7ed940ac37c4a22945..00abd9acda3e93598619edb6dfb7a4756cb9c070 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing Java types for GDB, the GNU debugger.
-   Copyright (C) 1997-2014 Free Software Foundation, Inc.
+   Copyright (C) 1997-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,7 +24,6 @@
 #include "demangle.h"
 #include "gdb-demangle.h"
 #include "jv-lang.h"
-#include <string.h>
 #include "typeprint.h"
 #include "c-lang.h"
 #include "cp-abi.h"
@@ -111,7 +110,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
       return;
     }
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
@@ -169,12 +168,12 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
            {
              QUIT;
              /* Don't print out virtual function table.  */
-             if (strncmp (TYPE_FIELD_NAME (type, i), "_vptr", 5) == 0
+             if (startswith (TYPE_FIELD_NAME (type, i), "_vptr")
                  && is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
                continue;
 
              /* Don't print the dummy field "class".  */
-             if (strncmp (TYPE_FIELD_NAME (type, i), "class", 5) == 0)
+             if (startswith (TYPE_FIELD_NAME (type, i), "class"))
                continue;
 
              print_spaces_filtered (level + 4, stream);
@@ -224,7 +223,8 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
              for (j = 0; j < n_overloads; j++)
                {
                  const char *real_physname;
-                 char *physname, *p;
+                 const char *p;
+                 char *physname;
                  int is_full_physname_constructor;
 
                  real_physname = TYPE_FN_FIELD_PHYSNAME (f, j);
@@ -234,7 +234,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
                  p = strrchr (real_physname, ')');
                  gdb_assert (p != NULL);
                  ++p;   /* Keep the trailing ')'.  */
-                 physname = alloca (p - real_physname + 1);
+                 physname = (char *) alloca (p - real_physname + 1);
                  memcpy (physname, real_physname, p - real_physname);
                  physname[p - real_physname] = '\0';
 
This page took 0.028708 seconds and 4 git commands to generate.