[Simplify redisplay-x/separate_textual_runs] Fix union build, shut up gcc

Stephen J. Turnbull stephen at xemacs.org
Fri Mar 30 02:45:31 EDT 2007


Olivier Galibert writes:

 > +separate_textual_runs_xft_mule (unsigned char *text_storage,
 > +				struct textual_run *run_storage,
 > +				const Ichar *str, Charcount len,
 > +				struct face_cachel *cachel)

Except for non-Xft Mule, `cachel' should be declared UNUSED, it
seems.  (This shuts up a warning, it's not an error.)

 > +      Lisp_Object charset = ichar_charset(ch);
[...]
 > +      if (prev_charset != charset)

Tsk, tsk.  EQ is your friend here.<wink>

Builds, passes "make check" (ie, only the KNOWN BUGs fail), and runs
(not used extensively yet).  Interestingly, it doesn't show the
missing line/column info bug reported yesterday.

steve at uwakimon /playpen/src/XEmacs/git-integration $ steve at uwakimon /playpen/src/XEmacs/git-integration $ git diff
diff --git a/src/redisplay-x.c b/src/redisplay-x.c
index 4b49d72..d2f8e29 100644
--- a/src/redisplay-x.c
+++ b/src/redisplay-x.c
@@ -149,7 +149,7 @@ static int
 separate_textual_runs_xft_mule (unsigned char *text_storage,
 				struct textual_run *run_storage,
 				const Ichar *str, Charcount len,
-				struct face_cachel *cachel)
+				struct face_cachel * UNUSED(cachel))
 {
   Lisp_Object prev_charset = Qnil;
   int runs_so_far = 0, i;
@@ -170,7 +170,7 @@ separate_textual_runs_xft_mule (unsigned char *text_storage,
       /* That means we can't handle characters outside of the BMP for now */
       ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
 
-      if (prev_charset != charset)
+      if (!EQ (prev_charset, charset))
 	{
 	  if (runs_so_far)
 	    run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
@@ -196,7 +196,7 @@ static int
 separate_textual_runs_xft_nomule (unsigned char *text_storage,
 				  struct textual_run *run_storage,
 				  const Ichar *str, Charcount len,
-				  struct face_cachel *cachel)
+				  struct face_cachel * UNUSED(cachel))
 {
   int i;
   if (!len)
@@ -348,7 +348,7 @@ static int
 separate_textual_runs_nomule (unsigned char *text_storage,
 			      struct textual_run *run_storage,
 			      const Ichar *str, Charcount len,
-			      struct face_cachel *cachel)
+			      struct face_cachel * UNUSED(cachel))
 {
   int i;
   if (!len)



More information about the XEmacs-Patches mailing list