[PATCH] Janitor: make distcheck, compile warnings, .gitignore.

Paulo Cesar Pereira de Andrade pcpa at mandriva.com.br
Mon Feb 9 12:22:06 PST 2009


  Use a single .gitignore file.
  Replace ChangeLog with automatically generated one.
  Use same pattern for $moduledir and $sdkdir, that works with
make distcheck.
  Use XORG_CWARNFLAGS to help find driver problems.
  Compile warnings were:
o Match function pointer field of ImpactRec with values assigned.
o Cast ErrorF (printf format) int/long/size_t arguments.
o #if 0 some unused static functions.

Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
---
 .gitignore          |   27 +++++++++++++++++++++++++++
 ChangeLog           |   10 ----------
 Makefile.am         |   10 +++++++++-
 configure.ac        |   30 ++++++++++++------------------
 man/Makefile.am     |    4 ++--
 src/Makefile.am     |    2 +-
 src/impact.h        |    6 +++---
 src/impact_driver.c |    8 ++++----
 src/impact_regs.c   |   12 ++++++++----
 9 files changed, 66 insertions(+), 43 deletions(-)
 create mode 100644 .gitignore
 delete mode 100644 ChangeLog

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c79df23
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,27 @@
+.deps
+.libs
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
+*~
+*.4
+*.o
+xf86-video-impact-*.tar.*
+ChangeLog
+tags
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 5723341..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2006-06-27  Alex Deucher  <agd5f at yahoo.com>
-
-	* configure.ac:
-	- fix building man page
-
-2006-06-25  Alex Deucher  <agd5f at yahoo.com>
-
-	Add Impact driver for SGI Indigo2 and Octane.  Written by
-	Peter Fuerst and Stanislaw Skowronek, modularilzed by
-	Stephen Becker
diff --git a/Makefile.am b/Makefile.am
index e2f4d60..a42a30e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,4 +21,12 @@
 AUTOMAKE_OPTIONS = foreign
 SUBDIRS = src man
 
-EXTRA_DIST = XF86Config.impact
+EXTRA_DIST = XF86Config.impact ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+	$(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index 70ff4ac..55384d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,9 @@ AC_INIT([xf86-video-impact],
         xf86-video-impact)
 
 AC_CONFIG_SRCDIR([Makefile.am])
+# 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_CONFIG_AUX_DIR(.)
 
@@ -34,34 +37,25 @@ AM_INIT_AUTOMAKE([dist-bzip2])
 
 AM_MAINTAINER_MODE
 
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XORG, [xorg-server xproto])
+
 # Checks for programs.
 AC_PROG_LIBTOOL
 AC_PROG_CC
+XORG_CWARNFLAGS
 
 AH_TOP([#include "xorg-server.h"])
-
-AC_ARG_WITH(xorg-module-dir,
-            AC_HELP_STRING([--with-xorg-module-dir=DIR],
-                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
-            [moduledir="$withval"],
-            [moduledir="$libdir/xorg/modules"])
-# Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server xproto])
-sdkdir=$(pkg-config --variable=sdkdir xorg-server)
-
-# Checks for libraries.
+moduledir="$libdir/xorg/modules"
+sdkdir="$includedir/xorg"
+AC_SUBST(moduledir)
+AC_SUBST(sdkdir)
 
 # Checks for header files.
 AC_HEADER_STDC
-
-AC_SUBST([XORG_CFLAGS])
-AC_SUBST([moduledir])
-
-DRIVER_NAME=impact
-AC_SUBST([DRIVER_NAME])
-
 XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
+XORG_CHANGELOG
 
 AC_OUTPUT([
 	Makefile
diff --git a/man/Makefile.am b/man/Makefile.am
index f0eb29b..9d0cd05 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -26,11 +26,11 @@
 
 drivermandir = $(DRIVER_MAN_DIR)
 
-driverman_PRE = @DRIVER_NAME at .man
+driverman_PRE = impact.man
 
 driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
 
-EXTRA_DIST = @DRIVER_NAME at .man
+EXTRA_DIST = impact.man
 
 CLEANFILES = $(driverman_DATA)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 75f683b..d749aef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,7 +23,7 @@
 # -avoid-version prevents gratuitous .0.0.0 version numbers on the end
 # _ladir passes a dummy rpath to libtool so the thing will actually link
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
-AM_CFLAGS = @XORG_CFLAGS@
+AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS)
 impact_drv_la_LTLIBRARIES = impact_drv.la
 impact_drv_la_LDFLAGS = -module -avoid-version
 impact_drv_ladir = @moduledir@/drivers
diff --git a/src/impact.h b/src/impact.h
index 9655fde..f7f044f 100644
--- a/src/impact.h
+++ b/src/impact.h
@@ -78,9 +78,9 @@ typedef struct {
 
 	/* impact register handling for FullHouse/SpeedRacer: */
 	void (*WaitCfifoEmpty)(ImpactRegsPtr);
-	unsigned (*WaitCfifo)(ImpactRegsPtr);
-	unsigned (*WaitDMAOver)(ImpactRegsPtr);
-	unsigned (*WaitDMAReady)(ImpactRegsPtr);
+	void (*WaitCfifo)(ImpactRegsPtr);
+	void (*WaitDMAOver)(ImpactRegsPtr);
+	void (*WaitDMAReady)(ImpactRegsPtr);
 	unsigned short (*Vc3Get)(ImpactRegsPtr, CARD8);
 	void (*Vc3Set)(ImpactRegsPtr, CARD8, unsigned short);
 	CARD32 (*XmapGetModeRegister)(ImpactRegsPtr, CARD8);
diff --git a/src/impact_driver.c b/src/impact_driver.c
index bbad948..8081757 100644
--- a/src/impact_driver.c
+++ b/src/impact_driver.c
@@ -104,7 +104,7 @@ static void ImpactUnmapShadowFB(ScrnInfoPtr pScrn);
 static Bool ImpactProbeCardInfo(ScrnInfoPtr pScrn);
 /* ------------------------------------------------------------------ */
 
-DriverRec IMPACT = {
+_X_EXPORT DriverRec IMPACT = {
 	IMPACT_VERSION,
 	IMPACT_DRIVER_NAME,
 	ImpactIdentify,
@@ -147,7 +147,7 @@ static XF86ModuleVersionInfo impactVersRec =
 	MODULEVENDORSTRING,
 	MODINFOSTRING1,
 	MODINFOSTRING2,
-	XF86_VERSION_CURRENT,
+	XORG_VERSION_CURRENT,
 	IMPACT_MAJOR_VERSION, IMPACT_MINOR_VERSION, IMPACT_PATCHLEVEL,
 	ABI_CLASS_VIDEODRV,
 	ABI_VIDEODRV_VERSION,
@@ -825,7 +825,7 @@ ImpactMapRegs(ScrnInfoPtr pScrn)
 				MAP_SHARED, pImpact->devFD, 0);
 		if (MAP_FAILED == pImpact->pImpactRegs) {
 			ErrorF("ImpactMapRegs: Could not mmap card registers"
-				" (0x%08lx,0x%x) (%s)\n", 0, size, strerror(errno));
+			       " (0x%08lx,0x%x) (%s)\n", 0L, (int)size, strerror(errno));
 			pImpact->pImpactRegs = 0;
 		}
 	}
@@ -849,7 +849,7 @@ ImpactMapShadowFB(ScrnInfoPtr pScrn)
 				MAP_SHARED, pImpact->devFD, IMPACT_FB_MMAP_OFF(3));
 		if (MAP_FAILED == pImpact->ShadowPtr) {
 			ErrorF("ImpactMapShadowFB: Could not mmap shadow buffer"
-				" (0x%08lx,0x800000) (%s)\n", IMPACT_FB_MMAP_OFF(3), strerror(errno));
+			       " (0x%08lx,0x800000) (%s)\n", (long)IMPACT_FB_MMAP_OFF(3), strerror(errno));
 			pImpact->ShadowPtr = 0;
 		}
 	}
diff --git a/src/impact_regs.c b/src/impact_regs.c
index 8479469..6238411 100644
--- a/src/impact_regs.c
+++ b/src/impact_regs.c
@@ -112,17 +112,19 @@ ImpactWaitBfifo(mgireg32_t *giostatus, int nslots)
 	return x;
 }
 
-unsigned
+#if 0
+static unsigned
 ImpactI2WaitBfifo(ImpactRegsPtr pImpactRegs, int nslots)
 {
 	return ImpactWaitBfifo(&pImpactRegs->i2.giostatus, nslots);
 }
 
-unsigned
+static unsigned
 ImpactSRWaitBfifo(ImpactRegsPtr pImpactRegs, int nslots)
 {
 	return ImpactWaitBfifo(&pImpactRegs->sr.giostatus, nslots);
 }
+#endif
 
 /*
  * ImpactWaitBfifoEmpty
@@ -133,17 +135,19 @@ ImpactWaitBfifoEmpty(mgireg32_t *giostatus)
 	while (*giostatus & 0x1f);
 }
 
-void
+#if 0
+static void
 ImpactI2WaitBfifoEmpty(ImpactRegsPtr pImpactRegs)
 {
 	ImpactWaitBfifoEmpty(&pImpactRegs->i2.giostatus);
 }
 
-void
+static void
 ImpactSRWaitBfifoEmpty(ImpactRegsPtr pImpactRegs)
 {
 	ImpactWaitBfifoEmpty(&pImpactRegs->sr.giostatus);
 }
+#endif
 
 /*
  * ImpactVc3[GS]et
-- 
1.6.1

------=_20090209185604_62066--



More information about the xorg-devel mailing list