diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-09-23 08:24:06 +0200 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-09-23 08:24:06 +0200 |
commit | 096f21bb7a1217443d8a03529b1a2938518eb24f (patch) | |
tree | 6df1d363c36e65eeeafd0f555e6a564260395411 | |
parent | 824a09d856a5f750694e11d2fd2faaa3de705eaa (diff) |
EXA: Fix some issues pointed out by clang.
Remove dead variables, fix use of uninitialized values, that kind of thing.
-rw-r--r-- | exa/exa_glyphs.c | 2 | ||||
-rw-r--r-- | exa/exa_mixed.c | 4 | ||||
-rw-r--r-- | exa/exa_render.c | 12 |
3 files changed, 8 insertions, 10 deletions
diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c index d621ccf76..bf097c32f 100644 --- a/exa/exa_glyphs.c +++ b/exa/exa_glyphs.c @@ -698,13 +698,12 @@ exaGlyphs (CARD8 op, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr *glyphs) { - PicturePtr pPicture; PixmapPtr pMaskPixmap = 0; PicturePtr pMask = NULL; ScreenPtr pScreen = pDst->pDrawable->pScreen; int width = 0, height = 0; int x, y; int first_xOff = list->xOff, first_yOff = list->yOff; @@ -800,13 +799,12 @@ exaGlyphs (CARD8 op, x += list->xOff; y += list->yOff; n = list->len; while (n--) { glyph = *glyphs++; - pPicture = GlyphPicture (glyph)[pScreen->myNum]; if (glyph->info.width > 0 && glyph->info.height > 0) { /* pGlyph->info.{x,y} compensate for empty space in the glyph. */ if (maskFormat) { diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index 01f87ba87..6aa73f2b6 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -54,13 +54,13 @@ PixmapPtr exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) { PixmapPtr pPixmap; ExaPixmapPrivPtr pExaPixmap; int bpp; - size_t paddedWidth, datasize; + size_t paddedWidth; ExaScreenPriv(pScreen); if (w > 32767 || h > 32767) return NullPixmap; swap(pExaScr, pScreen, CreatePixmap); @@ -76,14 +76,12 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, bpp = pPixmap->drawable.bitsPerPixel; paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); if (paddedWidth / 4 > 32767 || h > 32767) return NullPixmap; - datasize = h * paddedWidth; - /* We will allocate the system pixmap later if needed. */ pPixmap->devPrivate.ptr = NULL; pExaPixmap->sys_ptr = NULL; pExaPixmap->sys_pitch = paddedWidth; pExaPixmap->area = NULL; diff --git a/exa/exa_render.c b/exa/exa_render.c index d46930130..1c1856610 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -263,26 +263,27 @@ exaTryDriverSolidFill(PicturePtr pSrc, { return -1; } xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; + if (pSrc->pDrawable) { + xSrc += pSrc->pDrawable->x; + ySrc += pSrc->pDrawable->y; + } if (!miComputeCompositeRegion (®ion, pSrc, NULL, pDst, xSrc, ySrc, 0, 0, xDst, yDst, width, height)) return 1; exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); if (pSrc->pDrawable) { - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); pixel = exaGetPixmapFirstPixel (pSrcPix); } else pixel = pSrc->pSourcePict->solidFill.color; if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha, @@ -337,13 +338,14 @@ exaTryDriverCompositeRects(CARD8 op, PicturePtr pMask, PicturePtr pDst, int nrect, ExaCompositeRectPtr rects) { ExaScreenPriv (pDst->pDrawable->pScreen); - int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; + int src_off_x = 0, src_off_y = 0, mask_off_x = 0, mask_off_y = 0; + int dst_off_x, dst_off_y; PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix; ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix; if (!pExaScr->info->PrepareComposite) return -1; @@ -653,13 +655,13 @@ exaTryDriverComposite(CARD8 op, /* Check whether the accelerator can use these pixmaps. * FIXME: If it cannot, use temporary pixmaps so that the drawing * happens within limits. */ if (pDstExaPix->accel_blocked || (pSrcExaPix && pSrcExaPix->accel_blocked) || - (pMask && (pMaskExaPix->accel_blocked))) + (pMaskExaPix && (pMaskExaPix->accel_blocked))) { return -1; } xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; |