New common function "startswith"
[deliverable/binutils-gdb.git] / gdb / p-typeprint.c
index 5a7a887253b60b14fc6dff7177c1c9a562723002..b5bf4d456ec32675f2efd5d30131d82025cb6028 100644 (file)
@@ -154,8 +154,8 @@ void
 pascal_type_print_method_args (const char *physname, const char *methodname,
                               struct ui_file *stream)
 {
-  int is_constructor = (strncmp (physname, "__ct__", 6) == 0);
-  int is_destructor = (strncmp (physname, "__dt__", 6) == 0);
+  int is_constructor = (startswith (physname, "__ct__"));
+  int is_destructor = (startswith (physname, "__dt__"));
 
   if (is_constructor || is_destructor)
     {
@@ -567,7 +567,7 @@ pascal_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;
 
@@ -643,8 +643,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
                {
                  const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
 
-                 int is_constructor = (strncmp (physname, "__ct__", 6) == 0);
-                 int is_destructor = (strncmp (physname, "__dt__", 6) == 0);
+                 int is_constructor = (startswith (physname, "__ct__"));
+                 int is_destructor = (startswith (physname, "__dt__"));
 
                  QUIT;
                  if (TYPE_FN_FIELD_PROTECTED (f, j))
This page took 0.024165 seconds and 4 git commands to generate.