summaryrefslogtreecommitdiff
path: root/pkg/wayland/patch/0002-Avoid-pointer-arithmetic-on-void.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/wayland/patch/0002-Avoid-pointer-arithmetic-on-void.patch')
-rw-r--r--pkg/wayland/patch/0002-Avoid-pointer-arithmetic-on-void.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkg/wayland/patch/0002-Avoid-pointer-arithmetic-on-void.patch b/pkg/wayland/patch/0002-Avoid-pointer-arithmetic-on-void.patch
new file mode 100644
index 00000000..7ccec381
--- /dev/null
+++ b/pkg/wayland/patch/0002-Avoid-pointer-arithmetic-on-void.patch
@@ -0,0 +1,28 @@
+From 09b452f0ac177bd95258ec54f9540fec1a1a817d Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sat, 1 Jun 2019 15:01:23 -0700
+Subject: [PATCH] Avoid pointer arithmetic on `void *`
+
+The pointer operand to the binary `+` operator must be to a complete
+object type. Since we are working with byte sizes, use `char *` for
+arithmetic instead.
+---
+ src/wayland-util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/wayland-util.c b/src/wayland-util.c
+index 3a471a8..d5973bf 100644
+--- a/src/wayland-util.c
++++ b/src/wayland-util.c
+@@ -131,7 +131,7 @@ wl_array_add(struct wl_array *array, size_t size)
+ array->alloc = alloc;
+ }
+
+- p = array->data + array->size;
++ p = (char *)array->data + array->size;
+ array->size += size;
+
+ return p;
+--
+2.20.1
+