/* Support for printing C and C++ types for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001, 2002
+ 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
c_print_type (struct type *type, char *varstring, struct ui_file *stream,
int show, int level)
{
- register enum type_code code;
+ enum type_code code;
int demangled_args;
int need_post_space;
case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TEMPLATE:
+ case TYPE_CODE_NAMESPACE:
/* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */
break;
case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TEMPLATE:
+ case TYPE_CODE_NAMESPACE:
/* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been considered. */
break;
QUIT;
/* Don't print out virtual function table. */
/* HP ANSI C++ case */
- if (TYPE_HAS_VTABLE (type) && (STREQN (TYPE_FIELD_NAME (type, i), "__vfp", 5)))
+ if (TYPE_HAS_VTABLE (type)
+ && (strncmp (TYPE_FIELD_NAME (type, i), "__vfp", 5) == 0))
continue;
/* Other compilers */
- if (STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
+ if (strncmp (TYPE_FIELD_NAME (type, i), "_vptr", 5) == 0
&& is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
continue;
int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
char *name = type_name_no_tag (type);
- int is_constructor = name && STREQ (method_name, name);
+ int is_constructor = name && strcmp (method_name, name) == 0;
for (j = 0; j < len2; j++)
{
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
}
break;
+ case TYPE_CODE_NAMESPACE:
+ fputs_filtered ("namespace ", stream);
+ fputs_filtered (TYPE_TAG_NAME (type), stream);
+ break;
+
default:
/* Handle types not explicitly handled by the other cases,
such as fundamental types. For these, just print whatever