summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-13 20:10:23 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-13 20:10:23 -0200
commit3a041bbccdee28b628ce5243e77d7d3125a186d4 (patch)
tree522e1d212db0b5732fb6c3514a9f7144728527c7
parent0fbda267334eb531b7153c3b9035fe7470302e13 (diff)
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects make distcheck.
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac8
-rw-r--r--xdpyinfo.c17
4 files changed, 22 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 78c274c..796d7ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,7 @@ stamp-h1
xdpyinfo
xdpyinfo.1
*~
+*.o
+xdpyinfo-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index 7284fa6..ee33b76 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,7 +67,7 @@ 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 22bae81..c787a02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,13 +26,20 @@ AC_INIT(xdpyinfo,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xo
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.2)
+
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
+XORG_CWARNFLAGS
+
# Checks for pkg-config packages
PKG_CHECK_MODULES(XDPYINFO, xext x11 xtst)
+XDPYINFO_CFLAGS="$CWARNFLAGS $XDPYINFO_CFLAGS"
AC_SUBST(XDPYINFO_CFLAGS)
AC_SUBST(XDPYINFO_LIBS)
@@ -133,5 +140,6 @@ XORG_WITH_LINT
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile])
diff --git a/xdpyinfo.c b/xdpyinfo.c
index e9717b3..014e2bb 100644
--- a/xdpyinfo.c
+++ b/xdpyinfo.c
@@ -132,8 +132,8 @@ in this Software without prior written authorization from The Open Group.
/* Turn a NULL pointer string into an empty string */
#define NULLSTR(x) (((x)!=NULL)?(x):(""))
-char *ProgramName;
-Bool queryExtensions = False;
+static char *ProgramName;
+static Bool queryExtensions = False;
static int
silent_errors(Display *dpy, XErrorEvent *ev)
@@ -725,7 +725,8 @@ print_shape_info(Display *dpy, char *extname)
static int
print_dga_info(Display *dpy, char *extname)
{
- int majorrev, minorrev, width, bank, ram, offset, flags;
+ unsigned int offset;
+ int majorrev, minorrev, width, bank, ram, flags;
if (!XF86DGAQueryVersion(dpy, &majorrev, &minorrev))
return 0;
@@ -849,14 +850,14 @@ print_XF86VidMode_info(Display *dpy, char *extname)
#ifdef XF86MISC
-char *kbdtable[] = { "Unknown", "84-key", "101-key", "Other", "Xqueue" };
-char *msetable[] = { "None", "Microsoft", "MouseSystems", "MMSeries",
+static char *kbdtable[] = { "Unknown", "84-key", "101-key", "Other", "Xqueue" };
+static char *msetable[] = { "None", "Microsoft", "MouseSystems", "MMSeries",
"Logitech", "BusMouse", "Mouseman", "PS/2", "MMHitTab",
"GlidePoint", "IntelliMouse", "ThinkingMouse",
"IMPS/2", "ThinkingMousePS/2", "MouseManPlusPS/2",
"GlidePointPS/2", "NetMousePS/2", "NetScrollPS/2",
"SysMouse", "Auto" };
-char *flgtable[] = { "None", "ClearDTR", "ClearRTS",
+static char *flgtable[] = { "None", "ClearDTR", "ClearRTS",
"ClearDTR and ClearRTS" };
static int
@@ -1411,7 +1412,7 @@ typedef struct {
Bool printit;
} ExtensionPrintInfo;
-ExtensionPrintInfo known_extensions[] =
+static ExtensionPrintInfo known_extensions[] =
{
#ifdef MITSHM
{"MIT-SHM", print_mitshm_info, False},
@@ -1454,7 +1455,7 @@ ExtensionPrintInfo known_extensions[] =
/* add new extensions here */
};
-int num_known_extensions = sizeof known_extensions / sizeof known_extensions[0];
+static int num_known_extensions = sizeof known_extensions / sizeof known_extensions[0];
static void
print_known_extensions(FILE *f)