Re: [PATCH wayland 4/8] fixup! scanner: use c99 initializers for the request/events arrays
On Tue, 3 Jul 2018 16:19:03 +0100 Emil Velikov wrote: > On 3 July 2018 at 12:28, Pekka Paalanen wrote: > > On Thu, 14 Jun 2018 16:49:41 +0100 > > Emil Velikov wrote: > > > >> --- > >> 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/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 = [0] }, > >> + { .name = "rq2", .signature = "nsiufho", .types = [1] }, > >> + { .name = "destroy", .signature = "", .types = [0] }, > >> }; > > > > Hi, > > > > this change doesn't look more readable to me than the old version. > > Adding the field names only clutters things and makes the lines longer > > for no added information: it is always the exact same fields set in the > > same order, and there are only three of them. > > > > The change from 'types + i' to '[i]' seems ok though. > > > Seems like these dead trivial patches are inciting some bike-shedding. > Proceed as you wish, sadly I'm out of patience. Ok, let's drop these all these, continue with other matters. Thanks, pq pgpWnno5I0Ril.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 4/8] fixup! scanner: use c99 initializers for the request/events arrays
On 3 July 2018 at 12:28, Pekka Paalanen wrote: > On Thu, 14 Jun 2018 16:49:41 +0100 > Emil Velikov wrote: > >> --- >> 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/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 = [0] }, >> + { .name = "rq2", .signature = "nsiufho", .types = [1] }, >> + { .name = "destroy", .signature = "", .types = [0] }, >> }; > > Hi, > > this change doesn't look more readable to me than the old version. > Adding the field names only clutters things and makes the lines longer > for no added information: it is always the exact same fields set in the > same order, and there are only three of them. > > The change from 'types + i' to '[i]' seems ok though. > Seems like these dead trivial patches are inciting some bike-shedding. Proceed as you wish, sadly I'm out of patience. Peace Emil ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 4/8] fixup! scanner: use c99 initializers for the request/events arrays
On Thu, 14 Jun 2018 16:49:41 +0100 Emil Velikov wrote: > --- > 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/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 = [0] }, > + { .name = "rq2", .signature = "nsiufho", .types = [1] }, > + { .name = "destroy", .signature = "", .types = [0] }, > }; Hi, this change doesn't look more readable to me than the old version. Adding the field names only clutters things and makes the lines longer for no added information: it is always the exact same fields set in the same order, and there are only three of them. The change from 'types + i' to '[i]' seems ok though. Thanks, pq pgphdt0V4eSKm.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland 4/8] fixup! scanner: use c99 initializers for the request/events arrays
--- 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 = [8] }, + { .name = "get_registry", .signature = "n", .types = [9] }, }; static const struct wl_message wl_display_events[] = { - { "error", "ous", types + 0 }, - { "delete_id", "u", types + 0 }, + { .name = "error", .signature = "ous", .types = [0] }, + { .name = "delete_id", .signature = "u", .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 = [0] }, }; static const struct wl_message wl_registry_events[] = { - { "global", "usu", types + 0 }, - { "global_remove", "u", types + 0 }, + { .name = "global", .signature = "usu", .types = [0] }, + { .name = "global_remove", .signature = "u", .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 = [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 = [10] }, + { .name = "create_region", .signature = "n", .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", "nu", types + 12 }, - { "destroy", "", types + 0 }, - { "resize", "i", types + 0 }, + { .name = "create_buffer", .signature = "nu", .types = [12] }, + { .name = "destroy", .signature = "", .types = [0] }, + { .name = "resize", .signature = "i", .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 = [18] }, }; static const struct wl_message wl_shm_events[] = { - { "format", "u", types + 0 }, + { .name = "format", .signature = "u", .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 = [0] }, }; static const struct wl_message wl_buffer_events[] = { - { "release", "", types + 0 }, + { .name = "release", .signature = "", .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 = [0] }, + { .name = "receive", .signature = "sh", .types = [0] }, + { .name = "destroy", .signature = "", .types = [0] }, + { .name = "finish", .signature = "3", .types = [0] }, + { .name = "set_actions", .signature = "3uu", .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 = [0] }, + { .name = "source_actions", .signature = "3u", .types = [0] }, + { .name = "action",