From f364bacf872175fa397225417276ae6620e72f29 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 12:07:26 +0200 Subject: Xserver/xfixes/region.c: Don't declare and set PictureScreenPtr ps (in ProcXFixesSetPictureClipRegion). Variable is not used. --- nx-X11/programs/Xserver/xfixes/region.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 398409e61..f0044735a 100755 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -754,14 +754,12 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) PicturePtr pPicture; RegionPtr pRegion; ScreenPtr pScreen; - PictureScreenPtr ps; REQUEST(xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, RenderErrBase + BadPicture); pScreen = pPicture->pDrawable->pScreen; - ps = GetPictureScreen (pScreen); VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityReadAccess); return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, -- cgit v1.2.3 From cef6d723cb003a6f9b2cf1cb37eb340dad6a76e6 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 12:18:52 +0200 Subject: Xserver/composite/compint.h: Disable debugging in Copmosite extension. --- nx-X11/programs/Xserver/composite/compint.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/composite/compint.h b/nx-X11/programs/Xserver/composite/compint.h index 2834dad4e..62d5fd868 100644 --- a/nx-X11/programs/Xserver/composite/compint.h +++ b/nx-X11/programs/Xserver/composite/compint.h @@ -56,10 +56,8 @@ /* * enable this for debugging - - #define COMPOSITE_DEBUG - */ #define COMPOSITE_DEBUG + */ typedef struct _CompClientWindow { struct _CompClientWindow *next; -- cgit v1.2.3 From b91099b977ea7b3757adfebb3fad930ee0411c4f Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 29 Jun 2016 12:38:31 +0200 Subject: Add _X_UNUSED attribute to designate unused variables and silence warnings Signed-off-by: Jeremy Huddleston Reviewed-by: Daniel Stone Backport to nx-libs: Mike Gabriel --- nx-X11/include/Xfuncproto.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nx-X11') diff --git a/nx-X11/include/Xfuncproto.h b/nx-X11/include/Xfuncproto.h index a18ac19c4..f6729a0d9 100644 --- a/nx-X11/include/Xfuncproto.h +++ b/nx-X11/include/Xfuncproto.h @@ -97,4 +97,11 @@ in this Software without prior written authorization from The Open Group. # define _X_DEPRECATED #endif +/* requires xproto >= 7.0.22 */ +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205) +#define _X_UNUSED __attribute__((__unused__)) +#else +#define _X_UNUSED /* */ +#endif + #endif /* _XFUNCPROTO_H_ */ -- cgit v1.2.3 From 3a54da8bcaa9aa1935fb4bff183560d1bc330323 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Wed, 29 Jun 2016 12:37:22 +0200 Subject: fb: Mark some variables as unused. There's no use for the values set through the various macro calls (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused. The following warnings go away accordingly: | CC libfb_la-fb24_32.lo | fb24_32.c: In function 'fb24_32ReformatTile': | fb24_32.c:544:19: warning: variable 'newYoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:544:10: warning: variable 'newXoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:543:19: warning: variable 'oldYoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:543:10: warning: variable 'oldXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbfill.lo | fbfill.c: In function 'fbFill': | fbfill.c:72:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:72:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | fbfill.c:142:20: warning: variable 'tileYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:142:10: warning: variable 'tileXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbgc.lo | fbgc.c: In function 'fbPadPixmap': | fbgc.c:92:19: warning: variable 'yOff' set but not used [-Wunused-but-set-variable] | fbgc.c:92:13: warning: variable 'xOff' set but not used [-Wunused-but-set-variable] | fbgc.c: In function 'fbCanEvenStipple': | fbgc.c:166:23: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbgc.c:166:13: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbpush.lo | fbpush.c: In function 'fbPushPixels': | fbpush.c:238:20: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbpush.c:238:10: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/fb/fb24_32.c | 4 ++-- nx-X11/programs/Xserver/fb/fbfill.c | 6 +++--- nx-X11/programs/Xserver/fb/fbgc.c | 2 +- nx-X11/programs/Xserver/fb/fbpict.h | 2 +- nx-X11/programs/Xserver/fb/fbpush.c | 2 +- nx-X11/programs/Xserver/fb/fbwindow.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/fb/fb24_32.c b/nx-X11/programs/Xserver/fb/fb24_32.c index 350055c14..5dc34d7f5 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.c +++ b/nx-X11/programs/Xserver/fb/fb24_32.c @@ -534,8 +534,8 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) FbStride oldStride, newStride; int oldBpp, newBpp; fb24_32BltFunc blt; - int oldXoff, oldYoff; - int newXoff, newYoff; + _X_UNUSED int oldXoff, oldYoff; + _X_UNUSED int newXoff, newYoff; pNewTile = fbCreatePixmapBpp (pScreen, pOldTile->drawable.width, diff --git a/nx-X11/programs/Xserver/fb/fbfill.c b/nx-X11/programs/Xserver/fb/fbfill.c index be6723c01..72a12baaf 100644 --- a/nx-X11/programs/Xserver/fb/fbfill.c +++ b/nx-X11/programs/Xserver/fb/fbfill.c @@ -72,7 +72,7 @@ fbFill (DrawablePtr pDrawable, FbBits *stip; FbStride stipStride; int stipBpp; - int stipXoff, stipYoff; /* XXX assumed to be zero */ + _X_UNUSED int stipXoff, stipYoff; /* XXX assumed to be zero */ if (pGC->fillStyle == FillStippled) alu = FbStipple1Rop(pGC->alu,pGC->fgPixel); @@ -99,7 +99,7 @@ fbFill (DrawablePtr pDrawable, FbStip *stip; FbStride stipStride; int stipBpp; - int stipXoff, stipYoff; /* XXX assumed to be zero */ + _X_UNUSED int stipXoff, stipYoff; /* XXX assumed to be zero */ FbBits fgand, fgxor, bgand, bgxor; fgand = pPriv->and; @@ -140,7 +140,7 @@ fbFill (DrawablePtr pDrawable, int tileBpp; int tileWidth; int tileHeight; - int tileXoff, tileYoff; /* XXX assumed to be zero */ + _X_UNUSED int tileXoff, tileYoff; /* XXX assumed to be zero */ fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff); tileWidth = pTile->drawable.width; diff --git a/nx-X11/programs/Xserver/fb/fbgc.c b/nx-X11/programs/Xserver/fb/fbgc.c index a980023ef..1475aca66 100644 --- a/nx-X11/programs/Xserver/fb/fbgc.c +++ b/nx-X11/programs/Xserver/fb/fbgc.c @@ -170,7 +170,7 @@ fbCanEvenStipple (PixmapPtr pStipple, int bpp) FbBits *bits; int stride; int stip_bpp; - int stipXoff, stipYoff; + _X_UNUSED int stipXoff, stipYoff; int h; /* can't even stipple 24bpp drawables */ diff --git a/nx-X11/programs/Xserver/fb/fbpict.h b/nx-X11/programs/Xserver/fb/fbpict.h index 665b92dd1..173a96ac4 100644 --- a/nx-X11/programs/Xserver/fb/fbpict.h +++ b/nx-X11/programs/Xserver/fb/fbpict.h @@ -72,7 +72,7 @@ FbBits *__bits__; \ FbStride __stride__; \ int __bpp__; \ - int __xoff__,__yoff__; \ + _X_UNUSED int __xoff__,__yoff__; \ \ fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ switch (__bpp__) { \ diff --git a/nx-X11/programs/Xserver/fb/fbpush.c b/nx-X11/programs/Xserver/fb/fbpush.c index 78d2e450d..5f7459c51 100644 --- a/nx-X11/programs/Xserver/fb/fbpush.c +++ b/nx-X11/programs/Xserver/fb/fbpush.c @@ -237,7 +237,7 @@ fbPushPixels (GCPtr pGC, FbStip *stip; FbStride stipStride; int stipBpp; - int stipXoff, stipYoff; /* Assumed to be zero */ + _X_UNUSED int stipXoff, stipYoff; /* Assumed to be zero */ fbGetStipDrawable (&pBitmap->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff); diff --git a/nx-X11/programs/Xserver/fb/fbwindow.c b/nx-X11/programs/Xserver/fb/fbwindow.c index b2df19f0d..707403da6 100644 --- a/nx-X11/programs/Xserver/fb/fbwindow.c +++ b/nx-X11/programs/Xserver/fb/fbwindow.c @@ -251,7 +251,7 @@ fbFillRegionTiled (DrawablePtr pDrawable, FbBits *tile; FbStride tileStride; int tileBpp; - int tileXoff, tileYoff; /* XXX assumed to be zero */ + _X_UNUSED int tileXoff, tileYoff; /* XXX assumed to be zero */ int tileWidth, tileHeight; int n = RegionNumRects(pRegion); BoxPtr pbox = RegionRects(pRegion); -- cgit v1.2.3 From 7e21611dbbf11d5ed5004204f6e606c60187815a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 29 Jun 2016 12:45:45 +0200 Subject: Remove fbpseudocolor "An experimental pseudocolor emulation layer. Not fully completed, currently only works for 16bpp." That was almost four years ago. It still doesn't work, only one driver even attempts to use it, it contains an ad-hoc implementation of damage, and should really be done up in Composite now anyway. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/fb/Imakefile | 2 - nx-X11/programs/Xserver/fb/fbpseudocolor.c | 2335 ---------------------------- nx-X11/programs/Xserver/fb/fbpseudocolor.h | 20 - 3 files changed, 2357 deletions(-) delete mode 100644 nx-X11/programs/Xserver/fb/fbpseudocolor.c delete mode 100644 nx-X11/programs/Xserver/fb/fbpseudocolor.h (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/fb/Imakefile b/nx-X11/programs/Xserver/fb/Imakefile index 2d17a856e..b5e8d590f 100644 --- a/nx-X11/programs/Xserver/fb/Imakefile +++ b/nx-X11/programs/Xserver/fb/Imakefile @@ -91,7 +91,6 @@ SRCS = $(XFMODSRC) \ fb24_32.c \ fbpict.c \ fbmmx.c \ - fbpseudocolor.c OBJS = $(XFMODOBJ) \ fbarc.o \ @@ -128,7 +127,6 @@ OBJS = $(XFMODOBJ) \ fb24_32.o \ fbpict.o \ fbmmx.o \ - fbpseudocolor.o INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) \ diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c deleted file mode 100644 index c22309a93..000000000 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ /dev/null @@ -1,2335 +0,0 @@ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "scrnintstr.h" -#include "colormapst.h" -#include "glyphstr.h" -#include "resource.h" -#include -#include "dixfontstr.h" -#include -#include "micmap.h" -#include "fb.h" -#include "fbpseudocolor.h" - -static Bool xxCreateGC(GCPtr pGC); -static void xxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); -static void xxDestroyGC(GCPtr pGC); -static void xxChangeGC (GCPtr pGC, unsigned long mask); -static void xxCopyGC (GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -static void xxChangeClip (GCPtr pGC, int type, void * pvalue, int nrects); - -static void xxCopyClip(GCPtr pgcDst, GCPtr pgcSrc); -static void xxDestroyClip(GCPtr pGC); -static void xxFillSpans(DrawablePtr pDraw, GC *pGC, int nInit, - DDXPointPtr pptInit, int *pwidthInit, int fSorted); -static void xxSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc, - DDXPointPtr pptInit, int *pwidthInit, int nspans, - int fSorted); -static void xxPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, - int w, int h,int leftPad, int format, char *pImage); -static RegionPtr xxCopyPlane(DrawablePtr pSrc, - DrawablePtr pDst, GCPtr pGC,int srcx, int srcy, - int width, int height, int dstx, int dsty, - unsigned long bitPlane); -static void xxPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, int npt, - xPoint *pptInit); -static void xxPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, - int npt, DDXPointPtr pptInit); -static void xxPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, - xSegment *pSeg); -static void xxPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRects, - xRectangle *pRects); -static void xxPolyArc( DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs); -static void xxFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr pptInit); -static void xxPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nRectsInit, - xRectangle *pRectsInit); -static RegionPtr xxCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GC *pGC, - int srcx, int srcy, int width, int height, - int dstx, int dsty); -static void xxPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, - xArc *parcs); -static int xxPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, - char *chars); -static int xxPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars); -static void xxImageText8(DrawablePtr pDraw, GCPtr pGC, int x, - int y, int count, char *chars); -static void xxImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars); -static void xxImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr *ppci, - void * pglyphBase); -static void xxPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr *ppci, - void * pglyphBase); -static void xxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, - int dx, int dy, int xOrg, int yOrg); -static void -xxComposite (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); -static void -xxGlyphs (CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, - GlyphListPtr list, GlyphPtr *glyphs); - - -typedef struct _xxCmapPrivRec { - CARD32* cmap; - ColormapPtr pmap; - Bool dirty; - struct _xxCmapPrivRec *next; -} xxCmapPrivRec, *xxCmapPrivPtr; - - -typedef struct { - CloseScreenProcPtr CloseScreen; - CreateScreenResourcesProcPtr CreateScreenResources; - CreateWindowProcPtr CreateWindow; - CopyWindowProcPtr CopyWindow; - PaintWindowProcPtr PaintWindowBackground; - PaintWindowProcPtr PaintWindowBorder; - WindowExposuresProcPtr WindowExposures; - CreateGCProcPtr CreateGC; - CreateColormapProcPtr CreateColormap; - DestroyColormapProcPtr DestroyColormap; - InstallColormapProcPtr InstallColormap; - UninstallColormapProcPtr UninstallColormap; - ListInstalledColormapsProcPtr ListInstalledColormaps; - StoreColorsProcPtr StoreColors; -#ifdef RENDER - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; -#endif - PixmapPtr pPixmap; - char * addr; - void *pBits; - RegionRec region; - VisualPtr bVisual; - RegionRec bRegion; - int myDepth; - int depth; - ColormapPtr baseCmap; - ColormapPtr* InstalledCmaps; - xxCmapPrivPtr Cmaps; - int numInstalledColormaps; - int colormapDirty; - xxSyncFunc sync; -} xxScrPrivRec, *xxScrPrivPtr; - -#define xxGetScrPriv(s) ((xxScrPrivPtr) \ - (xxScrPrivateIndex != -1) \ - ? (s)->devPrivates[xxScrPrivateIndex].ptr\ - : NULL) -#define xxScrPriv(s) xxScrPrivPtr pScrPriv = xxGetScrPriv(s) - -#define xxGetCmapPriv(s) ((xxCmapPrivPtr) \ - (s)->devPrivates[xxColormapPrivateIndex].ptr) -#define xxCmapPriv(s) xxCmapPrivPtr pCmapPriv = xxGetCmapPriv(s); - -typedef struct _xxGCPriv { - GCOps *ops; - GCFuncs *funcs; -} xxGCPrivRec, *xxGCPrivPtr; - -#define xxGetGCPriv(pGC) ((xxGCPrivPtr) \ - (pGC)->devPrivates[xxGCPrivateIndex].ptr) -#define xxGCPriv(pGC) xxGCPrivPtr pGCPriv = xxGetGCPriv(pGC) - -int xxScrPrivateIndex = -1; -int xxGCPrivateIndex; -int xxColormapPrivateIndex = -1; -int xxGeneration; - - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -#define MARK_DIRTY (1 << 31) - -#define MAX_NUM_XX_INSTALLED_CMAPS 255 -/* #define DEBUG */ -#ifdef DEBUG -# define DBG ErrorF -# define DBG_ARGS(x) ErrorF x -# define PRINT_RECTS(rec) {\ - int i;\ - BoxPtr box;\ - ErrorF("RECTS: %i\n",RegionNumRects(&rec));\ - if (RegionNumRects(&rec) > 1) { \ - for (i = 0; i < RegionNumRects(&rec); i++ ) {\ - box = RegionBox(&rec,i);\ - ErrorF("x1: %hi x2: %hi y1: %hi y2: %hi\n", \ - box->x1,box->x2,box->y1,box->y2);\ - }\ - } else { \ - box = &(rec.extents); \ - ErrorF("x1: %hi x2: %hi y1: %hi y2: %hi\n", \ - box->x1,box->x2,box->y1,box->y2);\ - } \ -} -#else -# define DBG(x) -# define DBG_ARGS(x) -# define PRINT_RECTS(rec) -#endif - -#if 0 -static void xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, - xxCmapPrivPtr pCmapPriv); -static void xxUpdateFb(ScreenPtr pScreen); - - -static void -xxUpdateWindowImmediately(WindowPtr pWin) -{ - xxScrPriv(pWin->drawable.pScreen); - xxCmapPrivPtr pCmapPriv; - ColormapPtr pmap; - - pmap = (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); - - if (pmap && (pCmapPriv = xxGetCmapPriv(pmap)) != (void *)-1) { - xxCopyPseudocolorRegion(pWin->drawable.pScreen, - &pScrPriv->region, pCmapPriv); - } -} -#else -# define xxUpdateWindowImmediately(x) -#endif - -static ColormapPtr -xxGetBaseColormap(ScreenPtr pScreen) -{ - xxScrPriv(pScreen); - DepthPtr pDepth = pScreen->allowedDepths; - int i,j,k; - ColormapPtr pDefMap - = (ColormapPtr) LookupIDByType(pScreen->defColormap,RT_COLORMAP); - ColormapPtr cmap = NULL; - VisualPtr pVisual = NULL; - - for (i = 0; i < pScreen->numDepths; i++, pDepth++) - if (pDepth->depth == pScrPriv->depth) { - for (j = 0; j < pDepth->numVids; j++) { - if (pDefMap->pVisual->vid == pDepth->vids[j] - && pDefMap->pVisual->class == TrueColor) { - cmap = pDefMap; - break; - } - if (!pVisual) { - for (k = 0; k < pScreen->numVisuals; k++) { - if (pScreen->visuals[k].class == TrueColor - && pScreen->visuals[k].vid - == pDepth->vids[j]) { - pVisual = &pScreen->visuals[k]; - break; - } - } - } - } - if (cmap) - break; - } - - if (!cmap) { - CreateColormap(FakeClientID(0),pScreen,pVisual,&cmap,AllocNone,0); - } - - return cmap; -} - -static Bool -xxCreateScreenResources(ScreenPtr pScreen) -{ - PixmapPtr pPix; - xxScrPriv(pScreen); - Bool ret; - PixmapPtr pPixmap; - BoxRec box; - int depth = pScrPriv->myDepth; - void *pBits; - - unwrap (pScrPriv,pScreen, CreateScreenResources); - ret = pScreen->CreateScreenResources(pScreen); - wrap(pScrPriv,pScreen,CreateScreenResources,xxCreateScreenResources); - - if (!ret) return FALSE; - - pScrPriv->pBits = NULL; - if (pScrPriv->addr) - pBits = pScrPriv->addr; - else - pBits = malloc(pScreen->width * pScreen->height - * (BitsPerPixel(depth) >> 3)); - if (!pBits) return FALSE; - - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); - if (!pPixmap) { - free(pBits); - return FALSE; - } - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width, - pScreen->height, depth, - BitsPerPixel(depth), - PixmapBytePad(pScreen->width, depth), - pBits)) { - free(pBits); - return FALSE; - } - if (pScreen->rootDepth == pScrPriv->myDepth) { - pPix = (PixmapPtr)pScreen->devPrivate; - if (!(*pScreen->ModifyPixmapHeader)(pPix, 0,0, pScrPriv->depth, - BitsPerPixel(pScrPriv->depth), - PixmapBytePad(pScreen->width, - pScrPriv->depth), - 0)) { - free(pBits); - return FALSE; - } - } - - pScrPriv->baseCmap = xxGetBaseColormap(pScreen); - - pScrPriv->pBits = pBits; - pScrPriv->pPixmap = pPixmap; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - RegionNull(&pScrPriv->region); - RegionInit(&pScrPriv->bRegion, &box, 0); - - return TRUE; -} - -static Bool -xxCloseScreen (int iScreen, ScreenPtr pScreen) -{ - xxScrPriv(pScreen); - Bool ret; - - (*pScreen->DestroyPixmap)(pScrPriv->pPixmap); - /* We don't need to free the baseColormap as FreeClientResourcess - will have taken care of it. */ - RegionUninit(&pScrPriv->region); - - unwrap (pScrPriv,pScreen, CloseScreen); - ret = pScreen->CloseScreen(iScreen,pScreen); - - free(pScrPriv->pBits); - free(pScrPriv->InstalledCmaps); - free(pScrPriv); - - return TRUE; -} - -static Bool -xxMyVisual(ScreenPtr pScreen, VisualID vid) -{ - xxScrPriv(pScreen); - DepthPtr pDepth = pScreen->allowedDepths; - int i,j; - - for (i = 0; i < pScreen->numDepths; i++, pDepth++) - if (pDepth->depth == pScrPriv->myDepth) { - for (j = 0; j < pDepth->numVids; j++) { - if (vid == pDepth->vids[j]) { - return TRUE; - } - } - } - return FALSE; -} - -static Bool -xxInitColormapDummy(ColormapPtr pmap, int index) -{ - return TRUE; -} - -static Bool -xxInitColormapPrivate(ColormapPtr pmap) -{ - xxScrPriv(pmap->pScreen); - xxCmapPrivPtr pCmapPriv; - void *cmap; - - pmap->devPrivates[xxColormapPrivateIndex].ptr = (void *) -1; - - if (xxMyVisual(pmap->pScreen,pmap->pVisual->vid)) { - DBG("CreateColormap\n"); - pCmapPriv = (xxCmapPrivPtr) malloc (sizeof (xxCmapPrivRec)); - if (!pCmapPriv) - return FALSE; - pmap->devPrivates[xxColormapPrivateIndex].ptr = (void *) pCmapPriv; - cmap = malloc(sizeof (CARD32) * (1 << pScrPriv->myDepth)); - if (!cmap) - return FALSE; - - memset(cmap,0,sizeof (CARD32) * (1 << pScrPriv->myDepth)); - - pCmapPriv->cmap = cmap; - pCmapPriv->dirty = FALSE; - pCmapPriv->pmap = pmap; - pCmapPriv->next = pScrPriv->Cmaps; - pScrPriv->Cmaps = pCmapPriv; - } - return TRUE; -} - - -static Bool -xxCreateColormap(ColormapPtr pmap) -{ - xxScrPriv(pmap->pScreen); - Bool ret; - - if (!xxInitColormapPrivate(pmap)) return FALSE; - - unwrap(pScrPriv,pmap->pScreen, CreateColormap); - ret = pmap->pScreen->CreateColormap(pmap); - wrap(pScrPriv,pmap->pScreen,CreateColormap,xxCreateColormap); - - return ret; -} - -static int -xxCmapInstalled(ColormapPtr pmap) -{ - xxScrPriv(pmap->pScreen); - int i; - - for (i = 0; i < pScrPriv->numInstalledColormaps; i++) - if (pScrPriv->InstalledCmaps[i] == pmap) - break; - if (i == pScrPriv->numInstalledColormaps) /* not installed */ - return -1; - return i; -} - -static void -xxInstalledCmapDelete(ScreenPtr pScreen, int num) -{ - xxScrPriv(pScreen); - int i; - - pScrPriv->numInstalledColormaps--; - - for (i = num; i < pScrPriv->numInstalledColormaps; i++) - pScrPriv->InstalledCmaps[i] = pScrPriv->InstalledCmaps[i+1]; -} - -static void -xxDestroyColormap(ColormapPtr pmap) -{ - xxScrPriv(pmap->pScreen); - xxCmapPriv(pmap); - - if (pCmapPriv != (void *) -1) { - xxCmapPrivPtr tmpCmapPriv = pScrPriv->Cmaps; - xxCmapPrivPtr *prevCmapPriv = &pScrPriv->Cmaps; - int n; - - DBG("DestroyColormap\n"); - - if ((n = xxCmapInstalled(pmap)) != -1) - xxInstalledCmapDelete(pmap->pScreen,n); - - while (tmpCmapPriv) { - if (tmpCmapPriv->pmap == pmap) { - *prevCmapPriv = tmpCmapPriv->next; - break; - } - prevCmapPriv = &tmpCmapPriv->next; - tmpCmapPriv = tmpCmapPriv->next; - } - - free(pCmapPriv->cmap); - free(pCmapPriv); - } - - unwrap(pScrPriv,pmap->pScreen, DestroyColormap); - pmap->pScreen->DestroyColormap(pmap); - wrap(pScrPriv,pmap->pScreen,DestroyColormap,xxDestroyColormap); -} - -#define Shift(v,d) ((d) < 0 ? ((v) >> (-d)) : ((v) << (d))) - -static int -xxComputeCmapShift (unsigned long mask) -{ - int shift; - unsigned long bit; - - shift = 16; - bit = 0x80000000; - while (!(mask & bit)) - { - shift--; - bit >>= 1; - } - return shift; -} - -static void -xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors) -{ - xxScrPriv(pmap->pScreen); - xxCmapPriv(pmap); - - if (pCmapPriv != (void *) -1) { - - xColorItem *expanddefs; - int i; - VisualPtr bVisual; - int rs, gs, bs; - - if (nColors == 0) return; - - DBG("StoreColors\n"); - - expanddefs = ALLOCATE_LOCAL(sizeof(xColorItem) - * (1 << pScrPriv->myDepth)); - if (!expanddefs) return; - - bVisual = pScrPriv->bVisual; - - DBG("StoreColors\n"); - - rs = xxComputeCmapShift(bVisual->redMask); - gs = xxComputeCmapShift(bVisual->greenMask); - bs = xxComputeCmapShift(bVisual->blueMask); - - if ((pmap->pVisual->class | DynamicClass) == DirectColor) { - nColors = miExpandDirectColors(pmap, nColors, pColors, expanddefs); - pColors = expanddefs; - } - - for (i = 0; i < nColors; i++) { - DBG_ARGS(("index: %i r 0x%x g 0x%x b 0x%x\n", pColors->pixel, - pColors->red, pColors->green, pColors->blue)); - pCmapPriv->cmap[pColors->pixel] = MARK_DIRTY - | (Shift(pColors->red, rs) & bVisual->redMask) - | (Shift(pColors->green, gs) & bVisual->greenMask) - | (Shift(pColors->blue, bs) & bVisual->blueMask); - pColors++; - } - - DEALLOCATE_LOCAL(expanddefs); - - pCmapPriv->dirty = TRUE; - pScrPriv->colormapDirty = TRUE; - - return; - } - - unwrap(pScrPriv,pmap->pScreen, StoreColors); - pmap->pScreen->StoreColors(pmap,nColors,pColors); - wrap(pScrPriv,pmap->pScreen,StoreColors,xxStoreColors); -} - -static void -xxInstallColormap(ColormapPtr pmap) -{ - int i; - xxScrPriv(pmap->pScreen); - xxCmapPriv(pmap); - - if (pCmapPriv != (void *) -1) { - Pixel *pixels; - xrgb *colors; - int i; - VisualPtr pVisual; - xColorItem *defs; - - DBG("InstallColormap\n"); - - if (xxCmapInstalled(pmap) != -1) - return; - - if (!pScrPriv->numInstalledColormaps) { - unwrap(pScrPriv,pmap->pScreen, InstallColormap); - pmap->pScreen->InstallColormap(pScrPriv->baseCmap); - wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap); - } - - pixels = ALLOCATE_LOCAL(sizeof(Pixel) * (1 << pScrPriv->myDepth)); - colors = ALLOCATE_LOCAL(sizeof(xrgb) * (1 << pScrPriv->myDepth)); - defs = ALLOCATE_LOCAL(sizeof(xColorItem) * (1 << pScrPriv->myDepth)); - - if (!pixels || !colors) - return; - - /* if we have more than max installed delete the oldest */ - if (pScrPriv->numInstalledColormaps == MAX_NUM_XX_INSTALLED_CMAPS) - xxInstalledCmapDelete(pmap->pScreen,0); - - pScrPriv->InstalledCmaps[pScrPriv->numInstalledColormaps] = pmap; - pScrPriv->numInstalledColormaps++; - - pVisual = pScrPriv->bVisual; - - for (i = 0; i < (1 << pScrPriv->myDepth); i++) - pixels[i] = i; - - QueryColors (pmap, (1 << pScrPriv->myDepth), pixels, colors); - - for (i = 0; i < (1 << pScrPriv->myDepth); i++) { - defs[i].pixel = pixels[i]; - defs[i].red = colors[i].red; - defs[i].green = colors[i].green; - defs[i].blue = colors[i].blue; - defs[i].flags = DoRed|DoGreen|DoBlue; - } - xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs); - - DEALLOCATE_LOCAL(pixels); - DEALLOCATE_LOCAL(colors); - DEALLOCATE_LOCAL(defs); - - return; - } - - for (i = pScrPriv->numInstalledColormaps; i ; i--) - WalkTree(pmap->pScreen, TellLostMap, - (char *)&pScrPriv->InstalledCmaps[i-1]->mid); - - pScrPriv->numInstalledColormaps = 0; - - unwrap(pScrPriv,pmap->pScreen, InstallColormap); - pmap->pScreen->InstallColormap(pmap); - wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap); -} - -static void -xxUninstallColormap(ColormapPtr pmap) -{ - xxScrPriv(pmap->pScreen); - xxCmapPriv(pmap); - - if (pCmapPriv != (void *) -1) { - int num; - - if ((num = xxCmapInstalled(pmap)) == -1) - return; - - DBG("UninstallColormap\n"); - xxInstalledCmapDelete(pmap->pScreen,num); - - return; - } - - unwrap(pScrPriv,pmap->pScreen, UninstallColormap); - pmap->pScreen->UninstallColormap(pmap); - wrap(pScrPriv,pmap->pScreen,UninstallColormap,xxUninstallColormap); - -} - -static int -xxListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIds) -{ - int n,i; - xxScrPriv(pScreen); - - unwrap(pScrPriv,pScreen, ListInstalledColormaps); - n = pScreen->ListInstalledColormaps(pScreen, pCmapIds); - wrap (pScrPriv,pScreen,ListInstalledColormaps,xxListInstalledColormaps); - - pCmapIds += n; - - for (i = 0; i < pScrPriv->numInstalledColormaps; i++) { - *pCmapIds++ = pScrPriv->InstalledCmaps[i]->mid; - n++; - } - - return n; -} - -static Bool -xxCreateWindow(WindowPtr pWin) -{ - xxScrPriv(pWin->drawable.pScreen); - - if (pWin->drawable.class != InputOutput - || pScrPriv->myDepth != pWin->drawable.depth) { - Bool ret; - DBG("CreateWindow NoPseudo\n"); - unwrap (pScrPriv, pWin->drawable.pScreen, CreateWindow); - ret = pWin->drawable.pScreen->CreateWindow(pWin); - wrap(pScrPriv, pWin->drawable.pScreen, CreateWindow, xxCreateWindow); - - return ret; - } - - DBG("CreateWindow\n"); - - pWin->devPrivates[fbWinPrivateIndex].ptr = (void *) pScrPriv->pPixmap; - PRINT_RECTS(pScrPriv->region); - if (!pWin->parent) { - RegionEmpty(&pScrPriv->region); - } - PRINT_RECTS(pScrPriv->region); - - return TRUE; -} - -static void -xxWalkChildren(WindowPtr pWin, RegionPtr pReg, PixmapPtr pPixmap) -{ - - WindowPtr pCurWin = pWin; - - do { - if (fbGetWindowPixmap(pCurWin) == pPixmap) { - DBG("WalkWindow Add\n"); - RegionUnion(pReg,pReg, - &pCurWin->borderClip); - } else { - DBG("WalkWindow Sub\n"); - RegionSubtract(pReg,pReg, - &pCurWin->borderClip); - } - if (pCurWin->lastChild) - xxWalkChildren(pCurWin->lastChild,pReg, pPixmap); - } while ((pCurWin = pCurWin->prevSib)); -} - -static void -xxPickMyWindows(WindowPtr pWin, RegionPtr pRgn) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - xxScrPriv(pScreen); - - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - RegionUnion(pRgn,pRgn,&pWin->borderClip); - } - if (pWin->lastChild) - xxWalkChildren(pWin->lastChild,pRgn,pScrPriv->pPixmap); -} - -static void -xxCopyWindow(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - xxScrPriv(pScreen); - RegionRec rgn; - RegionRec rgn_new; - int dx, dy; - PixmapPtr pPixmap = fbGetWindowPixmap(pWin); - - DBG("xxCopyWindow\n"); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - - RegionNull(&rgn_new); - RegionUnion(&rgn_new,&rgn_new,prgnSrc); - RegionTranslate(&rgn_new,-dx,-dy); - - RegionNull(&rgn); - xxPickMyWindows(pWin,&rgn); - - unwrap (pScrPriv, pScreen, CopyWindow); - pWin->devPrivates[fbWinPrivateIndex].ptr = fbGetScreenPixmap(pScreen); - pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc); - pWin->devPrivates[fbWinPrivateIndex].ptr = pPixmap; - wrap(pScrPriv, pScreen, CopyWindow, xxCopyWindow); - - RegionIntersect(&rgn,&rgn,&rgn_new); - if (RegionNotEmpty(&rgn)) { - fbCopyRegion(&pScrPriv->pPixmap->drawable,&pScrPriv->pPixmap->drawable, - 0,&rgn,dx,dy,fbCopyWindowProc,0,(void*)0); - RegionTranslate(&rgn,dx,dy); - RegionIntersect(&rgn_new,&pScrPriv->region,&rgn); - RegionSubtract(&pScrPriv->region,&pScrPriv->region,&rgn); - RegionTranslate(&rgn_new,-dx,-dy); - RegionUnion(&pScrPriv->region,&pScrPriv->region,&rgn_new); - } -#if 1 - RegionUninit(&rgn_new); - RegionUninit(&rgn); -#endif -} - -static void -xxWindowExposures (WindowPtr pWin, - RegionPtr prgn, - RegionPtr other_exposed) -{ - xxScrPriv(pWin->drawable.pScreen); - - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("WindowExposures\n"); - PRINT_RECTS(pScrPriv->region); - RegionUnion(&pScrPriv->region, - &pScrPriv->region, - prgn); - PRINT_RECTS(pScrPriv->region); - } else { - DBG("WindowExposures NonPseudo\n"); - PRINT_RECTS(pScrPriv->region); - RegionSubtract(&pScrPriv->region, - &pScrPriv->region, - prgn); - PRINT_RECTS(pScrPriv->region); - } - unwrap (pScrPriv, pWin->drawable.pScreen, WindowExposures); - pWin->drawable.pScreen->WindowExposures(pWin, prgn, other_exposed); - wrap(pScrPriv, pWin->drawable.pScreen, WindowExposures, xxWindowExposures); -} - -static void -xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xxScrPriv(pWin->drawable.pScreen); - RegionRec rgni; - - DBG("xxPaintWindow\n"); - - RegionNull(&rgni); -#if 0 - RegionUnion(&rgni, &rgni, &pWin->borderClip); - RegionIntersect(&rgni, &rgni, pRegion); -#else - RegionUnion(&rgni, &rgni, pRegion); -#endif - switch (what) { - case PW_BORDER: - RegionSubtract(&rgni, &rgni, &pWin->winSize); - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("PaintWindowBorder\n"); - RegionUnion(&pScrPriv->region, - &pScrPriv->region, &rgni); - } else { - DBG("PaintWindowBorder NoOverlay\n"); - RegionSubtract(&pScrPriv->region, - &pScrPriv->region, &rgni); - } - unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBorder); - pWin->drawable.pScreen->PaintWindowBorder (pWin, pRegion, what); - wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBorder, - xxPaintWindow); - break; - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - default: - RegionIntersect(&rgni, - &rgni,&pWin->winSize); - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("PaintWindowBackground\n"); - RegionUnion(&pScrPriv->region, - &pScrPriv->region, &rgni); - } else { - DBG("PaintWindowBackground NoOverlay\n"); - RegionSubtract(&pScrPriv->region, - &pScrPriv->region, &rgni); - } - break; - } - - unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBackground); - pWin->drawable.pScreen->PaintWindowBackground (pWin, pRegion, what); - wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBackground, - xxPaintWindow); - break; - } - PRINT_RECTS(rgni); - PRINT_RECTS(pScrPriv->region); -#if 1 - RegionUninit(&rgni); -#endif -} - -static void -xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, - xxCmapPrivPtr pCmapPriv) -{ - xxScrPriv(pScreen); - CARD32 mask = (1 << pScrPriv->myDepth) - 1; - int num = RegionNumRects(pReg); - BoxPtr pbox = RegionRects(pReg); - int width, height; - CARD8 *src; - CARD16 *dst, *dst_base; - int dst_stride; - register CARD32 *cmap = pCmapPriv->cmap; - register CARD8 *s; - register CARD16 *d; - int w; - - dst_base = (CARD16*) ((PixmapPtr)pScreen->devPrivate)->devPrivate.ptr; - dst_stride = (int)((PixmapPtr)pScreen->devPrivate)->devKind - / sizeof (CARD16); - - while (num--) { - height = pbox->y2 - pbox->y1; - width = pbox->x2 - pbox->x1; - - src = (unsigned char *) pScrPriv->pBits - + (pbox->y1 * pScreen->width) + pbox->x1; - dst = dst_base + (pbox->y1 * dst_stride) + pbox->x1; - while (height--) { - w = width; - s = src; - d = dst; - - while(w--) { - *(d++) = (CARD16)*(cmap + ((*(s++)) & mask)); - } - src += pScreen->width; - dst += dst_stride; - } - pbox++; - } -} - -static void -xxUpdateCmapPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, - xxCmapPrivPtr pCmapPriv) -{ - xxScrPriv(pScreen); - CARD32 mask = (1 << pScrPriv->myDepth) - 1; - int num = RegionNumRects(pReg); - BoxPtr pbox = RegionRects(pReg); - int width, height; - CARD8 *src; - CARD16 *dst, *dst_base; - int dst_stride; - register CARD32 val; - register CARD32 *cmap = pCmapPriv->cmap; - register CARD8 *s; - register CARD16 *d; - int w; - - dst_base = (CARD16*) ((PixmapPtr)pScreen->devPrivate)->devPrivate.ptr; - dst_stride = (int)((PixmapPtr)pScreen->devPrivate)->devKind - / sizeof (CARD16); - - while (num--) { - - height = pbox->y2 - pbox->y1; - width = pbox->x2 - pbox->x1; - - src = (unsigned char *) pScrPriv->pBits - + (pbox->y1 * pScreen->width) + pbox->x1; - dst = dst_base + (pbox->y1 * dst_stride) + pbox->x1; - while (height--) { - w = width; - s = src; - d = dst; - while(w--) { - val = *(cmap + ((*(s++)) & mask)); - if (val & MARK_DIRTY) { - *d = (CARD16) val; - } - d++; - } - src += pScreen->width; - dst += dst_stride; - } - pbox++; - } -} - -static void -xxGetWindowRegion(WindowPtr pWin,RegionPtr winreg) -{ - RegionNull(winreg); - /* get visible part of the border ...Argh */ - RegionSubtract(winreg,&pWin->borderSize, - &pWin->winSize); - RegionIntersect(winreg,winreg, - &pWin->borderClip); - /* add window interior excluding children */ - RegionUnion(winreg,winreg, - &pWin->clipList); -} - -static int -xxUpdateRegion(WindowPtr pWin, void * unused) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - xxScrPriv(pScreen); - ColormapPtr pmap = (void *) -1; - RegionRec winreg, rgni; - - if (pScrPriv->myDepth == pWin->drawable.depth) { - xxCmapPrivPtr pCmapPriv = (void *)-1; - xxGetWindowRegion(pWin,&winreg); - - if (pScrPriv->colormapDirty) { - - pmap = (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); - if (!pmap) - goto CONTINUE; /* return ? */ - - pCmapPriv = xxGetCmapPriv(pmap); - if (pCmapPriv == (void *) -1) - return WT_WALKCHILDREN; - if (!pCmapPriv->dirty) - goto CONTINUE; - - RegionNull(&rgni); - /* This will be taken care of when damaged regions are updated */ - RegionSubtract(&rgni, &winreg, &pScrPriv->region); - if (RegionNotEmpty(&rgni)) - xxUpdateCmapPseudocolorRegion(pScreen,&rgni, pCmapPriv); - } - CONTINUE: - - RegionNull(&rgni); - RegionIntersect(&rgni, &winreg, &pScrPriv->region); - - if (RegionNotEmpty(&rgni)) { - if (pmap == (void *) -1) { - pmap = - (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); - if (!pmap) /* return ? */ - pmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, - RT_COLORMAP); - pCmapPriv = xxGetCmapPriv(pmap); - } - - if (pCmapPriv != (void *)-1) - xxCopyPseudocolorRegion(pScreen,&rgni, pCmapPriv); - RegionSubtract(&pScrPriv->region, &pScrPriv->region, - &rgni); - } -#if 1 - RegionUninit(&rgni); - RegionUninit(&winreg); -#endif - } - return WT_WALKCHILDREN; -} - - -static void -xxUpdateFb(ScreenPtr pScreen) -{ - xxScrPriv(pScreen); - - DBG("Update FB\n"); - PRINT_RECTS(pScrPriv->region); - - if (pScrPriv->sync) - pScrPriv->sync(pScreen); /*@!@*/ - - WalkTree(pScreen,xxUpdateRegion,NULL); -#if 0 - if (RegionNotEmpty(&pScrPriv->region)) { - ColormapPtr pmap = (void *) -1; - xxCmapPrivPtr pCmapPriv; - - pmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, - RT_COLORMAP); - pCmapPriv = xxGetCmapPriv(pmap); - if (pCmapPriv != (void *)-1) - xxCopyPseudocolorRegion(pScreen,&pScrPriv->region, pCmapPriv); - RegionSubtract(&pScrPriv->region, &pScrPriv->region, - &pScrPriv->region); - } -#endif - if (pScrPriv->colormapDirty) { - xxCmapPrivPtr pCmap = pScrPriv->Cmaps; - - while (pCmap) { - int j; - - if (pCmap->dirty) { - for (j = 0; j < (1 << pScrPriv->myDepth); j++) - pCmap->cmap[j] &= ~MARK_DIRTY; - pCmap->dirty = FALSE; - } - pCmap = pCmap->next; - } - pScrPriv->colormapDirty = FALSE; - } -} - -static void -xxBlockHandler (void * data, - OSTimePtr pTimeout, - void * pRead) -{ - ScreenPtr pScreen = (ScreenPtr) data; - xxScrPriv(pScreen); - - if (RegionNotEmpty(&pScrPriv->region) || pScrPriv->colormapDirty) - xxUpdateFb (pScreen); -} - -static void -xxWakeupHandler (void * data, int i, void * LastSelectMask) -{ -} - -Bool -xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sync) -{ - xxScrPrivPtr pScrPriv; - DepthPtr pDepths; - ColormapPtr pDefMap; - int i,j,k; - -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - if (xxGeneration != serverGeneration) { - xxScrPrivateIndex = AllocateScreenPrivateIndex (); - if (xxScrPrivateIndex == -1) - return FALSE; - xxColormapPrivateIndex - = AllocateColormapPrivateIndex (xxInitColormapDummy); - if (xxColormapPrivateIndex == -1) - return FALSE; - xxGCPrivateIndex = AllocateGCPrivateIndex (); - if (xxGCPrivateIndex == -1) - return FALSE; - xxGeneration = serverGeneration; - } - - if (!AllocateGCPrivate (pScreen, xxGCPrivateIndex, sizeof (xxGCPrivRec))) - return FALSE; - - pScrPriv = (xxScrPrivPtr) malloc (sizeof (xxScrPrivRec)); - if (!pScrPriv) - return FALSE; - - if (baseDepth) - pScrPriv->depth = baseDepth; - else { - pDepths = pScreen->allowedDepths; - for (i = 0; i < pScreen->numDepths; i++, pDepths++) - if (pDepths->depth != myDepth) - pScrPriv->depth = pDepths->depth; - } - if (!pScrPriv->depth) - return FALSE; - - pDepths = pScreen->allowedDepths; - for (i = 0; i < pScreen->numDepths; i++, pDepths++) - if (pDepths->depth == pScrPriv->depth) { - for (j = 0; i < pDepths->numVids; j++) { - for (k = 0; k < pScreen->numVisuals; k++) { - if (pScreen->visuals[k].vid - == pDepths[i].vids[j] - && pScreen->visuals[k].class == TrueColor) { - pScrPriv->bVisual = &pScreen->visuals[k]; - goto DONE; - } - } - } - } - - DONE: - if (!pScrPriv->bVisual) - return FALSE; - - pScrPriv->myDepth = myDepth; - pScrPriv->numInstalledColormaps = 0; - pScrPriv->colormapDirty = FALSE; - pScrPriv->Cmaps = NULL; - pScrPriv->sync = sync; - - pScreen->maxInstalledCmaps += MAX_NUM_XX_INSTALLED_CMAPS; - pScrPriv->InstalledCmaps = calloc(MAX_NUM_XX_INSTALLED_CMAPS, - sizeof(ColormapPtr)); - if (!pScrPriv->InstalledCmaps) - return FALSE; - - - if (!RegisterBlockAndWakeupHandlers (xxBlockHandler, - xxWakeupHandler, - (void *) pScreen)) - return FALSE; - - wrap (pScrPriv, pScreen, CloseScreen, xxCloseScreen); - wrap (pScrPriv, pScreen, CreateScreenResources, xxCreateScreenResources); - wrap (pScrPriv, pScreen, CreateWindow, xxCreateWindow); - wrap (pScrPriv, pScreen, CopyWindow, xxCopyWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, xxPaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBackground, xxPaintWindow); -#if 0 /* can we leave this out even with backing store enabled ? */ - wrap (pScrPriv, pScreen, WindowExposures, xxWindowExposures); -#endif - wrap (pScrPriv, pScreen, CreateGC, xxCreateGC); - wrap (pScrPriv, pScreen, CreateColormap, xxCreateColormap); - wrap (pScrPriv, pScreen, DestroyColormap, xxDestroyColormap); - wrap (pScrPriv, pScreen, InstallColormap, xxInstallColormap); - wrap (pScrPriv, pScreen, UninstallColormap, xxUninstallColormap); - wrap (pScrPriv, pScreen, ListInstalledColormaps, xxListInstalledColormaps); - wrap (pScrPriv, pScreen, StoreColors, xxStoreColors); -#ifdef RENDER - if (ps) { - wrap (pScrPriv, ps, Glyphs, xxGlyphs); - wrap (pScrPriv, ps, Composite, xxComposite); - } -#endif - pScrPriv->addr = addr; - pScreen->devPrivates[xxScrPrivateIndex].ptr = (void *) pScrPriv; - - pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP); - if (!xxInitColormapPrivate(pDefMap)) - return FALSE; - - return TRUE; -} - -GCFuncs xxGCFuncs = { - xxValidateGC, xxChangeGC, xxCopyGC, xxDestroyGC, - xxChangeClip, xxDestroyClip, xxCopyClip -}; - -GCOps xxGCOps = { - xxFillSpans, xxSetSpans, - xxPutImage, xxCopyArea, - xxCopyPlane, xxPolyPoint, - xxPolylines, xxPolySegment, - xxPolyRectangle, xxPolyArc, - xxFillPolygon, xxPolyFillRect, - xxPolyFillArc, xxPolyText8, - xxPolyText16, xxImageText8, - xxImageText16, xxImageGlyphBlt, - xxPolyGlyphBlt, xxPushPixels, -#ifdef NEED_LINEHELPER - NULL, -#endif - {NULL} /* devPrivate */ -}; - -#define IS_VISIBLE(pDraw) (pDraw->type == DRAWABLE_WINDOW \ - && (fbGetWindowPixmap((WindowPtr) pDraw) == pScrPriv->pPixmap)) - -#define TRANSLATE_BOX(box, pDraw) { \ - box.x1 += pDraw->x; \ - box.x2 += pDraw->x; \ - box.y1 += pDraw->y; \ - box.y2 += pDraw->y; \ - } - -#define TRIM_BOX(box, pGC) { \ - BoxPtr extents = &pGC->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define BOX_NOT_EMPTY(box) \ - (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) - - -#define _ADD_BOX(box,pGC) {\ - if (BOX_NOT_EMPTY(box)) { \ - RegionRec region; \ - ScreenPtr pScreen = pGC->pScreen;\ - RegionInit(®ion, &box, 1); \ - RegionIntersect(®ion,®ion,\ - (pGC)->pCompositeClip);\ - if (RegionNotEmpty(®ion)) { \ - xxScrPriv(pScreen);\ - PRINT_RECTS(pScrPriv->region);\ - RegionUnion(&pScrPriv->region,&pScrPriv->region,®ion);\ - PRINT_RECTS(pScrPriv->region);\ - RegionUninit(®ion);\ - }\ - }\ -} - -#define TRANSLATE_AND_ADD_BOX(box,pGC) {\ - TRANSLATE_BOX(box,pDraw); \ - TRIM_BOX(box,pGC); \ - _ADD_BOX(box,pGC); \ -} - -#define ADD_BOX(box,pGC) { \ - TRIM_BOX(box,pGC); \ - _ADD_BOX(box,pGC); \ -} - -#define XX_GC_FUNC_PROLOGUE(pGC) \ - xxGCPriv(pGC); \ - unwrap(pGCPriv, pGC, funcs); \ - if (pGCPriv->ops) unwrap(pGCPriv, pGC, ops) - -#define XX_GC_FUNC_EPILOGUE(pGC) \ - wrap(pGCPriv, pGC, funcs, &xxGCFuncs); \ - if (pGCPriv->ops) wrap(pGCPriv, pGC, ops, &xxGCOps) - -static Bool -xxCreateGC(GCPtr pGC) -{ - ScreenPtr pScreen = pGC->pScreen; - xxScrPriv(pScreen); - xxGCPriv(pGC); - Bool ret; - - unwrap (pScrPriv, pScreen, CreateGC); - if((ret = (*pScreen->CreateGC) (pGC))) { - pGCPriv->ops = NULL; - pGCPriv->funcs = pGC->funcs; - pGC->funcs = &xxGCFuncs; - } - wrap (pScrPriv, pScreen, CreateGC, xxCreateGC); - - return ret; -} - -static void -xxValidateGC( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDraw -){ - XX_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ValidateGC)(pGC, changes, pDraw); - if(pDraw->type == DRAWABLE_WINDOW) - pGCPriv->ops = pGC->ops; /* just so it's not NULL */ - else - pGCPriv->ops = NULL; - XX_GC_FUNC_EPILOGUE (pGC); -} - -static void -xxDestroyGC(GCPtr pGC) -{ - XX_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->DestroyGC)(pGC); - XX_GC_FUNC_EPILOGUE (pGC); -} - -static void -xxChangeGC ( - GCPtr pGC, - unsigned long mask -){ - XX_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ChangeGC) (pGC, mask); - XX_GC_FUNC_EPILOGUE (pGC); -} - -static void -xxCopyGC ( - GCPtr pGCSrc, - unsigned long mask, - GCPtr pGCDst -){ - XX_GC_FUNC_PROLOGUE (pGCDst); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - XX_GC_FUNC_EPILOGUE (pGCDst); -} - -static void -xxChangeClip ( - GCPtr pGC, - int type, - void * pvalue, - int nrects -){ - XX_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - XX_GC_FUNC_EPILOGUE (pGC); -} - -static void -xxCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - XX_GC_FUNC_PROLOGUE (pgcDst); - (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); - XX_GC_FUNC_EPILOGUE (pgcDst); -} - -static void -xxDestroyClip(GCPtr pGC) -{ - XX_GC_FUNC_PROLOGUE (pGC); - (* pGC->funcs->DestroyClip)(pGC); - XX_GC_FUNC_EPILOGUE (pGC); -} - -#define XX_GC_OP_PROLOGUE(pGC,pDraw) \ - xxScrPriv(pDraw->pScreen); \ - xxGCPriv(pGC); \ - GCFuncs *oldFuncs = pGC->funcs; \ - unwrap(pGCPriv, pGC, funcs); \ - unwrap(pGCPriv, pGC, ops); \ - -#define XX_GC_OP_EPILOGUE(pGC,pDraw) \ - wrap(pGCPriv, pGC, funcs, oldFuncs); \ - wrap(pGCPriv, pGC, ops, &xxGCOps) - -static void -xxFillSpans( - DrawablePtr pDraw, - GC *pGC, - int nInit, - DDXPointPtr pptInit, - int *pwidthInit, - int fSorted -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nInit) { - DDXPointPtr ppt = pptInit; - int *pwidth = pwidthInit; - int i = nInit; - BoxRec box; - - DBG("FillSpans\n"); - box.x1 = ppt->x; - box.x2 = box.x1 + *pwidth; - box.y2 = box.y1 = ppt->y; - - while(--i) { - ppt++; - pwidthInit++; - if(box.x1 > ppt->x) box.x1 = ppt->x; - if(box.x2 < (ppt->x + *pwidth)) - box.x2 = ppt->x + *pwidth; - if(box.y1 > ppt->y) box.y1 = ppt->y; - else if(box.y2 < ppt->y) box.y2 = ppt->y; - } - - box.y2++; - - (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); - - - TRANSLATE_AND_ADD_BOX(box, pGC); - } else - (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); - - XX_GC_OP_EPILOGUE(pGC, pDraw); -} - -static void -xxSetSpans( - DrawablePtr pDraw, - GCPtr pGC, - char *pcharsrc, - DDXPointPtr pptInit, - int *pwidthInit, - int nspans, - int fSorted -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nspans) { - DDXPointPtr ppt = pptInit; - int *pwidth = pwidthInit; - int i = nspans; - BoxRec box; - - DBG("SetSpans\n"); - box.x1 = ppt->x; - box.x2 = box.x1 + *pwidth; - box.y2 = box.y1 = ppt->y; - - while(--i) { - ppt++; - pwidth++; - if(box.x1 > ppt->x) box.x1 = ppt->x; - if(box.x2 < (ppt->x + *pwidth)) - box.x2 = ppt->x + *pwidth; - if(box.y1 > ppt->y) box.y1 = ppt->y; - else if(box.y2 < ppt->y) box.y2 = ppt->y; - } - - box.y2++; - - (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit, - pwidthInit, nspans, fSorted); - - TRANSLATE_AND_ADD_BOX(box, pGC); - } else - (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit, - pwidthInit, nspans, fSorted); - - XX_GC_OP_EPILOGUE(pGC, pDraw); -} - -static void -xxPutImage( - DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, - int format, - char *pImage -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); - XX_GC_OP_EPILOGUE(pGC, pDraw); - if(IS_VISIBLE(pDraw)) { - BoxRec box; - - DBG("PutImage\n"); - box.x1 = x + pDraw->x; - box.x2 = box.x1 + w; - box.y1 = y + pDraw->y; - box.y2 = box.y1 + h; - - ADD_BOX(box, pGC); - } -} - -static RegionPtr -xxCopyArea( - DrawablePtr pSrc, - DrawablePtr pDst, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty -){ - RegionPtr ret; - XX_GC_OP_PROLOGUE(pGC, pDst); - DBG("xxCopyArea\n"); - ret = (*pGC->ops->CopyArea)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - XX_GC_OP_EPILOGUE(pGC, pDst); - - if(IS_VISIBLE(pDst)) { - BoxRec box; - - DBG("CopyArea\n"); - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - ADD_BOX(box, pGC); - } - - return ret; -} - -static RegionPtr -xxCopyPlane( - DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, - unsigned long bitPlane -){ - RegionPtr ret; - XX_GC_OP_PROLOGUE(pGC, pDst); - ret = (*pGC->ops->CopyPlane)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - XX_GC_OP_EPILOGUE(pGC, pDst); - - if(IS_VISIBLE(pDst)) { - BoxRec box; - - DBG("CopyPlane\n"); - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - ADD_BOX(box, pGC); - } - - return ret; -} - -static void -xxPolyPoint( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - xPoint *pptInit -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && npt) { - BoxRec box; - - DBG("PolyPoint\n"); - box.x2 = box.x1 = pptInit->x; - box.y2 = box.y1 = pptInit->y; - - /* this could be slow if the points were spread out */ - - while(--npt) { - pptInit++; - if(box.x1 > pptInit->x) box.x1 = pptInit->x; - else if(box.x2 < pptInit->x) box.x2 = pptInit->x; - if(box.y1 > pptInit->y) box.y1 = pptInit->y; - else if(box.y2 < pptInit->y) box.y2 = pptInit->y; - } - - box.x2++; - box.y2++; - - TRANSLATE_AND_ADD_BOX(box, pGC); - } -} - -static void -xxPolylines( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr pptInit -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - - if(IS_VISIBLE(pDraw) && npt) { - BoxRec box; - int extra = pGC->lineWidth >> 1; - - DBG("PolyLine\n"); - box.x2 = box.x1 = pptInit->x; - box.y2 = box.y1 = pptInit->y; - - if(npt > 1) { - if(pGC->joinStyle == JoinMiter) - extra = 6 * pGC->lineWidth; - else if(pGC->capStyle == CapProjecting) - extra = pGC->lineWidth; - } - - if(mode == CoordModePrevious) { - int x = box.x1; - int y = box.y1; - while(--npt) { - pptInit++; - x += pptInit->x; - y += pptInit->y; - if(box.x1 > x) box.x1 = x; - else if(box.x2 < x) box.x2 = x; - if(box.y1 > y) box.y1 = y; - else if(box.y2 < y) box.y2 = y; - } - } else { - while(--npt) { - pptInit++; - if(box.x1 > pptInit->x) box.x1 = pptInit->x; - else if(box.x2 < pptInit->x) box.x2 = pptInit->x; - if(box.y1 > pptInit->y) box.y1 = pptInit->y; - else if(box.y2 < pptInit->y) box.y2 = pptInit->y; - } - } - - box.x2++; - box.y2++; - - if(extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRANSLATE_AND_ADD_BOX(box, pGC); - } -} - -static void -xxPolySegment( - DrawablePtr pDraw, - GCPtr pGC, - int nseg, - xSegment *pSeg - ){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nseg) { - BoxRec box; - int extra = pGC->lineWidth; - - DBG("PolySegment\n"); - if(pGC->capStyle != CapProjecting) - extra >>= 1; - - if(pSeg->x2 > pSeg->x1) { - box.x1 = pSeg->x1; - box.x2 = pSeg->x2; - } else { - box.x2 = pSeg->x1; - box.x1 = pSeg->x2; - } - - if(pSeg->y2 > pSeg->y1) { - box.y1 = pSeg->y1; - box.y2 = pSeg->y2; - } else { - box.y2 = pSeg->y1; - box.y1 = pSeg->y2; - } - - while(--nseg) { - pSeg++; - if(pSeg->x2 > pSeg->x1) { - if(pSeg->x1 < box.x1) box.x1 = pSeg->x1; - if(pSeg->x2 > box.x2) box.x2 = pSeg->x2; - } else { - if(pSeg->x2 < box.x1) box.x1 = pSeg->x2; - if(pSeg->x1 > box.x2) box.x2 = pSeg->x1; - } - if(pSeg->y2 > pSeg->y1) { - if(pSeg->y1 < box.y1) box.y1 = pSeg->y1; - if(pSeg->y2 > box.y2) box.y2 = pSeg->y2; - } else { - if(pSeg->y2 < box.y1) box.y1 = pSeg->y2; - if(pSeg->y1 > box.y2) box.y2 = pSeg->y1; - } - } - - box.x2++; - box.y2++; - - if(extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRANSLATE_AND_ADD_BOX(box, pGC); - } -} - -static void -xxPolyRectangle( - DrawablePtr pDraw, - GCPtr pGC, - int nRects, - xRectangle *pRects -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyRectangle)(pDraw, pGC, nRects, pRects); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nRects) - { - BoxRec box; - int offset1, offset2, offset3; - - DBG("PolyRectangle\n"); - offset2 = pGC->lineWidth; - if(!offset2) offset2 = 1; - offset1 = offset2 >> 1; - offset3 = offset2 - offset1; - - while(nRects--) - { - box.x1 = pRects->x - offset1; - box.y1 = pRects->y - offset1; - box.x2 = box.x1 + pRects->width + offset2; - box.y2 = box.y1 + offset2; - TRANSLATE_AND_ADD_BOX(box, pGC); - box.x1 = pRects->x - offset1; - box.y1 = pRects->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRects->height - offset2; - TRANSLATE_AND_ADD_BOX(box, pGC); - box.x1 = pRects->x + pRects->width - offset1; - box.y1 = pRects->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRects->height - offset2; - TRANSLATE_AND_ADD_BOX(box, pGC); - box.x1 = pRects->x - offset1; - box.y1 = pRects->y + pRects->height - offset1; - box.x2 = box.x1 + pRects->width + offset2; - box.y2 = box.y1 + offset2; - TRANSLATE_AND_ADD_BOX(box, pGC); - - pRects++; - } - } -} - -static void -xxPolyArc( - DrawablePtr pDraw, - GCPtr pGC, - int narcs, - xArc *parcs -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && narcs) { - int extra = pGC->lineWidth >> 1; - BoxRec box; - - DBG("PolyArc\n"); - box.x1 = parcs->x; - box.x2 = box.x1 + parcs->width; - box.y1 = parcs->y; - box.y2 = box.y1 + parcs->height; - - /* should I break these up instead ? */ - - while(--narcs) { - parcs++; - if(box.x1 > parcs->x) box.x1 = parcs->x; - if(box.x2 < (parcs->x + parcs->width)) - box.x2 = parcs->x + parcs->width; - if(box.y1 > parcs->y) box.y1 = parcs->y; - if(box.y2 < (parcs->y + parcs->height)) - box.y2 = parcs->y + parcs->height; - } - - if(extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - box.x2++; - box.y2++; - - TRANSLATE_AND_ADD_BOX(box, pGC); - } -} - -static void -xxFillPolygon( - DrawablePtr pDraw, - GCPtr pGC, - int shape, - int mode, - int count, - DDXPointPtr pptInit -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && (count > 2)) { - DDXPointPtr ppt = pptInit; - int i = count; - BoxRec box; - - DBG("FillPolygon\n"); - box.x2 = box.x1 = ppt->x; - box.y2 = box.y1 = ppt->y; - - if(mode != CoordModeOrigin) { - int x = box.x1; - int y = box.y1; - while(--i) { - ppt++; - x += ppt->x; - y += ppt->y; - if(box.x1 > x) box.x1 = x; - else if(box.x2 < x) box.x2 = x; - if(box.y1 > y) box.y1 = y; - else if(box.y2 < y) box.y2 = y; - } - } else { - while(--i) { - ppt++; - if(box.x1 > ppt->x) box.x1 = ppt->x; - else if(box.x2 < ppt->x) box.x2 = ppt->x; - if(box.y1 > ppt->y) box.y1 = ppt->y; - else if(box.y2 < ppt->y) box.y2 = ppt->y; - } - } - - box.x2++; - box.y2++; - - (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit); - - TRANSLATE_AND_ADD_BOX(box, pGC); - } else - (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit); - - XX_GC_OP_EPILOGUE(pGC, pDraw); -} - -static void -xxPolyFillRect( - DrawablePtr pDraw, - GCPtr pGC, - int nRectsInit, - xRectangle *pRectsInit -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nRectsInit) { - BoxRec box; - xRectangle *pRects = pRectsInit; - int nRects = nRectsInit; - - DBG("PolyFillRect\n"); - box.x1 = pRects->x; - box.x2 = box.x1 + pRects->width; - box.y1 = pRects->y; - box.y2 = box.y1 + pRects->height; - - while(--nRects) { - pRects++; - if(box.x1 > pRects->x) box.x1 = pRects->x; - if(box.x2 < (pRects->x + pRects->width)) - box.x2 = pRects->x + pRects->width; - if(box.y1 > pRects->y) box.y1 = pRects->y; - if(box.y2 < (pRects->y + pRects->height)) - box.y2 = pRects->y + pRects->height; - } - - /* cfb messes with the pRectsInit so we have to do our - calculations first */ - - (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit); - - TRANSLATE_AND_ADD_BOX(box, pGC); - } else - (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit); - - XX_GC_OP_EPILOGUE(pGC, pDraw); -} - -static void -xxPolyFillArc( - DrawablePtr pDraw, - GCPtr pGC, - int narcs, - xArc *parcs -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && narcs) { - BoxRec box; - - DBG("PolyFillArc\n"); - box.x1 = parcs->x; - box.x2 = box.x1 + parcs->width; - box.y1 = parcs->y; - box.y2 = box.y1 + parcs->height; - - /* should I break these up instead ? */ - - while(--narcs) { - parcs++; - if(box.x1 > parcs->x) box.x1 = parcs->x; - if(box.x2 < (parcs->x + parcs->width)) - box.x2 = parcs->x + parcs->width; - if(box.y1 > parcs->y) box.y1 = parcs->y; - if(box.y2 < (parcs->y + parcs->height)) - box.y2 = parcs->y + parcs->height; - } - - TRANSLATE_AND_ADD_BOX(box, pGC); - } -} - -static int -xxPolyText8( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - char *chars -){ - int width; - - XX_GC_OP_PROLOGUE(pGC, pDraw); - width = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - width -= x; - - if(IS_VISIBLE(pDraw) && (width > 0)) { - BoxRec box; - - DBG("PolyText8\n"); - /* ugh */ - box.x1 = pDraw->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = pDraw->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing); - - if(count > 1) { - if(width > 0) box.x2 += width; - else box.x1 += width; - } - - box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent); - - ADD_BOX(box, pGC); - } - - return (width + x); -} - -static int -xxPolyText16( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars -){ - int width; - - XX_GC_OP_PROLOGUE(pGC, pDraw); - width = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - width -= x; - - if(IS_VISIBLE(pDraw) && (width > 0)) { - BoxRec box; - - DBG("PolyText16\n"); - /* ugh */ - box.x1 = pDraw->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = pDraw->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing); - - if(count > 1) { - if(width > 0) box.x2 += width; - else box.x1 += width; - } - - box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent); - - ADD_BOX(box, pGC); - } - - return (width + x); -} - -static void -xxImageText8( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - char *chars -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && count) { - int top, bot, Min, Max; - BoxRec box; - - DBG("ImageText8\n"); - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - Min = count * FONTMINBOUNDS(pGC->font, characterWidth); - if(Min > 0) Min = 0; - Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); - if(Max < 0) Max = 0; - - /* ugh */ - box.x1 = pDraw->x + x + Min + - FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = pDraw->x + x + Max + - FONTMAXBOUNDS(pGC->font, rightSideBearing); - - box.y1 = pDraw->y + y - top; - box.y2 = pDraw->y + y + bot; - - ADD_BOX(box, pGC); - } -} - -static void -xxImageText16( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && count) { - int top, bot, Min, Max; - BoxRec box; - - DBG("ImageText16\n"); - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - Min = count * FONTMINBOUNDS(pGC->font, characterWidth); - if(Min > 0) Min = 0; - Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); - if(Max < 0) Max = 0; - - /* ugh */ - box.x1 = pDraw->x + x + Min + - FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = pDraw->x + x + Max + - FONTMAXBOUNDS(pGC->font, rightSideBearing); - - box.y1 = pDraw->y + y - top; - box.y2 = pDraw->y + y + bot; - - ADD_BOX(box, pGC); - } -} - -static void -xxImageGlyphBlt( - DrawablePtr pDraw, - GCPtr pGC, - int x, int y, - unsigned int nglyph, - CharInfoPtr *ppci, - void * pglyphBase -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, nglyph, - ppci, pglyphBase); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nglyph) { - int top, bot, width = 0; - BoxRec box; - - DBG("ImageGlyphBlt\n"); - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - box.x1 = ppci[0]->metrics.leftSideBearing; - if(box.x1 > 0) box.x1 = 0; - box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing - - ppci[nglyph - 1]->metrics.characterWidth; - if(box.x2 < 0) box.x2 = 0; - - box.x2 += pDraw->x + x; - box.x1 += pDraw->x + x; - - while(nglyph--) { - width += (*ppci)->metrics.characterWidth; - ppci++; - } - - if(width > 0) - box.x2 += width; - else - box.x1 += width; - - box.y1 = pDraw->y + y - top; - box.y2 = pDraw->y + y + bot; - - ADD_BOX(box, pGC); - } -} - -static void -xxPolyGlyphBlt( - DrawablePtr pDraw, - GCPtr pGC, - int x, int y, - unsigned int nglyph, - CharInfoPtr *ppci, - void * pglyphBase -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, x, y, nglyph, - ppci, pglyphBase); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw) && nglyph) { - BoxRec box; - - DBG("PolyGlyphBlt\n"); - /* ugh */ - box.x1 = pDraw->x + x + ppci[0]->metrics.leftSideBearing; - box.x2 = pDraw->x + x + ppci[nglyph - 1]->metrics.rightSideBearing; - - if(nglyph > 1) { - int width = 0; - - while(--nglyph) { - width += (*ppci)->metrics.characterWidth; - ppci++; - } - - if(width > 0) box.x2 += width; - else box.x1 += width; - } - - box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent); - - ADD_BOX(box, pGC); - } -} - -static void -xxPushPixels( - GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, - int dx, int dy, int xOrg, int yOrg -){ - XX_GC_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); - XX_GC_OP_EPILOGUE(pGC, pDraw); - - if(IS_VISIBLE(pDraw)) { - BoxRec box; - - DBG("PushPixels\n"); - box.x1 = xOrg + pDraw->x; - box.x2 = box.x1 + dx; - box.y1 = yOrg + pDraw->y; - box.y2 = box.y1 + dy; - - ADD_BOX(box, pGC); - } -} - - -#ifdef RENDER -#define RENDER_MAKE_BOX(pDrawable,X,Y,W,H) { \ - box.x1 = X + pDrawable->x; \ - box.x2 = X + pDrawable->x + W; \ - box.y1 = Y + pDrawable->y; \ - box.y2 = Y + pDrawable->y + H; \ -} - -#define RENDER_ADD_BOX(pScreen,box) {\ - if (BOX_NOT_EMPTY(box)) { \ - RegionRec region; \ - xxScrPriv(pScreen);\ - ScreenPtr pScreen = pScreen;\ - RegionInit(®ion, &box, 1); \ - PRINT_RECTS(pScrPriv->region);\ - RegionUnion(&pScrPriv->region,&pScrPriv->region,®ion);\ - PRINT_RECTS(pScrPriv->region);\ - RegionUninit(®ion);\ - }\ -} - -static void -xxComposite (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - xxScrPriv(pScreen); - BoxRec box; - - unwrap (pScrPriv, ps, Composite); - (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, - xDst, yDst, width, height); - wrap (pScrPriv, ps, Composite, xxComposite); - if (pDst->pDrawable->type == DRAWABLE_WINDOW) { - RENDER_MAKE_BOX(pDst->pDrawable, xDst, yDst, width, height); - RENDER_ADD_BOX(pScreen,box); - } -} - - -static void -xxGlyphs (CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, - GlyphListPtr list, GlyphPtr *glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - xxScrPriv(pScreen); - int x, y; - int n; - GlyphPtr glyph; - BoxRec box; - - unwrap (pScrPriv, ps, Glyphs); - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, - nlist, list, glyphs); - wrap (pScrPriv, ps, Glyphs, xxGlyphs); - if (pDst->pDrawable->type == DRAWABLE_WINDOW) - { - x = xSrc; - y = ySrc; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - while (n--) - { - glyph = *glyphs++; - RENDER_MAKE_BOX(pDst->pDrawable, - x - glyph->info.x, y - glyph->info.y, - glyph->info.width, glyph->info.height); - RENDER_ADD_BOX(pScreen,box); - x += glyph->info.xOff; - y += glyph->info.yOff; - } - list++; - } - } -} -#endif - -void -xxPrintVisuals(void) -{ - int k,i,j; - DepthPtr pDepth; - VisualPtr pVisual; - - for (k = 0; k < screenInfo.numScreens; k++) { - ScreenPtr pScreen = screenInfo.screens[k]; - - pDepth = pScreen->allowedDepths; - for (i = 0; i < pScreen->numDepths; i++, pDepth++) - for (j = 0; j < pDepth->numVids; j++) { - ErrorF("depth: %i vid: 0x%lx\n", - pDepth->depth, pDepth->vids[j]); - } - - pVisual = pScreen->visuals; - for (i = 0; i < pScreen->numVisuals; i++, pVisual++) - ErrorF("vid: 0x%x rm: 0x%lx gm: 0x%lx bm: 0x%lx\n", - (unsigned int)pVisual->vid, - pVisual->redMask, - pVisual->greenMask, - pVisual->blueMask); - } -} - - diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.h b/nx-X11/programs/Xserver/fb/fbpseudocolor.h deleted file mode 100644 index 64de71db8..000000000 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _FB_XX_H_ -# define _FB_XX_H_ - -typedef void (*xxSyncFunc)(ScreenPtr); -extern Bool xxSetup(ScreenPtr pScreen, int myDepth, - int baseDepth, char *addr, xxSyncFunc sync); -extern void xxPrintVisuals(void); - - -#endif /* _FB_XX_H_ */ - - - - - - - - - - -- cgit v1.2.3 From e02bdf929248d24445733837121a0a0bf6eeb691 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 12:50:14 +0200 Subject: hw/nxagent/Args.c: Fix fprintf placeholder (%u -> %lu). --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 895de1ef8..0d6e4f87e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1380,7 +1380,7 @@ static void nxagentParseOptions(char *name, char *value) sleep_parse = UINT_MAX; fprintf(stderr, "nxagentParseOptions: Warning: value [%s] of option [%s] " - "out of range, clamped to [%u].\n", + "out of range, clamped to [%lu].\n", validateString(value), validateString(name), sleep_parse); } @@ -1389,7 +1389,7 @@ static void nxagentParseOptions(char *name, char *value) sleep_parse = 0; fprintf(stderr, "nxagentParseOptions: Warning: value [%s] of option [%s] " - "out of range, clamped to [%u].\n", + "out of range, clamped to [%lu].\n", validateString(value), validateString(name), sleep_parse); } -- cgit v1.2.3 From 35dbbd7e448f327d0496b76a8170df025b0fcea0 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 12:53:21 +0200 Subject: hw/nxagent/Exrensions.c: Post-RandR 1.5 update fix. Properly set rrProvider hook functions to NULL. --- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 494027927..4af925681 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -142,9 +142,9 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) /* only fake provider support in nx-X11, so far */ pRandRScrPriv -> provider = RRProviderCreate(pScreen, "default", 7); pRandRScrPriv -> rrProviderSetOutputSource = NULL; - pRandRScrPriv -> rrProviderSetOffloadSink; - pRandRScrPriv -> rrProviderGetProperty; - pRandRScrPriv -> rrProviderSetProperty; + pRandRScrPriv -> rrProviderSetOffloadSink = NULL; + pRandRScrPriv -> rrProviderGetProperty = NULL; + pRandRScrPriv -> rrProviderSetProperty = NULL; #endif #if RANDR_13_INTERFACE -- cgit v1.2.3 From 5e2e760d3a7b6a671f21169bf5220f482eb2c17d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:10:08 +0200 Subject: Avoid 'siAddr' maybe being used uninitialized in XAddHost and XRemoveHost. Backported from X.org (libX11). Host.c has mainly been copied over from libX11, contaning 7db7451 as the top commit (which also contains the greatest change and silences the resp. compiler warning. commit 7db74514e454d3fc4ff70aa08ddac66bfffda4dd Author: Alan Coopersmith Date: Tue Jul 23 22:18:46 2013 -0700 Refactor common code from XAddHost & XRemoveHost into single function On the Xlib side, the only real difference is the mode flag we send to the server with the address, so just make that an argument to the function with the common code for packing the address into the request. (Aside from labels, gcc 4.7.2 generates identical code before & after this change due to inlining, verified via diff of gcc -S output.) Signed-off-by: Alan Coopersmith --- nx-X11/lib/X11/Host.c | 73 ++++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 47 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/Host.c b/nx-X11/lib/X11/Host.c index 58e9e4a1c..5fcb687cc 100644 --- a/nx-X11/lib/X11/Host.c +++ b/nx-X11/lib/X11/Host.c @@ -44,31 +44,31 @@ X Window System is a trademark of The Open Group. #endif #include "Xlibint.h" -int -XAddHost ( - register Display *dpy, - XHostAddress *host) +static inline int +changehost (Display *dpy, XHostAddress *host, BYTE mode) { - register xChangeHostsReq *req; - register int length; + xChangeHostsReq *req; + int length; XServerInterpretedAddress *siAddr; int addrlen; - - if (host->family == FamilyServerInterpreted) { - siAddr = (XServerInterpretedAddress *) host->address; - addrlen = siAddr->typelength + siAddr->valuelength + 1; - } else { - addrlen = host->length; - } - length = (addrlen + 3) & ~0x3; /* round up */ - + siAddr = host->family == FamilyServerInterpreted ? + (XServerInterpretedAddress *)host->address : NULL; + addrlen = siAddr ? + siAddr->typelength + siAddr->valuelength + 1 : host->length; + + length = (addrlen + 3) & ~0x3; /* round up */ + LockDisplay(dpy); GetReqExtra (ChangeHosts, length, req); - req->mode = HostInsert; + if (!req) { + UnlockDisplay(dpy); + return 0; + } + req->mode = mode; req->hostFamily = host->family; req->hostLength = addrlen; - if (host->family == FamilyServerInterpreted) { + if (siAddr) { char *dest = (char *) NEXTPTR(req,xChangeHostsReq); memcpy(dest, siAddr->type, siAddr->typelength); dest[siAddr->typelength] = '\0'; @@ -82,40 +82,19 @@ XAddHost ( } int -XRemoveHost ( +XAddHost ( register Display *dpy, XHostAddress *host) { - register xChangeHostsReq *req; - register int length; - XServerInterpretedAddress *siAddr; - int addrlen; - - if (host->family == FamilyServerInterpreted) { - siAddr = (XServerInterpretedAddress *) host->address; - addrlen = siAddr->typelength + siAddr->valuelength + 1; - } else { - addrlen = host->length; - } - - length = (addrlen + 3) & ~0x3; /* round up */ + return changehost(dpy, host, HostInsert); +} - LockDisplay(dpy); - GetReqExtra (ChangeHosts, length, req); - req->mode = HostDelete; - req->hostFamily = host->family; - req->hostLength = addrlen; - if (host->family == FamilyServerInterpreted) { - char *dest = (char *) NEXTPTR(req,xChangeHostsReq); - memcpy(dest, siAddr->type, siAddr->typelength); - dest[siAddr->typelength] = '\0'; - memcpy(dest + siAddr->typelength + 1,siAddr->value,siAddr->valuelength); - } else { - memcpy((char *) NEXTPTR(req,xChangeHostsReq), host->address, addrlen); - } - UnlockDisplay(dpy); - SyncHandle(); - return 1; +int +XRemoveHost ( + register Display *dpy, + XHostAddress *host) +{ + return changehost(dpy, host, HostDelete); } int -- cgit v1.2.3 From ed61433e1fda7bf83f912d6d7b750b77f47dce07 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:17:04 +0200 Subject: nx-X11/lib/X11/LiHosts.c: Drop unused variable (in XListHosts). --- nx-X11/lib/X11/LiHosts.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/LiHosts.c b/nx-X11/lib/X11/LiHosts.c index bd0864448..59e2ae318 100644 --- a/nx-X11/lib/X11/LiHosts.c +++ b/nx-X11/lib/X11/LiHosts.c @@ -71,11 +71,7 @@ XHostAddress *XListHosts ( } if (reply.nHosts) { - unsigned int l; nbytes = reply.length << 2; /* compute number of bytes in reply */ - l = (unsigned) (nbytes + - (reply.nHosts * sizeof(XHostAddress)) + - (reply.nHosts * sizeof(XServerInterpretedAddress))); op = outbuf = (XHostAddress *) Xmalloc((unsigned) (nbytes + (reply.nHosts * sizeof(XHostAddress)) + -- cgit v1.2.3 From 365fa4f3e7f7af34f919290ae3a19f6806d09ffb Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:20:30 +0200 Subject: nx-X11/lib/X11/XKBMisc.c: Drop conditional always evaluating as True. Backported from X.org, patch found in janitor cleanup commit... commit 8ba0ca32a63c532f128bdca7f1bf982cab8e12be Author: Paulo Cesar Pereira de Andrade Date: Wed Jan 28 20:31:42 2009 -0200 --- nx-X11/lib/X11/XKBMisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/XKBMisc.c b/nx-X11/lib/X11/XKBMisc.c index 04ac0c7ea..d1f75a93a 100644 --- a/nx-X11/lib/X11/XKBMisc.c +++ b/nx-X11/lib/X11/XKBMisc.c @@ -666,7 +666,7 @@ register int i; int width,nOldGroups,oldWidth,newTypes[XkbNumKbdGroups]; if ((!xkb) || (!XkbKeycodeInRange(xkb,key)) || (!xkb->map) || - (!xkb->map->types)||(!newTypes)||((groups&XkbAllGroupsMask)==0)|| + (!xkb->map->types)||((groups&XkbAllGroupsMask)==0)|| (nGroups>XkbNumKbdGroups)) { return BadMatch; } -- cgit v1.2.3 From 3569ac1712169d34c4b29ca301458ec0c325eed1 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:24:38 +0200 Subject: nx-X11/lib/X11/lcFile.c: Drop conditional always evaluating as True. Backported from X.org, patch found in janitor cleanup commit... commit 8ba0ca32a63c532f128bdca7f1bf982cab8e12be Author: Paulo Cesar Pereira de Andrade Date: Wed Jan 28 20:31:42 2009 -0200 --- nx-X11/lib/X11/lcFile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/lcFile.c b/nx-X11/lib/X11/lcFile.c index 2e0a49db4..e1812ad91 100644 --- a/nx-X11/lib/X11/lcFile.c +++ b/nx-X11/lib/X11/lcFile.c @@ -437,8 +437,7 @@ _XlcFileName( char buf[PATH_MAX], *name; name = NULL; - if ((5 + (args[i] ? strlen (args[i]) : 0) + - (cat ? strlen (cat) : 0)) < PATH_MAX) { + if ((5 + (args[i] ? strlen (args[i]) : 0) + strlen(cat)) < PATH_MAX) { sprintf(buf, "%s/%s.dir", args[i], cat); name = resolve_name(siname, buf, RtoL); } -- cgit v1.2.3 From eddd4876bb40cf0cd7826f34eff2128e86fed42a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:28:23 +0200 Subject: nx-X11/lib/X11/imInsClbk.c: Fix warning 'right-hand operand of comma expression has no effect' in _XimFilterPropertyNotify. --- nx-X11/lib/X11/imInsClbk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/imInsClbk.c b/nx-X11/lib/X11/imInsClbk.c index acf9f7b63..744ee824c 100644 --- a/nx-X11/lib/X11/imInsClbk.c +++ b/nx-X11/lib/X11/imInsClbk.c @@ -111,7 +111,7 @@ _XimFilterPropertyNotify( } lock = True; - for( ii = 0; ii < nitems; ii++, atoms ) { + for( ii = 0; ii < nitems; ii++ ) { if(XGetSelectionOwner (display, atoms[ii])) { for( icb = callback_list; icb; icb = icb->next ) { if( !icb->call && !icb->destroy ) { -- cgit v1.2.3 From b34b47ed5463af3659dae21f3a2c2d68264fab3b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:30:08 +0200 Subject: =?UTF-8?q?nx-X11/lib/X11/imTrX.c:=20Fix=20warning=20=E2=80=98len?= =?UTF-8?q?=E2=80=99=20may=20be=20used=20uninitialized=20in=20this=20funct?= =?UTF-8?q?ion=20(=5FXimRead).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nx-X11/lib/X11/imTrX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/imTrX.c b/nx-X11/lib/X11/imTrX.c index 7d00bb3f7..4aa587662 100644 --- a/nx-X11/lib/X11/imTrX.c +++ b/nx-X11/lib/X11/imTrX.c @@ -436,7 +436,7 @@ _XimXRead(Xim im, XPointer recv_buf, int buf_len, int *ret_len) { XEvent *ev; XEvent event; - int len; + int len = 0; XSpecRec *spec = (XSpecRec *)im->private.proto.spec; XPointer arg = spec->ev; -- cgit v1.2.3 From 00ebfaf535801a8600ac48319b43b9c28e5f6749 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:33:51 +0200 Subject: Xserver/os/connection.c: Only define XSERV_t, TRANS_SERVER and TRANS_REOPEN if not yet defined. --- nx-X11/programs/Xserver/os/connection.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index fd9741389..c1749d26a 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -72,9 +72,15 @@ SOFTWARE. #endif #include #include -#define XSERV_t -#define TRANS_SERVER -#define TRANS_REOPEN +#ifndef XSERV_t +# define XSERV_t +#endif +#ifndef TRANS_SERVER +# define TRANS_SERVER +#endif +#ifndef TRANS_REOPEN +# define TRANS_REOPEN +#endif #include #include #include -- cgit v1.2.3 From bad0e8bdd32bf8bc741ad64a37a9318655f26068 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 13:35:06 +0200 Subject: Xserver/os/connection.c: Drop unused variable 'restore_trans_conn' from ClientAuthorized(). --- nx-X11/programs/Xserver/os/connection.c | 1 - 1 file changed, 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index c1749d26a..78ed47f1d 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -688,7 +688,6 @@ ClientAuthorized(ClientPtr client, XID auth_id; char *reason = NULL; XtransConnInfo trans_conn; - int restore_trans_conn = 0; priv = (OsCommPtr)client->osPrivate; trans_conn = priv->trans_conn; -- cgit v1.2.3 From b5cceb740b60b62ab7d79c0ad4c00810b983efc5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 29 Jun 2016 13:45:20 +0200 Subject: os: Make sure that writing our pid to the lock file actually worked There's no sense verifying that we can create the lock file and then ignoring the return value from write. Signed-off-by: Keith Packard Reviewed-by: Jamey Sharp Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/os/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index f5f09c320..43d92ed98 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -411,7 +411,9 @@ LockServer(void) if (lfd < 0) FatalError("Could not create lock file in %s\n", tmp); (void) sprintf(pid_str, "%10ld\n", (long)getpid()); - (void) write(lfd, pid_str, 11); + if (write(lfd, pid_str, 11) != 11) + FatalError("Could not write pid to lock file in %s\n", tmp); + #ifndef __UNIXOS2__ #ifndef USE_CHMOD (void) fchmod(lfd, 0444); -- cgit v1.2.3 From f46af7de8496522e0d90448497fd019afafc8747 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 29 Jun 2016 13:57:05 +0200 Subject: Restore compression of duplicate log file entries. This undoes the workaround for X.org bug #964, which was an Xprintism. --- nx-X11/programs/Xserver/os/log.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index d97317819..780a05767 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -561,15 +561,6 @@ VAuditF(const char *f, va_list args) prefix = AuditPrefix(); len = vsnprintf(buf, sizeof(buf), f, args); -#if 1 - /* XXX Compressing duplicated messages is temporarily disabled to - * work around bugzilla 964: - * https://freedesktop.org/bugzilla/show_bug.cgi?id=964 - */ - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - oldlen = -1; - nrepeat = 0; -#else if (len == oldlen && strcmp(buf, oldbuf) == 0) { /* Message already seen */ nrepeat++; @@ -583,7 +574,6 @@ VAuditF(const char *f, va_list args) nrepeat = 0; auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); } -#endif if (prefix != NULL) free(prefix); } -- cgit v1.2.3 From 141316af0d45968b95c3fb5c08516dd6e93ac64e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 14:05:12 +0200 Subject: Xserver/os/log.c: Make sure strlcpy is defined in log.c. Immitate what is done in X.org. --- nx-X11/programs/Xserver/include/os.h | 7 +++++++ nx-X11/programs/Xserver/os/log.c | 1 + 2 files changed, 8 insertions(+) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index aaff63811..6e629c42f 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -457,6 +457,13 @@ extern void AbortDDX(void); extern void ddxGiveUp(void); extern int TimeSinceLastInputEvent(void); +#ifndef HAVE_STRLCPY +extern _X_EXPORT size_t +strlcpy(char *dst, const char *src, size_t siz); +extern _X_EXPORT size_t +strlcat(char *dst, const char *src, size_t siz); +#endif + /* Logging. */ typedef enum _LogParameter { XLOG_FLUSH, diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index 780a05767..d8640b5fd 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -107,6 +107,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include /* for malloc() */ #include +#include "input.h" #include "site.h" #include "opaque.h" -- cgit v1.2.3 From a8fd16ce61113f54391a2a58c9ad00466b67af98 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 14:09:52 +0200 Subject: Xserver/os/xdmauth.c: Avoid compiler warnings due to -Wswitch being enabled. Use if statement rather than switch. Backported from X.org. Found in commit... commit 7deaaa797cf8e7ca71e9b34fa6f413d1ed2b3dab Author: Adam Jackson Date: Tue Mar 28 01:21:00 2006 +0000 --- nx-X11/programs/Xserver/os/xdmauth.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c index a89c5b0c0..c2796fba1 100644 --- a/nx-X11/programs/Xserver/os/xdmauth.c +++ b/nx-X11/programs/Xserver/os/xdmauth.c @@ -70,9 +70,7 @@ XdmAuthenticationValidator (ARRAY8Ptr privateData, ARRAY8Ptr incomingData, XdmcpUnwrap (incomingData->data, &privateKey, incomingData->data,incomingData->length); - switch (packet_type) - { - case ACCEPT: + if (packet_type == ACCEPT) { if (incomingData->length != 8) return FALSE; incoming = (XdmAuthKeyPtr) incomingData->data; @@ -88,9 +86,7 @@ XdmAuthenticationGenerator (ARRAY8Ptr privateData, ARRAY8Ptr outgoingData, { outgoingData->length = 0; outgoingData->data = 0; - switch (packet_type) - { - case REQUEST: + if (packet_type == REQUEST) { if (XdmcpAllocARRAY8 (outgoingData, 8)) XdmcpWrap (&rho, &privateKey, outgoingData->data, 8); } -- cgit v1.2.3 From c08d0308d7e2c48012b0b8bd3651a4371826d483 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 14:14:15 +0200 Subject: Xserver/mi/miarc.c: Initialize dashRemaining with 0 before using it. --- nx-X11/programs/Xserver/mi/miarc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index 9c3bcb7ad..fadb42bc5 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -1920,7 +1920,7 @@ miComputeArcs ( int arcsJoin; int selfJoin; - int iDash = 0, dashRemaining; + int iDash = 0, dashRemaining = 0; int iDashStart = 0, dashRemainingStart = 0, iphaseStart; int startAngle, spanAngle, endAngle, backwards = 0; int prevDashAngle, dashAngle; -- cgit v1.2.3 From 8df1a67b66147848673537625ec81b80be928686 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 14:17:53 +0200 Subject: Xserver/mi/mizerarc.c: Initialize oddPtrs as NULL before using it (in miZeroPolyArc). --- nx-X11/programs/Xserver/mi/mizerarc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/mi/mizerarc.c b/nx-X11/programs/Xserver/mi/mizerarc.c index 4b4d724a6..f337d605e 100644 --- a/nx-X11/programs/Xserver/mi/mizerarc.c +++ b/nx-X11/programs/Xserver/mi/mizerarc.c @@ -720,7 +720,7 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) register int n, maxw = 0; register xArc *arc; register int i; - DDXPointPtr points, pts, oddPts; + DDXPointPtr points, pts, oddPts = NULL; register DDXPointPtr pt; int numPts; Bool dospans; -- cgit v1.2.3 From 89499350173da693a0dfa60101b313a73da60fda Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 14:28:49 +0200 Subject: Xserver: Post-REGION-macros-to-inline-funcs clean-up. --- nx-X11/programs/Xserver/Xext/panoramiX.c | 1 - nx-X11/programs/Xserver/Xext/shape.c | 2 -- nx-X11/programs/Xserver/mi/mibstore.c | 5 ----- nx-X11/programs/Xserver/mi/mioverlay.c | 1 - nx-X11/programs/Xserver/mi/miwindow.c | 13 ------------- nx-X11/programs/Xserver/render/mipict.c | 1 - 6 files changed, 23 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 322204763..34d56c3bf 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -1160,7 +1160,6 @@ XineramaGetImageData( BoxRec SrcBox, *pbox; int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth; DrawablePtr pDraw = pDrawables[0]; - ScreenPtr pScreen = pDraw->pScreen; char *ScratchMem = NULL; size = 0; diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 07fa62018..e48fab0f2 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -317,7 +317,6 @@ ProcShapeRectangles (client) register ClientPtr client; { WindowPtr pWin; - ScreenPtr pScreen; REQUEST(xShapeRectanglesReq); xRectangle *prects; int nrects, ctype; @@ -350,7 +349,6 @@ ProcShapeRectangles (client) client->errorValue = stuff->ordering; return BadValue; } - pScreen = pWin->drawable.pScreen; nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq)); if (nrects & 4) return BadLength; diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 5001eae6f..13415177c 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -2573,11 +2573,9 @@ miBSAllocate(pWin) WindowPtr pWin; { register miBSWindowPtr pBackingStore; - register ScreenPtr pScreen; if (pWin->drawable.pScreen->backingStoreSupport == NotUseful) return; - pScreen = pWin->drawable.pScreen; if (!(pBackingStore = (miBSWindowPtr)pWin->backStorage)) { @@ -2674,9 +2672,6 @@ miBSFree(pWin) WindowPtr pWin; { miBSWindowPtr pBackingStore; - register ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; pBackingStore = (miBSWindowPtr)pWin->backStorage; if (pBackingStore) diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index 3a85863ed..1250c2b74 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -2029,7 +2029,6 @@ HasUnderlayChildren(WindowPtr pWin) static Bool CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) { - ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pChild; miOverlayTreePtr pTree; Bool hasUnderlay; diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index 9e87e7095..e9e5a39ef 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -275,14 +275,12 @@ miChangeSaveUnder(pWin, first) * Used when pWin was restacked */ { RegionRec rgn; /* Area obscured by saveUnder windows */ - register ScreenPtr pScreen; Bool res; if (!deltaSaveUndersViewable && !numSaveUndersViewable) return FALSE; numSaveUndersViewable += deltaSaveUndersViewable; deltaSaveUndersViewable = 0; - pScreen = pWin->drawable.pScreen; RegionNull(&rgn); res = miCheckSubSaveUnder (pWin->parent, pWin->saveUnder ? first : pWin->nextSib, @@ -368,9 +366,6 @@ miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) register WindowPtr pChild, pLast; Bool anyMarked = FALSE; MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; - ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; /* single layered systems are easy */ if (ppLayerWin) *ppLayerWin = pWin; @@ -453,11 +448,8 @@ miHandleValidateExposures(pWin) { register WindowPtr pChild; register ValidatePtr val; - ScreenPtr pScreen; WindowExposuresProcPtr WindowExposures; - pScreen = pWin->drawable.pScreen; - pChild = pWin; WindowExposures = pChild->drawable.pScreen->WindowExposures; while (1) @@ -581,12 +573,10 @@ miRecomputeExposures ( register WindowPtr pWin, void * value) /* must conform to VisitWindowProcPtr */ { - register ScreenPtr pScreen; RegionPtr pValid = (RegionPtr)value; if (pWin->valdata) { - pScreen = pWin->drawable.pScreen; /* * compute exposed regions of this window */ @@ -1186,11 +1176,8 @@ miMarkUnrealizedWindow(pChild, pWin, fromConfigure) void miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) { - ScreenPtr pScreen; WindowPtr pChild; - pScreen = pWin->drawable.pScreen; - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->drawable.depth == depth) diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index 5bd449d44..d2420ea87 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -129,7 +129,6 @@ miValidatePicture (PicturePtr pPicture, Mask mask) { DrawablePtr pDrawable = pPicture->pDrawable; - ScreenPtr pScreen = pDrawable->pScreen; if ((mask & (CPClipXOrigin|CPClipYOrigin|CPClipMask|CPSubwindowMode)) || (pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS))) -- cgit v1.2.3 From ecaf4df7f2f3bcefd22e62702a40103ad31d02e1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 29 Jun 2016 14:58:47 +0200 Subject: Xserver/Xext/xres.c: Drop unused REQUEST macro call (for xXResQueryVersionReq). Backported from X.org: commit a1cb69dc28fdbfbdfaf954e0bec221f759462399 Author: Keith Packard Date: Fri Nov 15 22:05:44 2013 +0900 Xext: Clean up warnings GC funcs and ops are const. Remove unused variables. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/Xext/xres.c | 1 - 1 file changed, 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index d78fa68e1..bca7b0a18 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -25,7 +25,6 @@ static int ProcXResQueryVersion (ClientPtr client) { - REQUEST(xXResQueryVersionReq); xXResQueryVersionReply rep; REQUEST_SIZE_MATCH (xXResQueryVersionReq); -- cgit v1.2.3 From d60297e41fd4d0c0fcbe67b434f635a0f6487f05 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 29 Jun 2016 15:02:00 +0200 Subject: Remove INITARGS braindamage, change to void; add XkbExtensionInit prototype to xkb.h. Explicitly initialise nTypes in xkb.c. --- nx-X11/programs/Xserver/xkb/xkb.c | 4 ++-- nx-X11/programs/Xserver/xkb/xkb.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 6c6e67f1e..65a4c3747 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -2277,7 +2277,7 @@ ProcXkbSetMap(ClientPtr client) XkbDescPtr xkb; XkbChangesRec change; XkbEventCauseRec cause; - int nTypes,nActions,error; + int nTypes = 0,nActions,error; char * tmp; CARD8 mapWidths[XkbMaxLegalKeyCode+1]; CARD16 symsPerKey[XkbMaxLegalKeyCode+1]; @@ -6200,7 +6200,7 @@ XkbResetProc(ExtensionEntry *extEntry) } void -XkbExtensionInit(INITARGS) +XkbExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/xkb/xkb.h b/nx-X11/programs/Xserver/xkb/xkb.h index 3a8a49541..aa2a97e18 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.h +++ b/nx-X11/programs/Xserver/xkb/xkb.h @@ -32,6 +32,8 @@ extern int ProcXkbSetDebuggingFlags(ClientPtr client); extern int XkbSetRepeatRate(DeviceIntPtr dev, int timeout, int interval, int major, int minor); extern int XkbGetRepeatRate(DeviceIntPtr dev, int *timeout, int *interval); +extern void XkbExtensionInit(void); + extern Status XkbComputeGetIndicatorMapReplySize( XkbIndicatorPtr indicators, xkbGetIndicatorMapReply *rep); -- cgit v1.2.3 From f0af82cbbac03a128a573144da61a693ffa09e28 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 15:07:16 +0200 Subject: nx-X11/lib/X11/XKBMisc.c: Avoid warning about maybe non-assigned variables (mask, newMask). --- nx-X11/lib/X11/XKBMisc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/XKBMisc.c b/nx-X11/lib/X11/XKBMisc.c index d1f75a93a..7f0e59e7a 100644 --- a/nx-X11/lib/X11/XKBMisc.c +++ b/nx-X11/lib/X11/XKBMisc.c @@ -834,7 +834,7 @@ XkbUpdateKeyTypeVirtualMods( XkbDescPtr xkb, XkbChangesPtr changes) { register unsigned int i; -unsigned int mask; +unsigned int mask = 0; XkbVirtualModsToReal(xkb,type->mods.vmods,&mask); type->mods.mask= type->mods.real_mods|mask; @@ -888,7 +888,7 @@ unsigned int checkState = 0; XkbUpdateKeyTypeVirtualMods(xkb,&xkb->map->types[i],changed,changes); } if (changed&xkb->ctrls->internal.vmods) { - unsigned int newMask; + unsigned int newMask = 0; XkbVirtualModsToReal(xkb,xkb->ctrls->internal.vmods,&newMask); newMask|= xkb->ctrls->internal.real_mods; if (xkb->ctrls->internal.mask!=newMask) { @@ -900,7 +900,7 @@ unsigned int checkState = 0; } } if (changed&xkb->ctrls->ignore_lock.vmods) { - unsigned int newMask; + unsigned int newMask = 0; XkbVirtualModsToReal(xkb,xkb->ctrls->ignore_lock.vmods,&newMask); newMask|= xkb->ctrls->ignore_lock.real_mods; if (xkb->ctrls->ignore_lock.mask!=newMask) { @@ -916,7 +916,7 @@ unsigned int checkState = 0; map= &xkb->indicators->maps[0]; for (i=0;imods.vmods&changed) { - unsigned int newMask; + unsigned int newMask = 0; XkbVirtualModsToReal(xkb,map->mods.vmods,&newMask); newMask|= map->mods.real_mods; if (newMask!=map->mods.mask) { @@ -933,7 +933,7 @@ unsigned int checkState = 0; XkbCompatMapPtr compat; compat= xkb->compat; for (i=0;igroups[i].vmods,&newMask); newMask|= compat->groups[i].real_mods; if (compat->groups[i].mask!=newMask) { -- cgit v1.2.3 From b15fc63f4c0c4c741af1255d17907ba3b98b5cf9 Mon Sep 17 00:00:00 2001 From: Tomas Carnecky Date: Tue, 5 Jul 2016 08:16:09 +0200 Subject: Replace INITARGS with void INITARGS was a hardcoded define to void. Since knowing the function signature for your extensions is kinda useful, just replace it with a hardcoded void, but leave the define there for API compatibility. Signed-off-by: Tomas Carnecky Reviewed-by: Daniel Stone Reviewed-by: Cyril Brulebois Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/GL/glxmodule.c | 2 +- nx-X11/programs/Xserver/Xext/bigreq.c | 2 +- nx-X11/programs/Xserver/Xext/dpms.c | 2 +- nx-X11/programs/Xserver/Xext/extmod/modinit.h | 38 ++++++++-------- nx-X11/programs/Xserver/Xext/saver.c | 2 +- nx-X11/programs/Xserver/Xext/security.c | 2 +- nx-X11/programs/Xserver/Xext/shape.c | 2 +- nx-X11/programs/Xserver/Xext/shm.c | 2 +- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/Xext/xcmisc.c | 2 +- nx-X11/programs/Xserver/Xext/xres.c | 2 +- nx-X11/programs/Xserver/Xext/xtest.c | 2 +- nx-X11/programs/Xserver/Xext/xtest1di.c | 2 +- nx-X11/programs/Xserver/dbe/dbemodule.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/mi/miinitext.c | 62 +++++++++++++-------------- nx-X11/programs/Xserver/record/recordmod.c | 2 +- 17 files changed, 63 insertions(+), 67 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/GL/glxmodule.c b/nx-X11/programs/Xserver/GL/glxmodule.c index b97b7ef8a..f0cce1a3f 100644 --- a/nx-X11/programs/Xserver/GL/glxmodule.c +++ b/nx-X11/programs/Xserver/GL/glxmodule.c @@ -43,7 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static MODULESETUPPROTO(glxSetup); -extern void GlxExtensionInit(INITARGS); +extern void GlxExtensionInit(void); extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *)); diff --git a/nx-X11/programs/Xserver/Xext/bigreq.c b/nx-X11/programs/Xserver/Xext/bigreq.c index a43031d7e..ec1ece91a 100644 --- a/nx-X11/programs/Xserver/Xext/bigreq.c +++ b/nx-X11/programs/Xserver/Xext/bigreq.c @@ -54,7 +54,7 @@ static void BigReqResetProc( static DISPATCH_PROC(ProcBigReqDispatch); void -BigReqExtensionInit(INITARGS) +BigReqExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/dpms.c b/nx-X11/programs/Xserver/Xext/dpms.c index f88e1656e..eab73ebed 100644 --- a/nx-X11/programs/Xserver/Xext/dpms.c +++ b/nx-X11/programs/Xserver/Xext/dpms.c @@ -76,7 +76,7 @@ static DISPATCH_PROC(SProcDPMSCapable); static void DPMSResetProc(ExtensionEntry* extEntry); void -DPMSExtensionInit(INITARGS) +DPMSExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.h b/nx-X11/programs/Xserver/Xext/extmod/modinit.h index 094837d34..5242a3f1b 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.h +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.h @@ -5,68 +5,64 @@ #include #endif -#ifndef INITARGS -#define INITARGS void -#endif - #ifdef SHAPE -extern void ShapeExtensionInit(INITARGS); +extern void ShapeExtensionInit(void); #include #endif #ifdef XTEST -extern void XTestExtensionInit(INITARGS); +extern void XTestExtensionInit(void); #define _XTEST_SERVER_ #include #include #endif #if 1 -extern void XTestExtension1Init(INITARGS); +extern void XTestExtension1Init(void); #endif #ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); +extern void BigReqExtensionInit(void); #include #endif #ifdef XSYNC -extern void SyncExtensionInit(INITARGS); +extern void SyncExtensionInit(void); #define _SYNC_SERVER #include #include #endif #ifdef SCREENSAVER -extern void ScreenSaverExtensionInit (INITARGS); +extern void ScreenSaverExtensionInit (void); #include #endif #ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); +extern void XCMiscExtensionInit(void); #include #endif #ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); +extern void DPMSExtensionInit(void); #include #endif #ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); -extern void XvRegister(INITARGS); +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); +extern void XvRegister(void); #include #include #endif #ifdef RES -extern void ResExtensionInit(INITARGS); +extern void ResExtensionInit(void); #include #endif #ifdef SHM -extern void ShmExtensionInit(INITARGS); +extern void ShmExtensionInit(void); #include extern void ShmSetPixmapFormat( ScreenPtr pScreen, @@ -77,15 +73,15 @@ extern void ShmRegisterFuncs( #endif #if 1 -extern void SecurityExtensionInit(INITARGS); +extern void SecurityExtensionInit(void); #endif #if 1 -extern void XagExtensionInit(INITARGS); +extern void XagExtensionInit(void); #endif #if 1 -extern void XpExtensionInit(INITARGS); +extern void XpExtensionInit(void); #endif #if 1 @@ -93,5 +89,5 @@ extern void PanoramiXExtensionInit(int argc, char *argv[]); #endif #if 1 -extern void XkbExtensionInit(INITARGS); +extern void XkbExtensionInit(void); #endif diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 1f78be9c8..10bb2dc2f 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -229,7 +229,7 @@ static int ScreenPrivateIndex; ****************/ void -ScreenSaverExtensionInit(INITARGS) +ScreenSaverExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 14fa1ce0e..fe741128e 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -2147,7 +2147,7 @@ XSecurityOptions(argc, argv, i) */ void -SecurityExtensionInit(INITARGS) +SecurityExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index e48fab0f2..76d1fdd77 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -147,7 +147,7 @@ typedef struct _ShapeEvent { ****************/ void -ShapeExtensionInit(INITARGS) +ShapeExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 902bee7a1..b6e61de36 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -205,7 +205,7 @@ static Bool CheckForShmSyscall() #ifndef NXAGENT_SERVER void -ShmExtensionInit(INITARGS) +ShmExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 8899b7c17..222ef0353 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -2336,7 +2336,7 @@ SyncResetProc(extEntry) * ** Initialise the extension. */ void -SyncExtensionInit(INITARGS) +SyncExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index bca5bca34..447f1699c 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -68,7 +68,7 @@ static DISPATCH_PROC(SProcXCMiscGetXIDList); static DISPATCH_PROC(SProcXCMiscGetXIDRange); void -XCMiscExtensionInit(INITARGS) +XCMiscExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index bca7b0a18..82632a031 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -300,7 +300,7 @@ SProcResDispatch (ClientPtr client) } void -ResExtensionInit(INITARGS) +ResExtensionInit(void) { (void) AddExtension(XRES_NAME, 0, 0, ProcResDispatch, SProcResDispatch, diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index 7dd668fdb..4d82f403d 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -93,7 +93,7 @@ static DISPATCH_PROC(SProcXTestGetVersion); static DISPATCH_PROC(SProcXTestGrabControl); void -XTestExtensionInit(INITARGS) +XTestExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/xtest1di.c b/nx-X11/programs/Xserver/Xext/xtest1di.c index 554f336b2..4aac1824b 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1di.c +++ b/nx-X11/programs/Xserver/Xext/xtest1di.c @@ -167,7 +167,7 @@ static int XTestCurrentClientGone( * (other than the core errors). */ void -XTestExtension1Init(INITARGS) +XTestExtension1Init(void) { /* * holds the pointer to the extension entry structure diff --git a/nx-X11/programs/Xserver/dbe/dbemodule.c b/nx-X11/programs/Xserver/dbe/dbemodule.c index 9a05f4071..bdb7f3345 100644 --- a/nx-X11/programs/Xserver/dbe/dbemodule.c +++ b/nx-X11/programs/Xserver/dbe/dbemodule.c @@ -9,7 +9,7 @@ static MODULESETUPPROTO(dbeSetup); -extern void DbeExtensionInit(INITARGS); +extern void DbeExtensionInit(void); ExtensionModule dbeExt = { DbeExtensionInit, diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 86b9e0d24..28b42d676 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -76,7 +76,7 @@ extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, char *pImage); void -ShmExtensionInit(INITARGS) +ShmExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c index dcd91c5e0..1b947a784 100644 --- a/nx-X11/programs/Xserver/mi/miinitext.c +++ b/nx-X11/programs/Xserver/mi/miinitext.c @@ -151,7 +151,7 @@ extern Bool noXvExtension; #ifndef XFree86LOADER #define INITARGS void -typedef void (*InitExtension)(INITARGS); +typedef void (*InitExtension)(void); #else /* XFree86Loader */ #include "loaderProcs.h" #endif @@ -183,95 +183,95 @@ typedef void (*InitExtension)(INITARGS); /* FIXME: this whole block of externs should be from the appropriate headers */ #ifdef XTESTEXT1 -extern void XTestExtension1Init(INITARGS); +extern void XTestExtension1Init(void); #endif #ifdef SHAPE -extern void ShapeExtensionInit(INITARGS); +extern void ShapeExtensionInit(void); #endif #ifdef MITSHM -extern void ShmExtensionInit(INITARGS); +extern void ShmExtensionInit(void); #endif #ifdef PANORAMIX -extern void PanoramiXExtensionInit(INITARGS); +extern void PanoramiXExtensionInit(void); #endif #ifdef XINPUT -extern void XInputExtensionInit(INITARGS); +extern void XInputExtensionInit(void); #endif #ifdef XTEST -extern void XTestExtensionInit(INITARGS); +extern void XTestExtensionInit(void); #endif #ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); +extern void BigReqExtensionInit(void); #endif #ifdef XIDLE -extern void XIdleExtensionInit(INITARGS); +extern void XIdleExtensionInit(void); #endif #ifdef SCREENSAVER -extern void ScreenSaverExtensionInit (INITARGS); +extern void ScreenSaverExtensionInit (void); #endif #ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); #endif #ifdef XSYNC -extern void SyncExtensionInit(INITARGS); +extern void SyncExtensionInit(void); #endif #ifdef XKB -extern void XkbExtensionInit(INITARGS); +extern void XkbExtensionInit(void); #endif #ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); +extern void XCMiscExtensionInit(void); #endif #ifdef XRECORD -extern void RecordExtensionInit(INITARGS); +extern void RecordExtensionInit(void); #endif #ifdef DBE -extern void DbeExtensionInit(INITARGS); +extern void DbeExtensionInit(void); #endif #ifdef XCSECURITY -extern void SecurityExtensionInit(INITARGS); +extern void SecurityExtensionInit(void); #endif #ifdef XF86BIGFONT -extern void XFree86BigfontExtensionInit(INITARGS); +extern void XFree86BigfontExtensionInit(void); #endif #ifdef GLXEXT #ifndef __DARWIN__ -extern void GlxExtensionInit(INITARGS); +extern void GlxExtensionInit(void); extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); #else -extern void DarwinGlxExtensionInit(INITARGS); +extern void DarwinGlxExtensionInit(void); extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *); #endif #endif #ifdef XF86DRI -extern void XFree86DRIExtensionInit(INITARGS); +extern void XFree86DRIExtensionInit(void); #endif #ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); +extern void DPMSExtensionInit(void); #endif #ifdef DPSEXT -extern void DPSExtensionInit(INITARGS); +extern void DPSExtensionInit(void); #endif #ifdef RENDER -extern void RenderExtensionInit(INITARGS); +extern void RenderExtensionInit(void); #endif #ifdef RANDR -extern void RRExtensionInit(INITARGS); +extern void RRExtensionInit(void); #endif #ifdef RES -extern void ResExtensionInit(INITARGS); +extern void ResExtensionInit(void); #endif #ifdef DMXEXT -extern void DMXExtensionInit(INITARGS); +extern void DMXExtensionInit(void); #endif #ifdef XFIXES -extern void XFixesExtensionInit(INITARGS); +extern void XFixesExtensionInit(void); #endif #ifdef DAMAGE -extern void DamageExtensionInit(INITARGS); +extern void DamageExtensionInit(void); #endif #ifdef COMPOSITE -extern void CompositeExtensionInit(INITARGS); +extern void CompositeExtensionInit(void); #endif /* The following is only a small first step towards run-time diff --git a/nx-X11/programs/Xserver/record/recordmod.c b/nx-X11/programs/Xserver/record/recordmod.c index 5a74f0f1a..b216d7f52 100644 --- a/nx-X11/programs/Xserver/record/recordmod.c +++ b/nx-X11/programs/Xserver/record/recordmod.c @@ -10,7 +10,7 @@ extern Bool noTestExtensions; static MODULESETUPPROTO(recordSetup); -extern void RecordExtensionInit(INITARGS); +extern void RecordExtensionInit(void); ExtensionModule recordExt = { RecordExtensionInit, -- cgit v1.2.3