This patch makes GCC 4.1 shut up when compiling in lwlib on an x86_64
platform. The xlwgauge.c patch is funny. GCC complains about a missing
sentinel, but the gcc docs say that either 0 or NULL is accepted as the
sentinel. It must have something to do with the difference in size
between an int and a pointer on the x86_64 platform, but in that case,
the gcc docs are wrong.
lwlib/ChangeLog addition:
2006-04-24 Jerry James <james(a)xemacs.org>
* lwlib-Xaw.c (lw_debug_print_class_resources): Casting from a
pointer to an int throws away half of the bits on an x86_64
platform. Print as a pointer instead.
* xlwgauge.c (XawGaugeSetValue): Use NULL instead of 0 as the
sentinel to quiet gcc warnings.
* xlwmenu.c: Cast to FcChar8 * as necessary to quiet warnings.
* xlwtabs.c: Ditto.
xemacs-21.5 source patch:
Diff command: cvs -q diff -uN
Files affected: lwlib/xlwtabs.c lwlib/xlwmenu.c lwlib/xlwgauge.c lwlib/lwlib-Xaw.c
Index: lwlib/lwlib-Xaw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-Xaw.c,v
retrieving revision 1.12
diff -d -u -r1.12 lwlib-Xaw.c
--- lwlib/lwlib-Xaw.c 2005/11/26 11:45:59 1.12
+++ lwlib/lwlib-Xaw.c 2006/04/24 17:43:25
@@ -847,8 +847,8 @@
if (!strcmp (rl[i].resource_class, "International"))
{
fprintf (stderr, " Class has an International resource.\n");
- fprintf (stderr, " International resource is %d.\n",
- (int) rl[i].default_addr);
+ fprintf (stderr, " International resource is %p.\n",
+ rl[i].default_addr);
}
}
class_ = class_->core_class.superclass;
Index: lwlib/xlwgauge.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwgauge.c,v
retrieving revision 1.6
diff -d -u -r1.6 xlwgauge.c
--- lwlib/xlwgauge.c 2005/11/10 15:47:33 1.6
+++ lwlib/xlwgauge.c 2006/04/24 17:43:26
@@ -838,7 +838,7 @@
if(( gw->gauge.autoScaleUp && (int) value > gw->gauge.v1) ||
(gw->gauge.autoScaleDown && (int) value < gw->gauge.v1/3 ))
{
- XtVaSetValues(w, XtNvalue, value, 0) ;
+ XtVaSetValues(w, XtNvalue, value, NULL) ;
return ;
}
Index: lwlib/xlwmenu.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwmenu.c,v
retrieving revision 1.39
diff -d -u -r1.39 xlwmenu.c
--- lwlib/xlwmenu.c 2005/12/22 13:58:16 1.39
+++ lwlib/xlwmenu.c 2006/04/24 17:43:26
@@ -333,8 +333,8 @@
# else
#ifdef USE_XFT_MENUBARS
XGlyphInfo glyphinfo;
- XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, s, strlen (s),
- &glyphinfo);
+ XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s,
+ strlen (s), &glyphinfo);
return glyphinfo.xOff;
#else
XCharStruct xcs;
@@ -424,8 +424,8 @@
return rl.width;
# else /* ! USE_XFONTSET */
#ifdef USE_XFT_MENUBARS
- XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, newchars, j,
- &glyphinfo);
+ XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars,
+ j, &glyphinfo);
return glyphinfo.xOff;
#else
XTextExtents (mw->menu.font, newchars, j, &drop, &drop, &drop,
&xcs);
@@ -756,7 +756,7 @@
XftTextExtents8 (dpy,
xft_font,
- run, len, &glyphinfo);
+ (FcChar8 *) run, len, &glyphinfo);
return glyphinfo.xOff;
}
#endif
@@ -801,8 +801,8 @@
x_xft_text_width (display, renderFont, string, strlen (string)),
renderFont->ascent + renderFont->descent); /* XXX */
/* draw text */
- XftDrawString8 (xftDraw, color, renderFont,
- x, y + mw->menu.font_ascent, string, strlen (string));
+ XftDrawString8 (xftDraw, color, renderFont, x, y + mw->menu.font_ascent,
+ (FcChar8 *) string, strlen (string));
XftDrawDestroy (xftDraw);
# else
# ifdef USE_XFONTSET
@@ -890,10 +890,10 @@
/* draw text */
XftDrawString8 (xftDraw, color, renderFont,
x, y + mw->menu.font_ascent,
- &string[start], end - start);
+ (FcChar8 *) &string[start], end - start);
- XftTextExtents8 (display, renderFont, &string[start], end - start,
- &glyphinfo);
+ XftTextExtents8 (display, renderFont, (FcChar8 *) &string[start],
+ end - start, &glyphinfo);
/* #### should use parent frame's .xftDraw */
XftDrawDestroy (xftDraw);
Index: lwlib/xlwtabs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwtabs.c,v
retrieving revision 1.6
diff -d -u -r1.6 xlwtabs.c
--- lwlib/xlwtabs.c 2005/11/26 11:46:00 1.6
+++ lwlib/xlwtabs.c 2006/04/24 17:43:26
@@ -1708,8 +1708,8 @@
XGlyphInfo glyphinfo;
XftColor colorDBG;
XftColorAllocName (dpy, visual, cmap, "wheat", &colorDBG);
- XftTextExtents8 (dpy, renderFont, lbl, (int) strlen (lbl),
- &glyphinfo);
+ XftTextExtents8 (dpy, renderFont, (FcChar8 *) lbl,
+ (int) strlen (lbl), &glyphinfo);
/* #### unnecessary? for the moment, give visual extent */
/* draw background rect */
#if 1
@@ -1754,7 +1754,7 @@
}
XftDrawString8 (xftDraw, &color, renderFont,
x+tab->tabs.l_x, y+tab->tabs.l_y,
- lbl, (int) strlen (lbl));
+ (FcChar8 *) lbl, (int) strlen (lbl));
XftDrawDestroy (xftDraw);
#else
XDrawString(dpy,win,gc,
@@ -1988,7 +1988,8 @@
{
#ifdef USE_XFT_TABS
tab->tabs.width += x_xft_text_width (XtDisplay(tw), font,
- lbl, (int)strlen(lbl)) + iw;
+ (FcChar8 *) lbl,
+ (int)strlen(lbl)) + iw;
tab->tabs.l_y = (tw->tabs.tab_height
+ tw->tabs.renderFont->ascent
/* #### how can this subtraction be correct? */
--
Jerry James, Assistant Professor james(a)xemacs.org
Computer Science Department
http://www.cs.usu.edu/~jerry/
Utah State University