pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wayland: teach scanner to generate size_t sizes.



Module Name:	pkgsrc-wip
Committed By:	Maya Rashish <maya%NetBSD.org@localhost>
Pushed By:	coypu
Date:		Sat Aug 10 17:02:50 2019 +0300
Changeset:	e12f4b8b50edd8a88f2e494facbc783dbb068499

Modified Files:
	wayland/distinfo
	wayland/patches/patch-src_wayland-shm.c
Added Files:
	wayland/patches/patch-src_scanner.c

Log Message:
wayland: teach scanner to generate size_t sizes.

use this as an argument for create_pool / resize in the protocol.
this avoids the need to cast it from int32_t when used.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e12f4b8b50edd8a88f2e494facbc783dbb068499

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 wayland/distinfo                        |  4 +++-
 wayland/patches/patch-src_scanner.c     | 21 +++++++++++++++++++++
 wayland/patches/patch-src_wayland-shm.c | 17 +++++++++++++++--
 3 files changed, 39 insertions(+), 3 deletions(-)

diffs:
diff --git a/wayland/distinfo b/wayland/distinfo
index f903e41abe..04e9c02eae 100644
--- a/wayland/distinfo
+++ b/wayland/distinfo
@@ -6,11 +6,13 @@ SHA512 (wayland-1.17.0.tar.xz) = c5051aab5ff078b368c196ecfedb33ccd961265bb914845
 Size (wayland-1.17.0.tar.xz) = 437680 bytes
 SHA1 (patch-Makefile.am) = f48d5acd6d1dd4f17a22ebe951ec621790efcff1
 SHA1 (patch-configure.ac) = 0d1b289b9b4ecfecf8c3aa1314b2fbd66b86d38a
+SHA1 (patch-protocol_wayland.xml) = 7e7e081e6b0ab623e860ca9970a31fbbbadd04a4
 SHA1 (patch-src_event-loop.c) = 99bd6717302044430732cff21ede40e0849f026e
+SHA1 (patch-src_scanner.c) = 7d042b07c9e8de0b57fcf08aec59dca475aebed1
 SHA1 (patch-src_wayland-os.c) = 8d88cc2712b9ce8a4df8b05b6a2182d964c77ef1
 SHA1 (patch-src_wayland-os.h) = 0a8d2c7c4cbc68bedf78a924b9919158de540721
 SHA1 (patch-src_wayland-server.c) = 335de8f5390eb337dfbde26f523162bd44c06baf
-SHA1 (patch-src_wayland-shm.c) = 1eb094125b13f4c5fcaaa058d86d246d867dcdba
+SHA1 (patch-src_wayland-shm.c) = 6ad7bfe7769d4a87f8815fde3d373fff57c39f20
 SHA1 (patch-tests_client-test.c) = 6ffe18dfd64176a92f6f795eb757c54a3cf0ad10
 SHA1 (patch-tests_connection-test.c) = af53116c99cbb8d6570bcec66bfd895c1ae01700
 SHA1 (patch-tests_event-loop-test.c) = 79909fdce7b73a7b19c58d3711329f6288fe7204
diff --git a/wayland/patches/patch-src_scanner.c b/wayland/patches/patch-src_scanner.c
new file mode 100644
index 0000000000..5b55bc54ef
--- /dev/null
+++ b/wayland/patches/patch-src_scanner.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/scanner.c.orig	2019-08-10 13:45:51.656004068 +0000
++++ src/scanner.c
+@@ -204,6 +204,7 @@ enum arg_type {
+ 	INT,
+ 	UNSIGNED,
+ 	FIXED,
++	SIZE_T,
+ 	STRING,
+ 	OBJECT,
+ 	ARRAY,
+@@ -456,6 +457,8 @@ set_arg_type(struct arg *arg, const char
+ {
+ 	if (strcmp(type, "int") == 0)
+ 		arg->type = INT;
++	else if (strcmp(type, "size_t") == 0)
++		arg->type = SIZE_T;
+ 	else if (strcmp(type, "uint") == 0)
+ 		arg->type = UNSIGNED;
+ 	else if (strcmp(type, "fixed") == 0)
diff --git a/wayland/patches/patch-src_wayland-shm.c b/wayland/patches/patch-src_wayland-shm.c
index 716fff861e..a85a8108a8 100644
--- a/wayland/patches/patch-src_wayland-shm.c
+++ b/wayland/patches/patch-src_wayland-shm.c
@@ -58,7 +58,7 @@
  	munmap(pool->data, pool->size);
  	free(pool);
  }
-@@ -223,6 +241,73 @@ shm_pool_destroy(struct wl_client *clien
+@@ -223,9 +241,76 @@ shm_pool_destroy(struct wl_client *clien
  	wl_resource_destroy(resource);
  }
  
@@ -131,7 +131,20 @@
 +
  static void
  shm_pool_resize(struct wl_client *client, struct wl_resource *resource,
- 		int32_t size)
+-		int32_t size)
++		size_t size)
+ {
+ 	struct wl_shm_pool *pool = wl_resource_get_user_data(resource);
+ 
+@@ -255,7 +340,7 @@ static const struct wl_shm_pool_interfac
+ 
+ static void
+ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
+-		uint32_t id, int fd, int32_t size)
++		uint32_t id, int fd, size_t size)
+ {
+ 	struct wl_shm_pool *pool;
+ 
 @@ -284,7 +369,14 @@ shm_create_pool(struct wl_client *client
  				       "failed mmap fd %d: %m", fd);
  		goto err_free;


Home | Main Index | Thread Index | Old Index