* f-typeprint.c (f_type_print_varspec_suffix): Convert the autovariable
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 11 Jan 2009 21:39:02 +0000 (21:39 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 11 Jan 2009 21:39:02 +0000 (21:39 +0000)
arrayprint_recurse_level to a parameter.  Update all the callers.  New
comment at autovariables.

gdb/ChangeLog
gdb/f-typeprint.c

index 346f67df8c82f1e1e5fb1bda9f1a9334c7e66d1a..b2de10b8463cbb02f5c8dabb9c565c3b43ad09ea 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * f-typeprint.c (f_type_print_varspec_suffix): Convert the autovariable
+       arrayprint_recurse_level to a parameter.  Update all the callers.  New
+       comment at autovariables.
+
 2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdbtypes.c (make_qualified_type, replace_type): Reformat to the GNU
index f5c10ab342a5fad4988d07c54e29b0480056a9fa..6c9668f00e2c0ae320dfcfddea26e1599b063552 100644 (file)
@@ -39,7 +39,7 @@
 static void f_type_print_args (struct type *, struct ui_file *);
 #endif
 
-static void f_type_print_varspec_suffix (struct type *, struct ui_file *,
+static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int,
                                         int, int, int);
 
 void f_type_print_varspec_prefix (struct type *, struct ui_file *,
@@ -80,7 +80,7 @@ f_print_type (struct type *type, char *varstring, struct ui_file *stream,
          so don't print an additional pair of ()'s */
 
       demangled_args = varstring[strlen (varstring) - 1] == ')'; 
-      f_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
+      f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0);
    }
 }
 
@@ -150,11 +150,13 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
 
 static void
 f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
-                            int show, int passed_a_ptr, int demangled_args)
+                            int show, int passed_a_ptr, int demangled_args,
+                            int arrayprint_recurse_level)
 {
   int upper_bound, lower_bound;
-  static int arrayprint_recurse_level = 0;
   int retcode;
+  /* No static variables are permitted as an error call may occur during
+     execution of this function.  */
 
   if (type == 0)
     return;
@@ -173,7 +175,8 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
        fprintf_filtered (stream, "(");
 
       if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
+       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0,
+                                    arrayprint_recurse_level);
 
       lower_bound = f77_get_lowerbound (type);
       if (lower_bound != 1)    /* Not the default.  */
@@ -191,7 +194,8 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
        }
 
       if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
+       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0,
+                                    arrayprint_recurse_level);
       if (arrayprint_recurse_level == 1)
        fprintf_filtered (stream, ")");
       else
@@ -201,13 +205,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
 
     case TYPE_CODE_PTR:
     case TYPE_CODE_REF:
-      f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0);
+      f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
+                                  arrayprint_recurse_level);
       fprintf_filtered (stream, ")");
       break;
 
     case TYPE_CODE_FUNC:
       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-                                  passed_a_ptr, 0);
+                                  passed_a_ptr, 0, arrayprint_recurse_level);
       if (passed_a_ptr)
        fprintf_filtered (stream, ")");
 
@@ -361,7 +366,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
          fputs_filtered (" :: ", stream);
          fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
          f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
-                                      stream, 0, 0, 0);
+                                      stream, 0, 0, 0, 0);
          fputs_filtered ("\n", stream);
        } 
       fprintfi_filtered (level, stream, "End Type ");
This page took 0.029897 seconds and 4 git commands to generate.