Just use floats, it's not like this is a performance path.

Signed-off-by: Adam Jackson <[email protected]>
---
 Xext/xres.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Xext/xres.c b/Xext/xres.c
index b26cbb5..546b942 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -353,9 +353,9 @@ static unsigned long
 ResGetApproxPixmapBytes(PixmapPtr pix)
 {
     unsigned long nPixels;
-    int bytesPerPixel;
+    float bytesPerPixel;
 
-    bytesPerPixel = pix->drawable.bitsPerPixel >> 3;
+    bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0;
     nPixels = pix->drawable.width * pix->drawable.height;
 
     /* Divide by refcnt as pixmap could be shared between clients,  
-- 
1.8.5.3

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to