[PATCH wayland 4/8] fixup! scanner: use c99 initializers for the request/events arrays

Emil Velikov emil.l.velikov at gmail.com
Thu Jun 14 15:49:41 UTC 2018


---
 tests/data/example-code.c       | 238 ++++++++++++++++++++--------------------
 tests/data/small-code-core.c    |   8 +-
 tests/data/small-code.c         |   8 +-
 tests/data/small-private-code.c |   8 +-
 4 files changed, 131 insertions(+), 131 deletions(-)

diff --git a/tests/data/example-code.c b/tests/data/example-code.c
index ccfa9ef..4a41b8b 100644
--- a/tests/data/example-code.c
+++ b/tests/data/example-code.c
@@ -147,13 +147,13 @@ static const struct wl_interface *types[] = {
 };
 
 static const struct wl_message wl_display_requests[] = {
-	{ "sync", "n", types + 8 },
-	{ "get_registry", "n", types + 9 },
+	{ .name = "sync", .signature = "n", .types = &types[8] },
+	{ .name = "get_registry", .signature = "n", .types = &types[9] },
 };
 
 static const struct wl_message wl_display_events[] = {
-	{ "error", "ous", types + 0 },
-	{ "delete_id", "u", types + 0 },
+	{ .name = "error", .signature = "ous", .types = &types[0] },
+	{ .name = "delete_id", .signature = "u", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_display_interface = {
@@ -163,12 +163,12 @@ WL_EXPORT const struct wl_interface wl_display_interface = {
 };
 
 static const struct wl_message wl_registry_requests[] = {
-	{ "bind", "usun", types + 0 },
+	{ .name = "bind", .signature = "usun", .types = &types[0] },
 };
 
 static const struct wl_message wl_registry_events[] = {
-	{ "global", "usu", types + 0 },
-	{ "global_remove", "u", types + 0 },
+	{ .name = "global", .signature = "usu", .types = &types[0] },
+	{ .name = "global_remove", .signature = "u", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_registry_interface = {
@@ -178,7 +178,7 @@ WL_EXPORT const struct wl_interface wl_registry_interface = {
 };
 
 static const struct wl_message wl_callback_events[] = {
-	{ "done", "u", types + 0 },
+	{ .name = "done", .signature = "u", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_callback_interface = {
@@ -188,8 +188,8 @@ WL_EXPORT const struct wl_interface wl_callback_interface = {
 };
 
 static const struct wl_message wl_compositor_requests[] = {
-	{ "create_surface", "n", types + 10 },
-	{ "create_region", "n", types + 11 },
+	{ .name = "create_surface", .signature = "n", .types = &types[10] },
+	{ .name = "create_region", .signature = "n", .types = &types[11] },
 };
 
 WL_EXPORT const struct wl_interface wl_compositor_interface = {
@@ -199,9 +199,9 @@ WL_EXPORT const struct wl_interface wl_compositor_interface = {
 };
 
 static const struct wl_message wl_shm_pool_requests[] = {
-	{ "create_buffer", "niiiiu", types + 12 },
-	{ "destroy", "", types + 0 },
-	{ "resize", "i", types + 0 },
+	{ .name = "create_buffer", .signature = "niiiiu", .types = &types[12] },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "resize", .signature = "i", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_shm_pool_interface = {
@@ -211,11 +211,11 @@ WL_EXPORT const struct wl_interface wl_shm_pool_interface = {
 };
 
 static const struct wl_message wl_shm_requests[] = {
-	{ "create_pool", "nhi", types + 18 },
+	{ .name = "create_pool", .signature = "nhi", .types = &types[18] },
 };
 
 static const struct wl_message wl_shm_events[] = {
-	{ "format", "u", types + 0 },
+	{ .name = "format", .signature = "u", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_shm_interface = {
@@ -225,11 +225,11 @@ WL_EXPORT const struct wl_interface wl_shm_interface = {
 };
 
 static const struct wl_message wl_buffer_requests[] = {
-	{ "destroy", "", types + 0 },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
 };
 
 static const struct wl_message wl_buffer_events[] = {
-	{ "release", "", types + 0 },
+	{ .name = "release", .signature = "", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_buffer_interface = {
@@ -239,17 +239,17 @@ WL_EXPORT const struct wl_interface wl_buffer_interface = {
 };
 
 static const struct wl_message wl_data_offer_requests[] = {
-	{ "accept", "u?s", types + 0 },
-	{ "receive", "sh", types + 0 },
-	{ "destroy", "", types + 0 },
-	{ "finish", "3", types + 0 },
-	{ "set_actions", "3uu", types + 0 },
+	{ .name = "accept", .signature = "u?s", .types = &types[0] },
+	{ .name = "receive", .signature = "sh", .types = &types[0] },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "finish", .signature = "3", .types = &types[0] },
+	{ .name = "set_actions", .signature = "3uu", .types = &types[0] },
 };
 
 static const struct wl_message wl_data_offer_events[] = {
-	{ "offer", "s", types + 0 },
-	{ "source_actions", "3u", types + 0 },
-	{ "action", "3u", types + 0 },
+	{ .name = "offer", .signature = "s", .types = &types[0] },
+	{ .name = "source_actions", .signature = "3u", .types = &types[0] },
+	{ .name = "action", .signature = "3u", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_data_offer_interface = {
@@ -259,18 +259,18 @@ WL_EXPORT const struct wl_interface wl_data_offer_interface = {
 };
 
 static const struct wl_message wl_data_source_requests[] = {
-	{ "offer", "s", types + 0 },
-	{ "destroy", "", types + 0 },
-	{ "set_actions", "3u", types + 0 },
+	{ .name = "offer", .signature = "s", .types = &types[0] },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "set_actions", .signature = "3u", .types = &types[0] },
 };
 
 static const struct wl_message wl_data_source_events[] = {
-	{ "target", "?s", types + 0 },
-	{ "send", "sh", types + 0 },
-	{ "cancelled", "", types + 0 },
-	{ "dnd_drop_performed", "3", types + 0 },
-	{ "dnd_finished", "3", types + 0 },
-	{ "action", "3u", types + 0 },
+	{ .name = "target", .signature = "?s", .types = &types[0] },
+	{ .name = "send", .signature = "sh", .types = &types[0] },
+	{ .name = "cancelled", .signature = "", .types = &types[0] },
+	{ .name = "dnd_drop_performed", .signature = "3", .types = &types[0] },
+	{ .name = "dnd_finished", .signature = "3", .types = &types[0] },
+	{ .name = "action", .signature = "3u", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_data_source_interface = {
@@ -280,18 +280,18 @@ WL_EXPORT const struct wl_interface wl_data_source_interface = {
 };
 
 static const struct wl_message wl_data_device_requests[] = {
-	{ "start_drag", "?oo?ou", types + 21 },
-	{ "set_selection", "?ou", types + 25 },
-	{ "release", "2", types + 0 },
+	{ .name = "start_drag", .signature = "?oo?ou", .types = &types[21] },
+	{ .name = "set_selection", .signature = "?ou", .types = &types[25] },
+	{ .name = "release", .signature = "2", .types = &types[0] },
 };
 
 static const struct wl_message wl_data_device_events[] = {
-	{ "data_offer", "n", types + 27 },
-	{ "enter", "uoff?o", types + 28 },
-	{ "leave", "", types + 0 },
-	{ "motion", "uff", types + 0 },
-	{ "drop", "", types + 0 },
-	{ "selection", "?o", types + 33 },
+	{ .name = "data_offer", .signature = "n", .types = &types[27] },
+	{ .name = "enter", .signature = "uoff?o", .types = &types[28] },
+	{ .name = "leave", .signature = "", .types = &types[0] },
+	{ .name = "motion", .signature = "uff", .types = &types[0] },
+	{ .name = "drop", .signature = "", .types = &types[0] },
+	{ .name = "selection", .signature = "?o", .types = &types[33] },
 };
 
 WL_EXPORT const struct wl_interface wl_data_device_interface = {
@@ -301,8 +301,8 @@ WL_EXPORT const struct wl_interface wl_data_device_interface = {
 };
 
 static const struct wl_message wl_data_device_manager_requests[] = {
-	{ "create_data_source", "n", types + 34 },
-	{ "get_data_device", "no", types + 35 },
+	{ .name = "create_data_source", .signature = "n", .types = &types[34] },
+	{ .name = "get_data_device", .signature = "no", .types = &types[35] },
 };
 
 WL_EXPORT const struct wl_interface wl_data_device_manager_interface = {
@@ -312,7 +312,7 @@ WL_EXPORT const struct wl_interface wl_data_device_manager_interface = {
 };
 
 static const struct wl_message wl_shell_requests[] = {
-	{ "get_shell_surface", "no", types + 37 },
+	{ .name = "get_shell_surface", .signature = "no", .types = &types[37] },
 };
 
 WL_EXPORT const struct wl_interface wl_shell_interface = {
@@ -322,22 +322,22 @@ WL_EXPORT const struct wl_interface wl_shell_interface = {
 };
 
 static const struct wl_message wl_shell_surface_requests[] = {
-	{ "pong", "u", types + 0 },
-	{ "move", "ou", types + 39 },
-	{ "resize", "ouu", types + 41 },
-	{ "set_toplevel", "", types + 0 },
-	{ "set_transient", "oiiu", types + 44 },
-	{ "set_fullscreen", "uu?o", types + 48 },
-	{ "set_popup", "ouoiiu", types + 51 },
-	{ "set_maximized", "?o", types + 57 },
-	{ "set_title", "s", types + 0 },
-	{ "set_class", "s", types + 0 },
+	{ .name = "pong", .signature = "u", .types = &types[0] },
+	{ .name = "move", .signature = "ou", .types = &types[39] },
+	{ .name = "resize", .signature = "ouu", .types = &types[41] },
+	{ .name = "set_toplevel", .signature = "", .types = &types[0] },
+	{ .name = "set_transient", .signature = "oiiu", .types = &types[44] },
+	{ .name = "set_fullscreen", .signature = "uu?o", .types = &types[48] },
+	{ .name = "set_popup", .signature = "ouoiiu", .types = &types[51] },
+	{ .name = "set_maximized", .signature = "?o", .types = &types[57] },
+	{ .name = "set_title", .signature = "s", .types = &types[0] },
+	{ .name = "set_class", .signature = "s", .types = &types[0] },
 };
 
 static const struct wl_message wl_shell_surface_events[] = {
-	{ "ping", "u", types + 0 },
-	{ "configure", "uii", types + 0 },
-	{ "popup_done", "", types + 0 },
+	{ .name = "ping", .signature = "u", .types = &types[0] },
+	{ .name = "configure", .signature = "uii", .types = &types[0] },
+	{ .name = "popup_done", .signature = "", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_shell_surface_interface = {
@@ -347,21 +347,21 @@ WL_EXPORT const struct wl_interface wl_shell_surface_interface = {
 };
 
 static const struct wl_message wl_surface_requests[] = {
-	{ "destroy", "", types + 0 },
-	{ "attach", "?oii", types + 58 },
-	{ "damage", "iiii", types + 0 },
-	{ "frame", "n", types + 61 },
-	{ "set_opaque_region", "?o", types + 62 },
-	{ "set_input_region", "?o", types + 63 },
-	{ "commit", "", types + 0 },
-	{ "set_buffer_transform", "2i", types + 0 },
-	{ "set_buffer_scale", "3i", types + 0 },
-	{ "damage_buffer", "4iiii", types + 0 },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "attach", .signature = "?oii", .types = &types[58] },
+	{ .name = "damage", .signature = "iiii", .types = &types[0] },
+	{ .name = "frame", .signature = "n", .types = &types[61] },
+	{ .name = "set_opaque_region", .signature = "?o", .types = &types[62] },
+	{ .name = "set_input_region", .signature = "?o", .types = &types[63] },
+	{ .name = "commit", .signature = "", .types = &types[0] },
+	{ .name = "set_buffer_transform", .signature = "2i", .types = &types[0] },
+	{ .name = "set_buffer_scale", .signature = "3i", .types = &types[0] },
+	{ .name = "damage_buffer", .signature = "4iiii", .types = &types[0] },
 };
 
 static const struct wl_message wl_surface_events[] = {
-	{ "enter", "o", types + 64 },
-	{ "leave", "o", types + 65 },
+	{ .name = "enter", .signature = "o", .types = &types[64] },
+	{ .name = "leave", .signature = "o", .types = &types[65] },
 };
 
 WL_EXPORT const struct wl_interface wl_surface_interface = {
@@ -371,15 +371,15 @@ WL_EXPORT const struct wl_interface wl_surface_interface = {
 };
 
 static const struct wl_message wl_seat_requests[] = {
-	{ "get_pointer", "n", types + 66 },
-	{ "get_keyboard", "n", types + 67 },
-	{ "get_touch", "n", types + 68 },
-	{ "release", "5", types + 0 },
+	{ .name = "get_pointer", .signature = "n", .types = &types[66] },
+	{ .name = "get_keyboard", .signature = "n", .types = &types[67] },
+	{ .name = "get_touch", .signature = "n", .types = &types[68] },
+	{ .name = "release", .signature = "5", .types = &types[0] },
 };
 
 static const struct wl_message wl_seat_events[] = {
-	{ "capabilities", "u", types + 0 },
-	{ "name", "2s", types + 0 },
+	{ .name = "capabilities", .signature = "u", .types = &types[0] },
+	{ .name = "name", .signature = "2s", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_seat_interface = {
@@ -389,20 +389,20 @@ WL_EXPORT const struct wl_interface wl_seat_interface = {
 };
 
 static const struct wl_message wl_pointer_requests[] = {
-	{ "set_cursor", "u?oii", types + 69 },
-	{ "release", "3", types + 0 },
+	{ .name = "set_cursor", .signature = "u?oii", .types = &types[69] },
+	{ .name = "release", .signature = "3", .types = &types[0] },
 };
 
 static const struct wl_message wl_pointer_events[] = {
-	{ "enter", "uoff", types + 73 },
-	{ "leave", "uo", types + 77 },
-	{ "motion", "uff", types + 0 },
-	{ "button", "uuuu", types + 0 },
-	{ "axis", "uuf", types + 0 },
-	{ "frame", "5", types + 0 },
-	{ "axis_source", "5u", types + 0 },
-	{ "axis_stop", "5uu", types + 0 },
-	{ "axis_discrete", "5ui", types + 0 },
+	{ .name = "enter", .signature = "uoff", .types = &types[73] },
+	{ .name = "leave", .signature = "uo", .types = &types[77] },
+	{ .name = "motion", .signature = "uff", .types = &types[0] },
+	{ .name = "button", .signature = "uuuu", .types = &types[0] },
+	{ .name = "axis", .signature = "uuf", .types = &types[0] },
+	{ .name = "frame", .signature = "5", .types = &types[0] },
+	{ .name = "axis_source", .signature = "5u", .types = &types[0] },
+	{ .name = "axis_stop", .signature = "5uu", .types = &types[0] },
+	{ .name = "axis_discrete", .signature = "5ui", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_pointer_interface = {
@@ -412,16 +412,16 @@ WL_EXPORT const struct wl_interface wl_pointer_interface = {
 };
 
 static const struct wl_message wl_keyboard_requests[] = {
-	{ "release", "3", types + 0 },
+	{ .name = "release", .signature = "3", .types = &types[0] },
 };
 
 static const struct wl_message wl_keyboard_events[] = {
-	{ "keymap", "uhu", types + 0 },
-	{ "enter", "uoa", types + 79 },
-	{ "leave", "uo", types + 82 },
-	{ "key", "uuuu", types + 0 },
-	{ "modifiers", "uuuuu", types + 0 },
-	{ "repeat_info", "4ii", types + 0 },
+	{ .name = "keymap", .signature = "uhu", .types = &types[0] },
+	{ .name = "enter", .signature = "uoa", .types = &types[79] },
+	{ .name = "leave", .signature = "uo", .types = &types[82] },
+	{ .name = "key", .signature = "uuuu", .types = &types[0] },
+	{ .name = "modifiers", .signature = "uuuuu", .types = &types[0] },
+	{ .name = "repeat_info", .signature = "4ii", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_keyboard_interface = {
@@ -431,17 +431,17 @@ WL_EXPORT const struct wl_interface wl_keyboard_interface = {
 };
 
 static const struct wl_message wl_touch_requests[] = {
-	{ "release", "3", types + 0 },
+	{ .name = "release", .signature = "3", .types = &types[0] },
 };
 
 static const struct wl_message wl_touch_events[] = {
-	{ "down", "uuoiff", types + 84 },
-	{ "up", "uui", types + 0 },
-	{ "motion", "uiff", types + 0 },
-	{ "frame", "", types + 0 },
-	{ "cancel", "", types + 0 },
-	{ "shape", "6iff", types + 0 },
-	{ "orientation", "6if", types + 0 },
+	{ .name = "down", .signature = "uuoiff", .types = &types[84] },
+	{ .name = "up", .signature = "uui", .types = &types[0] },
+	{ .name = "motion", .signature = "uiff", .types = &types[0] },
+	{ .name = "frame", .signature = "", .types = &types[0] },
+	{ .name = "cancel", .signature = "", .types = &types[0] },
+	{ .name = "shape", .signature = "6iff", .types = &types[0] },
+	{ .name = "orientation", .signature = "6if", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_touch_interface = {
@@ -451,14 +451,14 @@ WL_EXPORT const struct wl_interface wl_touch_interface = {
 };
 
 static const struct wl_message wl_output_requests[] = {
-	{ "release", "3", types + 0 },
+	{ .name = "release", .signature = "3", .types = &types[0] },
 };
 
 static const struct wl_message wl_output_events[] = {
-	{ "geometry", "iiiiissi", types + 0 },
-	{ "mode", "uiii", types + 0 },
-	{ "done", "2", types + 0 },
-	{ "scale", "2i", types + 0 },
+	{ .name = "geometry", .signature = "iiiiissi", .types = &types[0] },
+	{ .name = "mode", .signature = "uiii", .types = &types[0] },
+	{ .name = "done", .signature = "2", .types = &types[0] },
+	{ .name = "scale", .signature = "2i", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_output_interface = {
@@ -468,9 +468,9 @@ WL_EXPORT const struct wl_interface wl_output_interface = {
 };
 
 static const struct wl_message wl_region_requests[] = {
-	{ "destroy", "", types + 0 },
-	{ "add", "iiii", types + 0 },
-	{ "subtract", "iiii", types + 0 },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "add", .signature = "iiii", .types = &types[0] },
+	{ .name = "subtract", .signature = "iiii", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_region_interface = {
@@ -480,8 +480,8 @@ WL_EXPORT const struct wl_interface wl_region_interface = {
 };
 
 static const struct wl_message wl_subcompositor_requests[] = {
-	{ "destroy", "", types + 0 },
-	{ "get_subsurface", "noo", types + 90 },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "get_subsurface", .signature = "noo", .types = &types[90] },
 };
 
 WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
@@ -491,12 +491,12 @@ WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
 };
 
 static const struct wl_message wl_subsurface_requests[] = {
-	{ "destroy", "", types + 0 },
-	{ "set_position", "ii", types + 0 },
-	{ "place_above", "o", types + 93 },
-	{ "place_below", "o", types + 94 },
-	{ "set_sync", "", types + 0 },
-	{ "set_desync", "", types + 0 },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
+	{ .name = "set_position", .signature = "ii", .types = &types[0] },
+	{ .name = "place_above", .signature = "o", .types = &types[93] },
+	{ .name = "place_below", .signature = "o", .types = &types[94] },
+	{ .name = "set_sync", .signature = "", .types = &types[0] },
+	{ .name = "set_desync", .signature = "", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface wl_subsurface_interface = {
diff --git a/tests/data/small-code-core.c b/tests/data/small-code-core.c
index 279efa6..4f27f03 100644
--- a/tests/data/small-code-core.c
+++ b/tests/data/small-code-core.c
@@ -44,13 +44,13 @@ static const struct wl_interface *types[] = {
 };
 
 static const struct wl_message intf_A_requests[] = {
-	{ "rq1", "sun", types + 0 },
-	{ "rq2", "nsiufho", types + 1 },
-	{ "destroy", "", types + 0 },
+	{ .name = "rq1", .signature = "sun", .types = &types[0] },
+	{ .name = "rq2", .signature = "nsiufho", .types = &types[1] },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
 };
 
 static const struct wl_message intf_A_events[] = {
-	{ "hey", "", types + 0 },
+	{ .name = "hey", .signature = "", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface intf_A_interface = {
diff --git a/tests/data/small-code.c b/tests/data/small-code.c
index 279efa6..4f27f03 100644
--- a/tests/data/small-code.c
+++ b/tests/data/small-code.c
@@ -44,13 +44,13 @@ static const struct wl_interface *types[] = {
 };
 
 static const struct wl_message intf_A_requests[] = {
-	{ "rq1", "sun", types + 0 },
-	{ "rq2", "nsiufho", types + 1 },
-	{ "destroy", "", types + 0 },
+	{ .name = "rq1", .signature = "sun", .types = &types[0] },
+	{ .name = "rq2", .signature = "nsiufho", .types = &types[1] },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
 };
 
 static const struct wl_message intf_A_events[] = {
-	{ "hey", "", types + 0 },
+	{ .name = "hey", .signature = "", .types = &types[0] },
 };
 
 WL_EXPORT const struct wl_interface intf_A_interface = {
diff --git a/tests/data/small-private-code.c b/tests/data/small-private-code.c
index 35fa653..84f77de 100644
--- a/tests/data/small-private-code.c
+++ b/tests/data/small-private-code.c
@@ -54,13 +54,13 @@ static const struct wl_interface *types[] = {
 };
 
 static const struct wl_message intf_A_requests[] = {
-	{ "rq1", "sun", types + 0 },
-	{ "rq2", "nsiufho", types + 1 },
-	{ "destroy", "", types + 0 },
+	{ .name = "rq1", .signature = "sun", .types = &types[0] },
+	{ .name = "rq2", .signature = "nsiufho", .types = &types[1] },
+	{ .name = "destroy", .signature = "", .types = &types[0] },
 };
 
 static const struct wl_message intf_A_events[] = {
-	{ "hey", "", types + 0 },
+	{ .name = "hey", .signature = "", .types = &types[0] },
 };
 
 WL_PRIVATE const struct wl_interface intf_A_interface = {
-- 
2.16.0



More information about the wayland-devel mailing list