exa: fix "comparison is always false"
Both functions has a check at the beginning to return when h > 32767. Fixes LGTM 2 warnings "Comparison is always false because h <= 32767." Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
This commit is contained in:
parent
a79bd188fe
commit
1d80db55dd
|
@ -87,7 +87,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
|
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
|
||||||
if (paddedWidth / 4 > 32767 || h > 32767)
|
if (paddedWidth / 4 > 32767)
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
|
exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
|
||||||
|
|
|
@ -72,7 +72,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
bpp = pPixmap->drawable.bitsPerPixel;
|
bpp = pPixmap->drawable.bitsPerPixel;
|
||||||
|
|
||||||
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
|
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
|
||||||
if (paddedWidth / 4 > 32767 || h > 32767)
|
if (paddedWidth / 4 > 32767)
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
/* We will allocate the system pixmap later if needed. */
|
/* We will allocate the system pixmap later if needed. */
|
||||||
|
@ -326,5 +326,3 @@ exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue