From 0b9de9e69e95872dd3eddbe5c1602e42c27c53e1 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> Date: Fri, 9 Jan 2009 19:18:36 -0200 Subject: [PATCH 3/4] Compile warning fixes. This uses XORG_CHANGELOG macro to properly work with the "git-log" to "git log" change (required to pass "make distcheck"), uses the XORG_CWARNFLAGS macro. Most gcc 4.3 and sparse warnings corrected. --- Makefile.am | 2 +- configure.ac | 11 +++++++++-- include/X11/Xaw/TextP.h | 2 ++ src/AllWidgets.c | 1 + src/AsciiSrc.c | 4 ++-- src/Command.c | 4 ++-- src/Dialog.c | 2 +- src/DisplayList.c | 2 +- src/Paned.c | 6 +++--- src/Pixmap.c | 2 +- src/Text.c | 2 -- src/TextTr.c | 2 ++ src/Tip.c | 2 +- src/Tree.c | 4 ++-- src/Vendor.c | 2 +- 16 files changed, 34 insertions(+), 20 deletions(-) diff --git a/Makefile.am b/Makefile.am index 265ccfc..2e3f9c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,6 +42,6 @@ MAINTAINERCLEANFILES=ChangeLog .PHONY: ChangeLog ChangeLog: - (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + $(CHANGELOG_CMD) dist-hook: ChangeLog diff --git a/configure.ac b/configure.ac index 9ba2414..3927025 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ AM_INIT_AUTOMAKE([dist-bzip2]) AM_CONFIG_HEADER(config.h) +# Require xorg-macros: XORG_WITH_LINT, XORG_CWARNFLAGS, XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2.1 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2.1) + # Check for progs AC_PROG_CC AC_PROG_LIBTOOL @@ -19,6 +23,8 @@ AC_PROG_LIBTOOL # is in an if statement, and later calls would break if it's skipped. PKG_PROG_PKG_CONFIG +XORG_CWARNFLAGS + # # fix libtool to set SONAME to libXaw.so.$major # @@ -60,7 +66,7 @@ AC_ARG_ENABLE(xaw6, AC_HELP_STRING([--disable-xaw6], if test "x$build_v6" = xyes; then PKG_CHECK_MODULES(XAW6, xproto x11 xext xextproto xt xmu) - + XAW6_CFLAGS="$CWARNFLAGS $XAW6_CFLAGS" AC_SUBST(XAW6_CFLAGS) AC_SUBST(XAW6_LIBS) fi @@ -74,7 +80,7 @@ AC_ARG_ENABLE(xaw7, AC_HELP_STRING([--disable-xaw7], if test "x$build_v7" = xyes; then PKG_CHECK_MODULES(XAW7, xproto x11 xext xextproto xt xmu xpm) - + XAW7_CFLAGS="$CWARNFLAGS $XAW7_CFLAGS" AC_SUBST(XAW7_CFLAGS) AC_SUBST(XAW7_LIBS) fi @@ -100,6 +106,7 @@ AC_CHECK_FUNCS([iswalnum]) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile include/Makefile diff --git a/include/X11/Xaw/TextP.h b/include/X11/Xaw/TextP.h index 0edbdd2..d058e8b 100644 --- a/include/X11/Xaw/TextP.h +++ b/include/X11/Xaw/TextP.h @@ -73,6 +73,8 @@ _XFUNCPROTOBEGIN extern XtActionsRec _XawTextActionsTable[]; extern Cardinal _XawTextActionsTableCount; +extern char _XawDefaultTextTranslations[]; + #define XawLF 0x0a #define XawCR 0x0d #define XawTAB 0x09 diff --git a/src/AllWidgets.c b/src/AllWidgets.c index c943630..4d95887 100644 --- a/src/AllWidgets.c +++ b/src/AllWidgets.c @@ -32,6 +32,7 @@ in this Software without prior written authorization from The Open Group. #endif #include <X11/IntrinsicP.h> #include <X11/Xmu/WidgetNode.h> +#include <X11/Xaw/AllWidgets.h> extern WidgetClass applicationShellWidgetClass; extern WidgetClass asciiSinkObjectClass; diff --git a/src/AsciiSrc.c b/src/AsciiSrc.c index b23ba4f..eb569fc 100644 --- a/src/AsciiSrc.c +++ b/src/AsciiSrc.c @@ -1448,7 +1448,7 @@ InitStringOrFile(AsciiSrcObject src, Bool newString) if (src->ascii_src.string == NULL) XtErrorMsg("NoFile", "asciiSourceCreate", "XawError", "Creating a read only disk widget and no file specified.", - NULL, 0); + NULL, NULL); open_mode = O_RDONLY; fdopen_mode = "r"; break; @@ -1779,7 +1779,7 @@ GetDefaultPieceSize(Widget w, int offset, XrmValue *value) { static XPointer pagesize; - if (pagesize == 0) { + if (pagesize == NULL) { pagesize = (XPointer)((long)_XawGetPageSize()); if (pagesize < (XPointer)BUFSIZ) pagesize = (XPointer)BUFSIZ; diff --git a/src/Command.c b/src/Command.c index fdab1b1..845ffb8 100644 --- a/src/Command.c +++ b/src/Command.c @@ -206,11 +206,11 @@ CommandClassRec commandClassRec = { }, /* label */ { - 0, /* not used */ + NULL, /* not used */ }, /* command */ { - 0, /* not used */ + NULL, /* not used */ }, }; diff --git a/src/Dialog.c b/src/Dialog.c index 0c8b82f..62d91b8 100644 --- a/src/Dialog.c +++ b/src/Dialog.c @@ -116,7 +116,7 @@ static XtResource resources[] = { sizeof(Pixmap), XtOffsetOf(DialogRec, dialog.icon), XtRImmediate, - 0 + NULL }, }; diff --git a/src/DisplayList.c b/src/DisplayList.c index e43621b..1704286 100644 --- a/src/DisplayList.c +++ b/src/DisplayList.c @@ -2035,7 +2035,7 @@ _Xaw_Xlib_DataInitProc(String class_name, tmp_win = XCreateWindow(DisplayOfScreen(screen), RootWindowOfScreen(screen), 0, 0, 1, 1, 1, depth, - InputOutput, CopyFromParent, 0, NULL); + InputOutput, (Visual *)CopyFromParent, 0, NULL); data->mask = 0; data->gc = XCreateGC(DisplayOfScreen(screen), tmp_win, 0, &data->values); XDestroyWindow(DisplayOfScreen(screen), tmp_win); diff --git a/src/Paned.c b/src/Paned.c index 4dbdb30..a2408ba 100644 --- a/src/Paned.c +++ b/src/Paned.c @@ -242,7 +242,7 @@ static XtResource resources[] = { sizeof(Cursor), offset(cursor), XtRImmediate, - None + NULL }, { XtNgripCursor, @@ -251,7 +251,7 @@ static XtResource resources[] = { sizeof(Cursor), offset(grip_cursor), XtRImmediate, - None + NULL }, { XtNverticalGripCursor, @@ -278,7 +278,7 @@ static XtResource resources[] = { sizeof(Cursor), offset(adjust_this_cursor), XtRString, - None + NULL }, { XtNverticalBetweenCursor, diff --git a/src/Pixmap.c b/src/Pixmap.c index 06e326a..a6fb5a3 100644 --- a/src/Pixmap.c +++ b/src/Pixmap.c @@ -282,7 +282,7 @@ XawLoadPixmap(String name, Screen *screen, Colormap colormap, int depth) XawParams *xaw_params; if (!name) - return (False); + return (NULL); xaw_pixmap = _XawFindPixmap(name, screen, colormap, depth); diff --git a/src/Text.c b/src/Text.c index 7d7dd2e..2fd9d3f 100644 --- a/src/Text.c +++ b/src/Text.c @@ -270,8 +270,6 @@ void _XawTextSinkDisplayText(Widget, int, int, XawTextPosition, XawTextPosition, /* * From TextTr.c */ -extern char _XawDefaultTextTranslations[]; - static XawTextSelectType defaultSelectTypes[] = { XawselectPosition, XawselectAlphaNumeric, XawselectWord, XawselectLine, XawselectParagraph, XawselectAll, XawselectNull, diff --git a/src/TextTr.c b/src/TextTr.c index c918ee6..059a792 100644 --- a/src/TextTr.c +++ b/src/TextTr.c @@ -43,6 +43,8 @@ The Japanese user typically hits their Kanji key when they want to do input. This merely makes sure the input is connected. */ +#include <X11/Xaw/Text.h> + char _XawDefaultTextTranslations[] = "c<Key>A:" "beginning-of-line()\n" "c<Key>B:" "backward-character()\n" diff --git a/src/Tip.c b/src/Tip.c index 3c4b794..f2168a6 100644 --- a/src/Tip.c +++ b/src/Tip.c @@ -311,7 +311,7 @@ XawTipRealize(Widget w, Mask *mask, XSetWindowAttributes *attr) XtBorderWidth(w), DefaultDepthOfScreen(XtScreen(w)), InputOutput, - CopyFromParent, + (Visual *)CopyFromParent, *mask, attr); } diff --git a/src/Tree.c b/src/Tree.c index 88bd51f..c37b215 100644 --- a/src/Tree.c +++ b/src/Tree.c @@ -193,7 +193,7 @@ TreeClassRec treeClassRec = { }, { /* Tree class fields */ - 0, /* ignore */ + NULL, /* ignore */ } }; @@ -314,7 +314,7 @@ delete_node(Widget parent, Widget node) for (i = pos; i < pc->tree.n_children; i++) pc->tree.children[i] = pc->tree.children[i+1]; - pc->tree.children[pc->tree.n_children]=0; + pc->tree.children[pc->tree.n_children] = NULL; } static void diff --git a/src/Vendor.c b/src/Vendor.c index a23ea7b..b9ffcf6 100644 --- a/src/Vendor.c +++ b/src/Vendor.c @@ -307,7 +307,7 @@ XawCvtCompoundTextToString(Display *dpy, XrmValuePtr args, Cardinal *num_args, if(XmbTextPropertyToTextList(dpy, &prop, &list, &count) < Success) { XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "converter", "XmbTextPropertyToTextList", "XawError", - "conversion from CT to MB failed.", NULL, 0); + "conversion from CT to MB failed.", NULL, NULL); return False; } len = strlen(*list); -- 1.6.1