summaryrefslogtreecommitdiff
path: root/lib/xcb-util/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2023-07-03 09:07:45 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2023-07-03 09:07:45 +0000
commita4e5ebc477e2aea2f4bf19a912b46b842249dff6 (patch)
treef88aebccd8a13f6cee7d97fc335fe87aae94fbe6 /lib/xcb-util/src
parente52ab755744174ab44bc7881316371ed1988fd3b (diff)
Update to xcb-util 0.4.1
Diffstat (limited to 'lib/xcb-util/src')
-rw-r--r--lib/xcb-util/src/Makefile.in2
-rw-r--r--lib/xcb-util/src/atoms.c12
-rw-r--r--lib/xcb-util/src/xcb_aux.c8
3 files changed, 15 insertions, 7 deletions
diff --git a/lib/xcb-util/src/Makefile.in b/lib/xcb-util/src/Makefile.in
index 06f0ac610..96869d2cb 100644
--- a/lib/xcb-util/src/Makefile.in
+++ b/lib/xcb-util/src/Makefile.in
@@ -169,7 +169,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
-CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -287,6 +286,7 @@ pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/lib/xcb-util/src/atoms.c b/lib/xcb-util/src/atoms.c
index e5c33e5dd..fe7fe94f8 100644
--- a/lib/xcb-util/src/atoms.c
+++ b/lib/xcb-util/src/atoms.c
@@ -13,6 +13,14 @@
#include <stdarg.h>
#include "xcb_atom.h"
+#ifndef __has_attribute
+# define __has_attribute(x) 0 /* Compatibility with older compilers. */
+#endif
+
+#if __has_attribute(__format__) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
+__attribute__((__format__(__printf__,1,2)))
+#endif
static char *makename(const char *fmt, ...)
{
char *ret;
@@ -73,7 +81,7 @@ char *xcb_atom_name_by_resource(const char *base, uint32_t resource)
char *xcb_atom_name_unique(const char *base, uint32_t id)
{
if(base)
- return makename("%s_U%lu", base, id);
+ return makename("%s_U%u", base, id);
else
- return makename("U%lu", id);
+ return makename("U%u", id);
}
diff --git a/lib/xcb-util/src/xcb_aux.c b/lib/xcb-util/src/xcb_aux.c
index b6f64f886..c56ad610a 100644
--- a/lib/xcb-util/src/xcb_aux.c
+++ b/lib/xcb-util/src/xcb_aux.c
@@ -48,7 +48,7 @@ xcb_aux_get_depth (xcb_connection_t *c,
{
xcb_drawable_t drawable;
xcb_get_geometry_reply_t *geom;
- int depth = 0;
+ uint8_t depth = 0;
drawable = screen->root;
geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0);
@@ -340,9 +340,9 @@ xcb_aux_parse_color(const char *color_name,
} while (*color_name != '\0');
n <<= 2;
n = 16 - n;
- *red = r << n;
- *green = g << n;
- *blue = b << n;
+ *red = (uint16_t) (r << n);
+ *green = (uint16_t) (g << n);
+ *blue = (uint16_t) (b << n);
return 1;
}