NOTE: This patch has been committed.
  This patch simplifies the clear_region interface by removing the
device parameter: in 3 cases it's unused, and in the 4th one, the device
can be deduced from the frame parameter anyway.
src/ChangeLog addition:
2011-05-29  Didier Verna  <didier(a)xemacs.org>
	* console-impl.h (struct console_methods): Remove device parameter
	from the clear_region method prototype.
	* redisplay-output.c (redisplay_clear_region): Remove the device
	parameter from the clear_region method call.
	* console-stream.c (stream_clear_region):
	* redisplay-msw.c (mswindows_clear_region):
	* redisplay-tty.c (tty_clear_region): Update accordingly.
	* redisplay-xlike-inc.c (XLIKE_clear_region): Ditto. Get the
	device from the frame structure instead.
XEmacs 21.5 source patch:
Diff command:   hg diff --git --show-function 
Files affected: src/console-impl.h src/console-stream.c src/redisplay-msw.c
src/redisplay-output.c src/redisplay-tty.c src/redisplay-xlike-inc.c
diff --git a/src/console-impl.h b/src/console-impl.h
--- a/src/console-impl.h
+++ b/src/console-impl.h
@@ -151,7 +151,7 @@ struct console_methods
   int (*eol_cursor_width_method) (void);
   void (*output_vertical_divider_method) (struct window *, int);
   void (*clear_to_window_end_method) (struct window *, int, int);
-  void (*clear_region_method) (Lisp_Object, struct device*, struct frame*,
+  void (*clear_region_method) (Lisp_Object, struct frame*,
 			       face_index, int, int, int, int,
 			       Lisp_Object, Lisp_Object,
 			       Lisp_Object, Lisp_Object);
diff --git a/src/console-stream.c b/src/console-stream.c
--- a/src/console-stream.c
+++ b/src/console-stream.c
@@ -273,10 +273,11 @@ stream_output_display_block (struct wind
 }
 
 static void
-stream_clear_region (Lisp_Object UNUSED (window), struct device* UNUSED (d),
-		     struct frame *UNUSED (f), face_index UNUSED (findex),
-		     int UNUSED (x), int UNUSED (y), int UNUSED (width),
-		     int UNUSED (height), Lisp_Object UNUSED (fcolor),
+stream_clear_region (Lisp_Object UNUSED (window), struct frame *UNUSED (f),
+		     face_index UNUSED (findex),
+		     int UNUSED (x), int UNUSED (y),
+		     int UNUSED (width), int UNUSED (height),
+		     Lisp_Object UNUSED (fcolor),
 		     Lisp_Object UNUSED (bcolor),
 		     Lisp_Object UNUSED (background_pixmap),
 		     Lisp_Object UNUSED (background_placement))
diff --git a/src/redisplay-msw.c b/src/redisplay-msw.c
--- a/src/redisplay-msw.c
+++ b/src/redisplay-msw.c
@@ -1240,7 +1240,7 @@ mswindows_text_width (struct window *w, 
  ****************************************************************************/
 static void
 mswindows_clear_region (Lisp_Object USED_IF_SCROLLBARS (locale),
-			struct device *UNUSED (d), struct frame *f, 
+			struct frame *f, 
 			face_index UNUSED (findex), int x, int y,
 			int width, int height, Lisp_Object fcolor,
 			Lisp_Object bcolor,
diff --git a/src/redisplay-output.c b/src/redisplay-output.c
--- a/src/redisplay-output.c
+++ b/src/redisplay-output.c
@@ -1807,7 +1807,7 @@ redisplay_clear_region (Lisp_Object loca
   if (UNBOUNDP (background_pixmap))
     background_pixmap = Qnil;
 
-  DEVMETH (d, clear_region, (locale, d, f, findex, x, y, width, height,
+  DEVMETH (d, clear_region, (locale, f, findex, x, y, width, height,
 			     fcolor, bcolor, 
 			     background_pixmap, background_placement));
 }
diff --git a/src/redisplay-tty.c b/src/redisplay-tty.c
--- a/src/redisplay-tty.c
+++ b/src/redisplay-tty.c
@@ -422,9 +422,9 @@ tty_output_vertical_divider (struct wind
  Clear the area in the box defined by the given parameters.
  ****************************************************************************/
 static void
-tty_clear_region (Lisp_Object window, struct device* UNUSED (d),
-		  struct frame * f, face_index findex, int x, int y,
-		  int width, int height, Lisp_Object UNUSED (fcolor),
+tty_clear_region (Lisp_Object window, struct frame *f, face_index findex,
+		  int x, int y, int width, int height,
+		  Lisp_Object UNUSED (fcolor),
 		  Lisp_Object UNUSED (bcolor),
 		  Lisp_Object UNUSED (background_pixmap),
 		  Lisp_Object UNUSED (background_placement))
diff --git a/src/redisplay-xlike-inc.c b/src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -2021,14 +2021,14 @@ XLIKE_output_horizontal_line (struct win
  given face.
  ****************************************************************************/
 static void
-XLIKE_clear_region (Lisp_Object UNUSED (locale), struct device* d,
-		    struct frame* f, face_index UNUSED (findex), int x, int y,
-		    int width, int height,
+XLIKE_clear_region (Lisp_Object UNUSED (locale), struct frame* f,
+		    face_index UNUSED (findex),
+		    int x, int y, int width, int height,
 		    Lisp_Object fcolor, Lisp_Object bcolor,
 		    Lisp_Object background_pixmap,
 		    Lisp_Object background_placement)
 {
-  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_DISPLAY dpy =  GET_XLIKE_DISPLAY (XDEVICE (f->device));
   XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
   XLIKE_GC gc = NULL;
 
-- 
Resistance is futile. You will be jazzimilated.
Scientific site:   
http://www.lrde.epita.fr/~didier
Music (Jazz) site: 
http://www.didierverna.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches