[PATCH wayland 3/4] scanner: use c99 initializers for the interface symbols

Emil Velikov emil.l.velikov at gmail.com
Wed Aug 30 15:21:14 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/scanner.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/scanner.c b/src/scanner.c
index b77641f..b38af52 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1751,20 +1751,16 @@ emit_code(struct protocol *protocol)
 
 		printf("WL_EXPORT const struct wl_interface "
 		       "%s_interface = {\n"
-		       "\t\"%s\", %d,\n",
+		       "\t.name = \"%s\", .version = %d,\n",
 		       i->name, i->name, i->version);
 
 		if (!wl_list_empty(&i->request_list))
-			printf("\t%d, %s_requests,\n",
+			printf("\t.method_count = %d, .methods = %s_requests,\n",
 			       wl_list_length(&i->request_list), i->name);
-		else
-			printf("\t0, NULL,\n");
 
 		if (!wl_list_empty(&i->event_list))
-			printf("\t%d, %s_events,\n",
+			printf("\t.event_count = %d, .events = %s_events,\n",
 			       wl_list_length(&i->event_list), i->name);
-		else
-			printf("\t0, NULL,\n");
 
 		printf("};\n\n");
 
-- 
2.14.1



More information about the wayland-devel mailing list