mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-14 08:22:20 -04:00
scanner: Fix types emitted for new_id arguments
Previously, wayland-scanner would only emit one NULL entry in the wl_message.types array for every argument, even though requests with new_id arguments without an interface type additionally take a string and a uint argument. Signed-off-by: Hannes Schulze <contact@haschu.me>
This commit is contained in:
parent
74becc8761
commit
b93a50abd9
4 changed files with 20 additions and 4 deletions
|
|
@ -1629,6 +1629,10 @@ emit_types_forward_declarations(struct protocol *protocol,
|
||||||
m->all_null = 1;
|
m->all_null = 1;
|
||||||
wl_list_for_each(a, &m->arg_list, link) {
|
wl_list_for_each(a, &m->arg_list, link) {
|
||||||
length++;
|
length++;
|
||||||
|
if (a->type == NEW_ID && !a->interface_name)
|
||||||
|
// adds implicit string and uint arguments
|
||||||
|
length += 2;
|
||||||
|
|
||||||
switch (a->type) {
|
switch (a->type) {
|
||||||
case NEW_ID:
|
case NEW_ID:
|
||||||
case OBJECT:
|
case OBJECT:
|
||||||
|
|
@ -1866,9 +1870,15 @@ emit_types(struct protocol *protocol, struct wl_list *message_list)
|
||||||
|
|
||||||
m->type_index =
|
m->type_index =
|
||||||
protocol->null_run_length + protocol->type_index;
|
protocol->null_run_length + protocol->type_index;
|
||||||
protocol->type_index += m->arg_count;
|
|
||||||
|
|
||||||
wl_list_for_each(a, &m->arg_list, link) {
|
wl_list_for_each(a, &m->arg_list, link) {
|
||||||
|
protocol->type_index++;
|
||||||
|
if (a->type == NEW_ID && !a->interface_name) {
|
||||||
|
// adds implicit string and uint arguments
|
||||||
|
printf("\tNULL,\n\tNULL,\n");
|
||||||
|
protocol->type_index += 2;
|
||||||
|
}
|
||||||
|
|
||||||
switch (a->type) {
|
switch (a->type) {
|
||||||
case NEW_ID:
|
case NEW_ID:
|
||||||
case OBJECT:
|
case OBJECT:
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ extern const struct wl_interface another_intf_interface;
|
||||||
extern const struct wl_interface intf_not_here_interface;
|
extern const struct wl_interface intf_not_here_interface;
|
||||||
|
|
||||||
static const struct wl_interface *small_test_types[] = {
|
static const struct wl_interface *small_test_types[] = {
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&intf_not_here_interface,
|
&intf_not_here_interface,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
@ -46,7 +48,7 @@ static const struct wl_interface *small_test_types[] = {
|
||||||
|
|
||||||
static const struct wl_message intf_A_requests[] = {
|
static const struct wl_message intf_A_requests[] = {
|
||||||
{ "rq1", "sun", small_test_types + 0 },
|
{ "rq1", "sun", small_test_types + 0 },
|
||||||
{ "rq2", "nsiufho", small_test_types + 1 },
|
{ "rq2", "nsiufho", small_test_types + 3 },
|
||||||
{ "destroy", "", small_test_types + 0 },
|
{ "destroy", "", small_test_types + 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ extern const struct wl_interface another_intf_interface;
|
||||||
extern const struct wl_interface intf_not_here_interface;
|
extern const struct wl_interface intf_not_here_interface;
|
||||||
|
|
||||||
static const struct wl_interface *small_test_types[] = {
|
static const struct wl_interface *small_test_types[] = {
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&intf_not_here_interface,
|
&intf_not_here_interface,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
@ -46,7 +48,7 @@ static const struct wl_interface *small_test_types[] = {
|
||||||
|
|
||||||
static const struct wl_message intf_A_requests[] = {
|
static const struct wl_message intf_A_requests[] = {
|
||||||
{ "rq1", "sun", small_test_types + 0 },
|
{ "rq1", "sun", small_test_types + 0 },
|
||||||
{ "rq2", "nsiufho", small_test_types + 1 },
|
{ "rq2", "nsiufho", small_test_types + 3 },
|
||||||
{ "destroy", "", small_test_types + 0 },
|
{ "destroy", "", small_test_types + 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ extern const struct wl_interface another_intf_interface;
|
||||||
extern const struct wl_interface intf_not_here_interface;
|
extern const struct wl_interface intf_not_here_interface;
|
||||||
|
|
||||||
static const struct wl_interface *small_test_types[] = {
|
static const struct wl_interface *small_test_types[] = {
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&intf_not_here_interface,
|
&intf_not_here_interface,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
@ -56,7 +58,7 @@ static const struct wl_interface *small_test_types[] = {
|
||||||
|
|
||||||
static const struct wl_message intf_A_requests[] = {
|
static const struct wl_message intf_A_requests[] = {
|
||||||
{ "rq1", "sun", small_test_types + 0 },
|
{ "rq1", "sun", small_test_types + 0 },
|
||||||
{ "rq2", "nsiufho", small_test_types + 1 },
|
{ "rq2", "nsiufho", small_test_types + 3 },
|
||||||
{ "destroy", "", small_test_types + 0 },
|
{ "destroy", "", small_test_types + 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue