summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am2
-rw-r--r--bitmaps.c4
-rw-r--r--configure.ac8
-rw-r--r--do_blt.c21
-rw-r--r--do_text.c4
-rw-r--r--do_traps.c14
-rw-r--r--x11perf.c12
8 files changed, 41 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 94abdf7..04b145e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,7 @@ x11perf.1
x11perfcomp
x11perfcomp.1
*~
+*.o
+x11perf-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index b820545..5b494ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -103,6 +103,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/bitmaps.c b/bitmaps.c
index 4dc60bf..6d5c18f 100644
--- a/bitmaps.c
+++ b/bitmaps.c
@@ -782,9 +782,7 @@ static unsigned char escherknot_bits[] = {
# define GCBits (GCFillStyle|GCTileStipXOrigin|GCTileStipYOrigin)
-void SetFillStyle(xp, p)
- XParms xp;
- Parms p;
+void SetFillStyle(XParms xp, Parms p)
{
int xorg = 0, yorg = 0;
diff --git a/configure.ac b/configure.ac
index 4235f4a..24e7896 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,11 +25,17 @@ AC_INIT(x11perf,[1.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]
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
+
AC_PATH_PROG(SED,sed)
if [[ -z $SED ]] ; then
AC_MSG_ERROR([sed is needed to build x11perf])
@@ -39,6 +45,7 @@ AC_TYPE_SIGNAL
# Checks for pkg-config packages
PKG_CHECK_MODULES(X11PERF, x11 xmuu)
+X11PERF_CFLAGS="$CWARNFLAGS $X11PERF_CFLAGS"
AC_SUBST(X11PERF_CFLAGS)
AC_SUBST(X11PERF_LIBS)
@@ -78,5 +85,6 @@ esac
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile])
diff --git a/do_blt.c b/do_blt.c
index b508b4a..97371dc 100644
--- a/do_blt.c
+++ b/do_blt.c
@@ -200,7 +200,7 @@ InitCopyPix(XParms xp, Parms p, int reps)
/* Create pixmap to write stuff into, and initialize it */
pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, xp->vinfo.depth);
- pixgc = XCreateGC(xp->d, pix, 0, 0);
+ pixgc = XCreateGC(xp->d, pix, 0, NULL);
/* need a gc with GXcopy cos pixmaps contain junk on creation. mmm */
XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, WIDTH, HEIGHT, 0, 0);
XFreeGC(xp->d, pixgc);
@@ -214,8 +214,8 @@ InitGetImage(XParms xp, Parms p, int reps)
/* Create image to stuff bits into */
image = XGetImage(xp->d, xp->w, 0, 0, WIDTH, HEIGHT, xp->planemask,
- p->font==0?ZPixmap:XYPixmap);
- if(image==0){
+ p->font==NULL?ZPixmap:XYPixmap);
+ if(image==NULL){
printf("XGetImage failed\n");
return False;
}
@@ -284,7 +284,7 @@ DoGetImage(XParms xp, Parms p, int reps)
int format;
size = p->special;
- format = (p->font == 0) ? ZPixmap : XYPixmap;
+ format = (p->font == NULL) ? ZPixmap : XYPixmap;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XDestroyImage(image);
image = XGetImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
@@ -404,7 +404,7 @@ InitShmPutImage(XParms xp, Parms p, int reps)
perror ("shmget");
return False;
}
- shm_info.shmaddr = (char *) shmat(shm_info.shmid, 0, 0);
+ shm_info.shmaddr = (char *) shmat(shm_info.shmid, NULL, 0);
if (shm_info.shmaddr == ((char *) -1))
{
/*
@@ -417,7 +417,7 @@ InitShmPutImage(XParms xp, Parms p, int reps)
free(segsa);
free(segsb);
perror ("shmat");
- shmctl (shm_info.shmid, IPC_RMID, 0);
+ shmctl (shm_info.shmid, IPC_RMID, NULL);
return False;
}
shm_info.readOnly = True;
@@ -439,7 +439,7 @@ InitShmPutImage(XParms xp, Parms p, int reps)
free(segsb);
if(shmdt (shm_info.shmaddr)==-1)
perror("shmdt:");
- if(shmctl (shm_info.shmid, IPC_RMID, 0)==-1)
+ if(shmctl (shm_info.shmid, IPC_RMID, NULL)==-1)
perror("shmctl rmid:");
return False;
}
@@ -478,7 +478,7 @@ EndShmPutImage(XParms xp, Parms p)
XSync(xp->d, False); /* need server to detach so can remove id */
if(shmdt (shm_info.shmaddr)==-1)
perror("shmdt:");
- if(shmctl (shm_info.shmid, IPC_RMID, 0)==-1)
+ if(shmctl (shm_info.shmid, IPC_RMID, NULL)==-1)
perror("shmctl rmid:");
}
@@ -528,7 +528,7 @@ InitCopyPlane(XParms xp, Parms p, int reps)
/* Create pixmap to write stuff into, and initialize it */
pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT,
- p->font==0 ? 1 : xp->vinfo.depth);
+ p->font==NULL ? 1 : xp->vinfo.depth);
gcv.graphics_exposures = False;
gcv.foreground = 0;
gcv.background = 1;
@@ -608,6 +608,9 @@ InitCompositePix(XParms xp, Parms p, int reps)
case PictStandardA1:
depth = 1;
break;
+ default:
+ depth = 0;
+ break;
}
if (!format)
format = XRenderFindStandardFormat (xp->d, xp->planemask);
diff --git a/do_text.c b/do_text.c
index 84763b2..8f4fd74 100644
--- a/do_text.c
+++ b/do_text.c
@@ -444,8 +444,8 @@ InitAAText(XParms xp, Parms p, int reps)
printf ("Cannot allocate black\n");
XftFontClose (xp->d, aafont);
XftDrawDestroy (aadraw);
- aafont = 0;
- aadraw = 0;
+ aafont = NULL;
+ aadraw = NULL;
return 0;
}
diff --git a/do_traps.c b/do_traps.c
index 01a64ed..739b7f7 100644
--- a/do_traps.c
+++ b/do_traps.c
@@ -172,8 +172,8 @@ InitFixedTraps(XParms xp, Parms p, int reps)
maskFormat = XRenderFindStandardFormat (xp->d, std_fmt);
maskPixmap = XCreatePixmap (xp->d, xp->w, WIDTH, HEIGHT, depth);
-
- mask = XRenderCreatePicture (xp->d, maskPixmap, maskFormat, 0, 0);
+
+ mask = XRenderCreatePicture (xp->d, maskPixmap, maskFormat, 0, NULL);
color.red = 0;
color.green = 0;
@@ -185,7 +185,7 @@ InitFixedTraps(XParms xp, Parms p, int reps)
&color, &aablack))
{
XftDrawDestroy (aadraw);
- aadraw = 0;
+ aadraw = NULL;
return 0;
}
color.red = 0xffff;
@@ -198,7 +198,7 @@ InitFixedTraps(XParms xp, Parms p, int reps)
&color, &aawhite))
{
XftDrawDestroy (aadraw);
- aadraw = 0;
+ aadraw = NULL;
return 0;
}
@@ -304,7 +304,7 @@ InitFixedTrapezoids(XParms xp, Parms p, int reps)
0);
}
else
- maskFormat = 0;
+ maskFormat = NULL;
color.red = 0;
color.green = 0;
color.blue = 0;
@@ -315,7 +315,7 @@ InitFixedTrapezoids(XParms xp, Parms p, int reps)
&color, &aablack))
{
XftDrawDestroy (aadraw);
- aadraw = 0;
+ aadraw = NULL;
return 0;
}
color.red = 0xffff;
@@ -328,7 +328,7 @@ InitFixedTrapezoids(XParms xp, Parms p, int reps)
&color, &aawhite))
{
XftDrawDestroy (aadraw);
- aadraw = 0;
+ aadraw = NULL;
return 0;
}
diff --git a/x11perf.c b/x11perf.c
index 08c0062..0997f41 100644
--- a/x11perf.c
+++ b/x11perf.c
@@ -49,7 +49,7 @@ int abortTest;
typedef struct _RopNames { char *name; int rop; } RopNameRec, *RopNamePtr;
-RopNameRec ropNames[] = {
+static RopNameRec ropNames[] = {
{ "clear", GXclear }, /* 0 */
{ "and", GXand }, /* src AND dst */
{ "andReverse", GXandReverse }, /* src AND NOT dst */
@@ -68,7 +68,7 @@ RopNameRec ropNames[] = {
{ "set", GXset } /* 1 */
};
-RopNameRec popNames[] = {
+static RopNameRec popNames[] = {
{ "Clear", PictOpClear },
{ "Src", PictOpSrc },
{ "Dst", PictOpDst },
@@ -85,7 +85,7 @@ RopNameRec popNames[] = {
{ "Saturate", PictOpSaturate },
};
-RopNameRec formatNames[] = {
+static RopNameRec formatNames[] = {
{ "RGB24", PictStandardRGB24 },
{ "ARGB32", PictStandardARGB32 },
{ "A8", PictStandardA8 },
@@ -94,7 +94,7 @@ RopNameRec formatNames[] = {
{ "NATIVE", PictStandardNative },
};
-char *(visualClassNames)[] = {
+static char *(visualClassNames)[] = {
"StaticGray",
"GrayScale",
"StaticColor",
@@ -1093,14 +1093,14 @@ main(int argc, char *argv[])
len = strlen(argv[i]);
if(len>=3)
ForEachTest (j) {
- if (Strstr (test[j].option, argv[i]+1) != 0) {
+ if (Strstr (test[j].option, argv[i]+1) != NULL) {
fprintf(stderr," -> %s %s\n", test[j].option, LABELP(j));
doit[j] = found = True;
}
}
if(!found)
ForEachTest (j) {
- if (Strstr (LABELP(j), argv[i]+1) != 0) {
+ if (Strstr (LABELP(j), argv[i]+1) != NULL) {
fprintf(stderr," -> %s %s\n", test[j].option, LABELP(j));
doit[j] = found = True;
}