changeset 31109:88608fbaf4eb

(min): Define macro. (clear_frame, write_glyphs): Fix compile warning.
author Andrew Innes <andrewi@gnu.org>
date Tue, 22 Aug 2000 22:53:00 +0000
parents ba53675aa8f9
children 9feda85db5d6
files src/w32console.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32console.c	Tue Aug 22 22:50:55 2000 +0000
+++ b/src/w32console.c	Tue Aug 22 22:53:00 2000 +0000
@@ -41,6 +41,8 @@
 #include "w32inevt.h"
 #include "dispextern.h"
 
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
 /* from window.c */
 extern Lisp_Object Frecenter ();
 
@@ -134,7 +136,8 @@
 {
   struct frame *  f = PICK_FRAME ();
   COORD	     dest;
-  int        n, r;
+  int        n;
+  DWORD      r;
   CONSOLE_SCREEN_BUFFER_INFO info;
 
   GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info);
@@ -338,7 +341,8 @@
 void
 write_glyphs (register struct glyph *string, register int len)
 {
-  int produced, consumed, i;
+  int produced, consumed;
+  DWORD r;
   struct frame * f = PICK_FRAME ();
   WORD char_attr;
   unsigned char conversion_buffer[1024];
@@ -376,7 +380,7 @@
 	    {
               /* Set the attribute for these characters.  */
               if (!FillConsoleOutputAttribute (cur_screen, char_attr,
-                                               produced, cursor_coords, &i)) 
+                                               produced, cursor_coords, &r)) 
                 {
                   printf ("Failed writing console attributes: %d\n",
                           GetLastError ());
@@ -385,7 +389,7 @@
 
               /* Write the characters.  */
               if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer,
-                                                produced, cursor_coords, &i))
+                                                produced, cursor_coords, &r))
                 {
                   printf ("Failed writing console characters: %d\n",
                           GetLastError ());
@@ -411,7 +415,7 @@
         {
           if (!FillConsoleOutputAttribute (cur_screen, char_attr_normal,
                                            terminal_coding.produced,
-                                           cursor_coords, &i)) 
+                                           cursor_coords, &r)) 
             {
               printf ("Failed writing console attributes: %d\n",
                       GetLastError ());
@@ -420,7 +424,7 @@
 
           /* Write the characters.  */
           if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer,
-                                            produced, cursor_coords, &i))
+                                            produced, cursor_coords, &r))
             {
               printf ("Failed writing console characters: %d\n",
                       GetLastError ());