Reset pagination counts even when stdin is not a tty.
[deliverable/binutils-gdb.git] / gdb / top.c
index 65143d1bba355f41be6e40d5b700d6561fd4d849..a45f3cc8cc4d3bdf1d3f3fad8dc002c721e377ff 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -278,7 +278,7 @@ void
 do_restore_instream_cleanup (void *stream)
 {
   /* Restore the previous input stream.  */
-  instream = stream;
+  instream = (FILE *) stream;
 }
 
 /* Read commands from STREAM.  */
@@ -367,6 +367,16 @@ check_frame_language_change (void)
 
 /* See top.h.  */
 
+void
+wait_sync_command_done (void)
+{
+  while (gdb_do_one_event () >= 0)
+    if (!sync_execution)
+      break;
+}
+
+/* See top.h.  */
+
 void
 maybe_wait_sync_command_done (int was_sync)
 {
@@ -375,11 +385,7 @@ maybe_wait_sync_command_done (int was_sync)
      just ran a synchronous command that started the target, wait
      for that command to end.  */
   if (!interpreter_async && !was_sync && sync_execution)
-    {
-      while (gdb_do_one_event () >= 0)
-       if (!sync_execution)
-         break;
-    }
+    wait_sync_command_done ();
 }
 
 /* Execute the line P as a command, in the current user context.
@@ -536,7 +542,6 @@ command_loop (void)
 {
   struct cleanup *old_chain;
   char *command;
-  int stdin_is_tty = ISATTY (stdin);
 
   while (instream && !feof (instream))
     {
@@ -544,7 +549,7 @@ command_loop (void)
        (*window_hook) (instream, get_prompt ());
 
       clear_quit_flag ();
-      if (instream == stdin && stdin_is_tty)
+      if (instream == stdin)
        reinitialize_more_filter ();
       old_chain = make_cleanup (null_cleanup, 0);
 
@@ -807,7 +812,8 @@ struct gdb_readline_wrapper_cleanup
 static void
 gdb_readline_wrapper_cleanup (void *arg)
 {
-  struct gdb_readline_wrapper_cleanup *cleanup = arg;
+  struct gdb_readline_wrapper_cleanup *cleanup
+    = (struct gdb_readline_wrapper_cleanup *) arg;
 
   rl_already_prompted = cleanup->already_prompted_orig;
 
@@ -1059,8 +1065,9 @@ command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix)
     {
       char *local_prompt;
 
-      local_prompt = alloca ((prompt == NULL ? 0 : strlen (prompt))
-                            + strlen (annotation_suffix) + 40);
+      local_prompt
+       = (char *) alloca ((prompt == NULL ? 0 : strlen (prompt))
+                          + strlen (annotation_suffix) + 40);
       if (prompt == NULL)
        local_prompt[0] = '\0';
       else
@@ -1229,7 +1236,8 @@ command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix)
     {
       if (linelength > saved_command_line_size)
        {
-         saved_command_line = xrealloc (saved_command_line, linelength);
+         saved_command_line
+           = (char *) xrealloc (saved_command_line, linelength);
          saved_command_line_size = linelength;
        }
       strcpy (saved_command_line, linebuffer);
@@ -1431,7 +1439,7 @@ struct qt_args
 static int
 kill_or_detach (struct inferior *inf, void *args)
 {
-  struct qt_args *qt = args;
+  struct qt_args *qt = (struct qt_args *) args;
   struct thread_info *thread;
 
   if (inf->pid == 0)
@@ -1462,7 +1470,7 @@ kill_or_detach (struct inferior *inf, void *args)
 static int
 print_inferior_quit_action (struct inferior *inf, void *arg)
 {
-  struct ui_file *stb = arg;
+  struct ui_file *stb = (struct ui_file *) arg;
 
   if (inf->pid == 0)
     return 0;
This page took 0.024627 seconds and 4 git commands to generate.