summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-08-10 22:18:03 +0200
committerraveit65 <[email protected]>2020-09-03 15:48:17 +0200
commite40d924b127a880ef799564ebaa7329c11a2015f (patch)
tree097a918eda780307369f2b8a3225ccb2490c2305
parent3e64dccc5a4195e3fab8bf59b97e990c3732b396 (diff)
downloadmarco-e40d924b127a880ef799564ebaa7329c11a2015f.tar.bz2
marco-e40d924b127a880ef799564ebaa7329c11a2015f.tar.xz
compositor-xrender: Use USHRT_MAX macro from limits.h
-rw-r--r--src/compositor/compositor-xrender.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index c90cdd4a..37440a79 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <math.h>
#include <unistd.h>
@@ -833,10 +834,10 @@ solid_picture (MetaDisplay *display,
return None;
}
- c.alpha = (unsigned short)(a * 0xffff);
- c.red = (unsigned short)(r * 0xffff);
- c.green = (unsigned short)(g * 0xffff);
- c.blue = (unsigned short)(b * 0xffff);
+ c.alpha = (unsigned short)(a * USHRT_MAX);
+ c.red = (unsigned short)(r * USHRT_MAX);
+ c.green = (unsigned short)(g * USHRT_MAX);
+ c.blue = (unsigned short)(b * USHRT_MAX);
XRenderFillRectangle (xdisplay, PictOpSrc, picture, &c, 0, 0, 1, 1);
XFreePixmap (xdisplay, pixmap);
@@ -912,7 +913,7 @@ root_tile (MetaScreen *screen)
c.red = 0x0000;
c.green = 0x0000;
c.blue = 0x0000;
- c.alpha = 0xffff;
+ c.alpha = USHRT_MAX;
XRenderFillRectangle (xdisplay, PictOpSrc, picture, &c, 0, 0, 1, 1);
XFreePixmap (xdisplay, pixmap);