It turns out that 1.2 wasn't botched after all. (I was failing to take
[deliverable/binutils-gdb.git] / gdb / language.c
index 05f710f4f674679d66bcc509799edeb89a52dbbe..20d2adb66c022543e4e8174dd48e9dee5a62be91 100644 (file)
@@ -1,5 +1,5 @@
 /* Multiple source language support for GDB.
-   Copyright 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1991, 1992, 2000 Free Software Foundation, Inc.
    Contributed by the Department of Computer Science at the State University
    of New York at Buffalo.
 
@@ -86,27 +86,25 @@ set_check PARAMS ((char *, int));
 static void
 set_type_range PARAMS ((void));
 
-static void
-unk_lang_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
+static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter);
 
-static void
-unk_lang_printchar PARAMS ((int c, GDB_FILE * stream));
+static void unk_lang_printchar (int c, struct ui_file *stream);
 
-static void
-unk_lang_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
+static void unk_lang_printstr (struct ui_file * stream, char *string,
+                              unsigned int length, int width,
+                              int force_ellipses);
 
 static struct type *
   unk_lang_create_fundamental_type PARAMS ((struct objfile *, int));
 
-static void
-unk_lang_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+static void unk_lang_print_type (struct type *, char *, struct ui_file *,
+                                int, int);
 
-static int
-unk_lang_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
-                           int, int, int, enum val_prettyprint));
+static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR,
+                              struct ui_file *, int, int, int,
+                              enum val_prettyprint);
 
-static int
-unk_lang_value_print PARAMS ((value_ptr, GDB_FILE *, int, enum val_prettyprint));
+static int unk_lang_value_print (value_ptr, struct ui_file *, int, enum val_prettyprint);
 
 /* Forward declaration */
 extern const struct language_defn unknown_language_defn;
@@ -396,7 +394,8 @@ set_lang_str ()
 {
   char *prefix = "";
 
-  free (language);
+  if (language)
+    free (language);
   if (language_mode == language_mode_auto)
     prefix = "auto; currently ";
 
@@ -408,7 +407,8 @@ set_type_str ()
 {
   char *tmp = NULL, *prefix = "";
 
-  free (type);
+  if (type)
+    free (type);
   if (type_mode == type_mode_auto)
     prefix = "auto; currently ";
 
@@ -453,7 +453,8 @@ set_range_str ()
       error ("Unrecognized range check setting.");
     }
 
-  free (range);
+  if (range)
+    free (range);
   range = concat (pref, tmp, NULL);
 }
 
@@ -547,6 +548,11 @@ local_hex_format_custom (pre)
   return form;
 }
 
+#if 0
+/* FIXME: cagney/2000-03-04: This function does not appear to be used.
+   It can be deleted once 5.0 has been released. */
+/* FIXME: cagney/2000-03-04: This code assumes that the compiler
+   supports ``long long''. */
 /* Converts a number to hexadecimal (without leading "0x") and stores it in a
    static string.  Returns a pointer to this string. */
 
@@ -564,6 +570,7 @@ longest_raw_hex_string (num)
   sprintf (res_longest_raw_hex_string, "%llx", ll);
   return res_longest_raw_hex_string;
 }
+#endif
 
 /* Converts a number to hexadecimal and stores it in a static
    string.  Returns a pointer to this string. */
@@ -626,9 +633,7 @@ longest_local_hex_string_custom (num, width)
      can use local_hex_string_custom 
    */
   return local_hex_string_custom ((unsigned long) num, width);
-#endif
-
-#if defined (PRINTF_HAS_LONG_LONG)
+#elif defined (PRINTF_HAS_LONG_LONG)
   /* Just use printf.  */
   strcpy (format, local_hex_format_prefix ()); /* 0x */
   strcat (format, "%");
@@ -1364,7 +1369,7 @@ unk_lang_error (msg)
 static void
 unk_lang_emit_char (c, stream, quoter)
      register int c;
-     GDB_FILE *stream;
+     struct ui_file *stream;
      int quoter;
 {
   error ("internal error - unimplemented function unk_lang_emit_char called.");
@@ -1373,14 +1378,14 @@ unk_lang_emit_char (c, stream, quoter)
 static void
 unk_lang_printchar (c, stream)
      register int c;
-     GDB_FILE *stream;
+     struct ui_file *stream;
 {
   error ("internal error - unimplemented function unk_lang_printchar called.");
 }
 
 static void
 unk_lang_printstr (stream, string, length, width, force_ellipses)
-     GDB_FILE *stream;
+     struct ui_file *stream;
      char *string;
      unsigned int length;
      int width;
@@ -1401,7 +1406,7 @@ static void
 unk_lang_print_type (type, varstring, stream, show, level)
      struct type *type;
      char *varstring;
-     GDB_FILE *stream;
+     struct ui_file *stream;
      int show;
      int level;
 {
@@ -1415,7 +1420,7 @@ unk_lang_val_print (type, valaddr, embedded_offset, address, stream, format, der
      char *valaddr;
      int embedded_offset;
      CORE_ADDR address;
-     GDB_FILE *stream;
+     struct ui_file *stream;
      int format;
      int deref_ref;
      int recurse;
@@ -1427,7 +1432,7 @@ unk_lang_val_print (type, valaddr, embedded_offset, address, stream, format, der
 static int
 unk_lang_value_print (val, stream, format, pretty)
      value_ptr val;
-     GDB_FILE *stream;
+     struct ui_file *stream;
      int format;
      enum val_prettyprint pretty;
 {
This page took 0.026091 seconds and 4 git commands to generate.