* nto-tdep.h: Include osabi.h. Prototypes for generic Neutrino
[deliverable/binutils-gdb.git] / gdb / language.c
index b8ef8c9cb14b85fcea63bc111184162bfbee7efe..cdf35ea6bb617904b07334002bf3b56242787084 100644 (file)
@@ -578,131 +578,6 @@ binop_result_type (struct value *v1, struct value *v2)
 }
 
 #endif /* 0 */
-\f
-
-/* This page contains functions that return format strings for
-   printf for printing out numbers in different formats */
-
-/* Returns the appropriate printf format for hexadecimal
-   numbers. */
-char *
-local_hex_format_custom (char *pre)
-{
-  static char form[50];
-
-  strcpy (form, local_hex_format_prefix ());
-  strcat (form, "%");
-  strcat (form, pre);
-  strcat (form, local_hex_format_specifier ());
-  strcat (form, local_hex_format_suffix ());
-  return form;
-}
-
-/* Converts a LONGEST to custom hexadecimal and stores it in a static
-   string.  Returns a pointer to this string. */
-char *
-local_hex_string (LONGEST num)
-{
-  return local_hex_string_custom (num, "l");
-}
-
-/* Converts a LONGEST number to custom hexadecimal and stores it in a static
-   string.  Returns a pointer to this string. Note that the width parameter
-   should end with "l", e.g. "08l" as with calls to local_hex_string_custom */
-
-char *
-local_hex_string_custom (LONGEST num, char *width)
-{
-#define RESULT_BUF_LEN 50
-  static char res2[RESULT_BUF_LEN];
-  char format[RESULT_BUF_LEN];
-  int field_width;
-  int num_len;
-  int num_pad_chars;
-  char *pad_char;              /* string with one character */
-  int pad_on_left;
-  char *parse_ptr;
-  char temp_nbr_buf[RESULT_BUF_LEN];
-
-  /* Use phex_nz to print the number into a string, then
-     build the result string from local_hex_format_prefix, padding and 
-     the hex representation as indicated by "width".  */
-  strcpy (temp_nbr_buf, phex_nz (num, sizeof (num)));
-  /* parse width */
-  parse_ptr = width;
-  pad_on_left = 1;
-  pad_char = " ";
-  if (*parse_ptr == '-')
-    {
-      parse_ptr++;
-      pad_on_left = 0;
-    }
-  if (*parse_ptr == '0')
-    {
-      parse_ptr++;
-      if (pad_on_left)
-       pad_char = "0";         /* If padding is on the right, it is blank */
-    }
-  field_width = atoi (parse_ptr);
-  num_len = strlen (temp_nbr_buf);
-  num_pad_chars = field_width - strlen (temp_nbr_buf); /* possibly negative */
-
-  if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars
-      >= RESULT_BUF_LEN)               /* paranoia */
-    internal_error (__FILE__, __LINE__,
-                   "local_hex_string_custom: insufficient space to store result");
-
-  strcpy (res2, local_hex_format_prefix ());
-  if (pad_on_left)
-    {
-      while (num_pad_chars > 0)
-       {
-         strcat (res2, pad_char);
-         num_pad_chars--;
-       }
-    }
-  strcat (res2, temp_nbr_buf);
-  if (!pad_on_left)
-    {
-      while (num_pad_chars > 0)
-       {
-         strcat (res2, pad_char);
-         num_pad_chars--;
-       }
-    }
-  return res2;
-
-}                              /* local_hex_string_custom */
-
-/* Returns the appropriate printf format for octal
-   numbers. */
-char *
-local_octal_format_custom (char *pre)
-{
-  static char form[50];
-
-  strcpy (form, local_octal_format_prefix ());
-  strcat (form, "%");
-  strcat (form, pre);
-  strcat (form, local_octal_format_specifier ());
-  strcat (form, local_octal_format_suffix ());
-  return form;
-}
-
-/* Returns the appropriate printf format for decimal numbers. */
-char *
-local_decimal_format_custom (char *pre)
-{
-  static char form[50];
-
-  strcpy (form, local_decimal_format_prefix ());
-  strcat (form, "%");
-  strcat (form, pre);
-  strcat (form, local_decimal_format_specifier ());
-  strcat (form, local_decimal_format_suffix ());
-  return form;
-}
-\f
 #if 0
 /* This page contains functions that are used in type/range checking.
    They all return zero if the type/range check fails.
@@ -1283,7 +1158,7 @@ unknown_language_arch_info (struct gdbarch *gdbarch,
                            struct language_arch_info *lai)
 {
   lai->string_char_type = builtin_type (gdbarch)->builtin_char;
-  lai->primative_type_vector = GDBARCH_OBSTACK_CALLOC (gdbarch, 1,
+  lai->primitive_type_vector = GDBARCH_OBSTACK_CALLOC (gdbarch, 1,
                                                       struct type *);
 }
 
@@ -1294,6 +1169,7 @@ const struct language_defn unknown_language_defn =
   NULL,
   range_check_off,
   type_check_off,
+  array_row_major,
   case_sensitive_on,
   &exp_descriptor_standard,
   unk_lang_parser,
@@ -1312,10 +1188,6 @@ const struct language_defn unknown_language_defn =
   basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,           /* Language specific symbol demangler */
   unk_lang_class_name,         /* Language specific class_name_from_physname */
-  {"", "", "", ""},            /* Binary format info */
-  {"0%lo", "0", "o", ""},      /* Octal format info */
-  {"%ld", "", "d", ""},                /* Decimal format info */
-  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
@@ -1333,6 +1205,7 @@ const struct language_defn auto_language_defn =
   NULL,
   range_check_off,
   type_check_off,
+  array_row_major,
   case_sensitive_on,
   &exp_descriptor_standard,
   unk_lang_parser,
@@ -1351,10 +1224,6 @@ const struct language_defn auto_language_defn =
   basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,           /* Language specific symbol demangler */
   unk_lang_class_name,         /* Language specific class_name_from_physname */
-  {"", "", "", ""},            /* Binary format info */
-  {"0%lo", "0", "o", ""},      /* Octal format info */
-  {"%ld", "", "d", ""},                /* Decimal format info */
-  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
@@ -1372,6 +1241,7 @@ const struct language_defn local_language_defn =
   range_check_off,
   type_check_off,
   case_sensitive_on,
+  array_row_major,
   &exp_descriptor_standard,
   unk_lang_parser,
   unk_lang_error,
@@ -1389,10 +1259,6 @@ const struct language_defn local_language_defn =
   basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,           /* Language specific symbol demangler */
   unk_lang_class_name,         /* Language specific class_name_from_physname */
-  {"", "", "", ""},            /* Binary format info */
-  {"0%lo", "0", "o", ""},      /* Octal format info */
-  {"%ld", "", "d", ""},                /* Decimal format info */
-  {"0x%lx", "0x", "x", ""},    /* Hex format info */
   unk_op_print_tab,            /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
@@ -1420,7 +1286,7 @@ language_gdbarch_post_init (struct gdbarch *gdbarch)
   int i;
 
   l = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct language_gdbarch);
-  for (i = 0; i <= languages_size; i++)
+  for (i = 0; i < languages_size; i++)
     {
       if (languages[i] != NULL
          && languages[i]->la_language_arch_info != NULL)
@@ -1443,16 +1309,16 @@ language_string_char_type (const struct language_defn *la,
 }
 
 struct type *
-language_lookup_primative_type_by_name (const struct language_defn *la,
+language_lookup_primitive_type_by_name (const struct language_defn *la,
                                        struct gdbarch *gdbarch,
                                        const char *name)
 {
   struct language_gdbarch *ld = gdbarch_data (gdbarch,
                                              language_gdbarch_data);
-  if (ld->arch_info[la->la_language].primative_type_vector != NULL)
+  if (ld->arch_info[la->la_language].primitive_type_vector != NULL)
     {
       struct type *const *p;
-      for (p = ld->arch_info[la->la_language].primative_type_vector;
+      for (p = ld->arch_info[la->la_language].primitive_type_vector;
           (*p) != NULL;
           p++)
        {
This page took 0.02582 seconds and 4 git commands to generate.