* target.h: Add enum target_waitkind, enum target_signal, and
[deliverable/binutils-gdb.git] / gdb / c-lang.c
index bfa03d0a590f080a4358f295a1b3e2d38f867c0d..c639d5381c705440dbfdbc6553c2cf412bd43166 100644 (file)
@@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 static void
 emit_char (c, stream, quoter)
      register int c;
-     FILE *stream;
+     GDB_FILE *stream;
      int quoter;
 {
 
@@ -81,7 +81,7 @@ emit_char (c, stream, quoter)
 static void
 c_printchar (c, stream)
      int c;
-     FILE *stream;
+     GDB_FILE *stream;
 {
   fputs_filtered ("'", stream);
   emit_char (c, stream, '\'');
@@ -95,7 +95,7 @@ c_printchar (c, stream)
 
 static void
 c_printstr (stream, string, length, force_ellipses)
-     FILE *stream;
+     GDB_FILE *stream;
      char *string;
      unsigned int length;
      int force_ellipses;
@@ -111,12 +111,12 @@ c_printstr (stream, string, length, force_ellipses)
   /* If the string was not truncated due to `set print elements', and
      the last byte of it is a null, we don't print that, in traditional C
      style.  */
-  if ((!force_ellipses) && string[length-1] == '\0')
+  if ((!force_ellipses) && length > 0 && string[length-1] == '\0')
     length--;
 
   if (length == 0)
     {
-      fputs_filtered ("\"\"", stdout);
+      fputs_filtered ("\"\"", stream);
       return;
     }
 
@@ -243,7 +243,7 @@ c_create_fundamental_type (objfile, typeid)
       case FT_SIGNED_CHAR:
        type = init_type (TYPE_CODE_INT,
                          TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-                         TYPE_FLAG_SIGNED, "signed char", objfile);
+                         0, "signed char", objfile);
        break;
       case FT_UNSIGNED_CHAR:
        type = init_type (TYPE_CODE_INT,
@@ -258,7 +258,7 @@ c_create_fundamental_type (objfile, typeid)
       case FT_SIGNED_SHORT:
        type = init_type (TYPE_CODE_INT,
                          TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-                         TYPE_FLAG_SIGNED, "short", objfile);  /* FIXME-fnf */
+                         0, "short", objfile); /* FIXME-fnf */
        break;
       case FT_UNSIGNED_SHORT:
        type = init_type (TYPE_CODE_INT,
@@ -273,7 +273,7 @@ c_create_fundamental_type (objfile, typeid)
       case FT_SIGNED_INTEGER:
        type = init_type (TYPE_CODE_INT,
                          TARGET_INT_BIT / TARGET_CHAR_BIT,
-                         TYPE_FLAG_SIGNED, "int", objfile); /* FIXME -fnf */
+                         0, "int", objfile); /* FIXME -fnf */
        break;
       case FT_UNSIGNED_INTEGER:
        type = init_type (TYPE_CODE_INT,
@@ -288,7 +288,7 @@ c_create_fundamental_type (objfile, typeid)
       case FT_SIGNED_LONG:
        type = init_type (TYPE_CODE_INT,
                          TARGET_LONG_BIT / TARGET_CHAR_BIT,
-                         TYPE_FLAG_SIGNED, "long", objfile); /* FIXME -fnf */
+                         0, "long", objfile); /* FIXME -fnf */
        break;
       case FT_UNSIGNED_LONG:
        type = init_type (TYPE_CODE_INT,
@@ -303,7 +303,7 @@ c_create_fundamental_type (objfile, typeid)
       case FT_SIGNED_LONG_LONG:
        type = init_type (TYPE_CODE_INT,
                          TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-                         TYPE_FLAG_SIGNED, "signed long long", objfile);
+                         0, "signed long long", objfile);
        break;
       case FT_UNSIGNED_LONG_LONG:
        type = init_type (TYPE_CODE_INT,
@@ -408,9 +408,9 @@ const struct language_defn c_language_defn = {
   &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
   &builtin_type_double,                /* longest floating point type */ /*FIXME*/
   {"",     "",    "",  ""},    /* Binary format info */
-  {"0%o",  "0",   "o", ""},    /* Octal format info */
-  {"%d",   "",    "d", ""},    /* Decimal format info */
-  {"0x%x", "0x",  "x", ""},    /* Hex format info */
+  {"0%lo",  "0",   "o", ""},   /* Octal format info */
+  {"%ld",   "",    "d", ""},   /* Decimal format info */
+  {"0x%lx", "0x",  "x", ""},   /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   LANG_MAGIC
 };
@@ -432,9 +432,9 @@ const struct language_defn cplus_language_defn = {
   &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
   &builtin_type_double,                /* longest floating point type */ /*FIXME*/
   {"",      "",    "",   ""},  /* Binary format info */
-  {"0%o",   "0",   "o",  ""},  /* Octal format info */
-  {"%d",    "",    "d",  ""},  /* Decimal format info */
-  {"0x%x",  "0x",  "x",  ""},  /* Hex format info */
+  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
+  {"%ld",    "",    "d",  ""}, /* Decimal format info */
+  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   LANG_MAGIC
 };
This page took 0.024789 seconds and 4 git commands to generate.