This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/obvious] Fix compilation errors in utils.c under __GO32__


This change:

    2003-08-19  Mark Kettenis  <kettenis@gnu.org>

	    * utils.c (set_width_command): Remove prototypes.
	    (set_screen_size): New prototype.
	    (init_page_info): Simplify by fetching the screen size from
	    Readline.  Call set_screen_size.
	    (set_screen_size): New function.
	    (set_width): Add missing whitespace in comment.
	    (set_width_command): Call set_screen_size.
	    (set_height_command): New function.
	    (initialize_utils): Fix formatting.  Make "set height" command
	    call set_height_command.  Remove redundant code that turns off
	    pagination if output isn't a terminal.  Remove redundant call to
	    set_width_command.

botched the DJGPP build, since the braces in init_page_info won't
balance under __GO32__.  I committed the following patch as obvious to
fix that:

2004-01-21  Eli Zaretskii  <eliz@gnu.org>

	* utils.c (init_page_info): Move declarations of `rows' and
	`cols' before the __GO32__-specific code.  Move the closing brace
	outside the #ifdef __GO32__..#endif block.
	[__GO32__]: Use `rows' and `cols' to avoid compiler warnings.

--- gdb/utils.c~0	2003-09-21 01:26:44.000000000 +0200
+++ gdb/utils.c	2004-01-21 11:43:30.000000000 +0200
@@ -1608,12 +1608,14 @@ init_page_info (void)
   if (!tui_get_command_dimension (&chars_per_line, &lines_per_page))
 #endif
     {
-#if defined(__GO32__)
-      lines_per_page = ScreenRows ();
-      chars_per_line = ScreenCols ();
-#else
       int rows, cols;
 
+#if defined(__GO32__)
+      rows = ScreenRows ();
+      cols = ScreenCols ();
+      lines_per_page = rows;
+      chars_per_line = cols;
+#else
       /* Make sure Readline has initialized its terminal settings.  */
       rl_reset_terminal (NULL);
 
@@ -1639,8 +1641,8 @@ init_page_info (void)
       /* If the output is not a terminal, don't paginate it.  */
       if (!ui_file_isatty (gdb_stdout))
 	lines_per_page = UINT_MAX;
-    }
 #endif
+    }
 
   set_screen_size ();
   set_width ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]