From 692ea856fb48c6546c34773251dd049a639d36fd Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Wed, 1 Mar 2023 23:31:51 +0100 Subject: [PATCH] tests/wayland-client-utils: Use interface names instead of static strings Let's be a good example here. Part-of: --- .../wayland-test-clients/wayland-test-client-utils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/wayland-test-clients/wayland-test-client-utils.c b/src/tests/wayland-test-clients/wayland-test-client-utils.c index 96c7c273f..9e044c003 100644 --- a/src/tests/wayland-test-clients/wayland-test-client-utils.c +++ b/src/tests/wayland-test-clients/wayland-test-client-utils.c @@ -150,34 +150,34 @@ handle_registry_global (void *user_data, { WaylandDisplay *display = WAYLAND_DISPLAY (user_data); - if (strcmp (interface, "wl_compositor") == 0) + if (strcmp (interface, wl_compositor_interface.name) == 0) { display->compositor = wl_registry_bind (registry, id, &wl_compositor_interface, MIN (version, 5)); } - else if (strcmp (interface, "wl_subcompositor") == 0) + else if (strcmp (interface, wl_subcompositor_interface.name) == 0) { display->subcompositor = wl_registry_bind (registry, id, &wl_subcompositor_interface, 1); } - else if (strcmp (interface, "wl_shm") == 0) + else if (strcmp (interface, wl_shm_interface.name) == 0) { display->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1); } - else if (strcmp (interface, "wp_single_pixel_buffer_manager_v1") == 0) + else if (strcmp (interface, wp_single_pixel_buffer_manager_v1_interface.name) == 0) { display->single_pixel_mgr = wl_registry_bind (registry, id, &wp_single_pixel_buffer_manager_v1_interface, 1); } - else if (strcmp (interface, "wp_viewporter") == 0) + else if (strcmp (interface, wp_viewporter_interface.name) == 0) { display->viewporter = wl_registry_bind (registry, id, &wp_viewporter_interface, 1); } - else if (strcmp (interface, "xdg_wm_base") == 0) + else if (strcmp (interface, xdg_wm_base_interface.name) == 0) { int xdg_wm_base_version = 1;