diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-13 18:55:51 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-13 18:55:51 -0200 |
commit | c7f3c6652e9507e4303fd9ed913c593afb7447f0 (patch) | |
tree | bb78edc4cdd137a3f2e7eb6e9d6fdd3b2c9f9706 | |
parent | 828c0323450eadaf040749c010918679f5e4fe53 (diff) |
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects
make distcheck.
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | bitmaps.c | 4 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | do_blt.c | 21 | ||||
-rw-r--r-- | do_text.c | 4 | ||||
-rw-r--r-- | do_traps.c | 14 | ||||
-rw-r--r-- | x11perf.c | 12 |
8 files changed, 41 insertions, 28 deletions
@@ -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 @@ -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]) @@ -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); @@ -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; } @@ -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; } @@ -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; } |