summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-06-25 16:18:35 -0400
committerKristian Høgsberg <krh@bitplanet.net>2013-06-25 16:18:35 -0400
commit8f7f483668804cb138c87d257e2deb04616436b9 (patch)
tree847616abeff7d3df467083b48a7f9d363088561a /tests
parent1d7d8f0e95949ef42a22c51db37ddddbda07c686 (diff)
tests: Fix direct access to resource->data in weston-test
Diffstat (limited to 'tests')
-rw-r--r--tests/weston-test.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/weston-test.c b/tests/weston-test.c
index b629c86c..214296ef 100644
--- a/tests/weston-test.c
+++ b/tests/weston-test.c
@@ -95,7 +95,8 @@ move_surface(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *surface_resource,
int32_t x, int32_t y)
{
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
struct weston_test_surface *test_surface;
surface->configure = test_surface_configure;
@@ -108,7 +109,7 @@ move_surface(struct wl_client *client, struct wl_resource *resource,
}
test_surface->surface = surface;
- test_surface->test = resource->data;
+ test_surface->test = wl_resource_get_user_data(resource);
test_surface->x = x;
test_surface->y = y;
}
@@ -117,7 +118,7 @@ static void
move_pointer(struct wl_client *client, struct wl_resource *resource,
int32_t x, int32_t y)
{
- struct weston_test *test = resource->data;
+ struct weston_test *test = wl_resource_get_user_data(resource);
struct weston_seat *seat = get_seat(test);
struct weston_pointer *pointer = seat->pointer;
@@ -134,7 +135,7 @@ static void
send_button(struct wl_client *client, struct wl_resource *resource,
int32_t button, uint32_t state)
{
- struct weston_test *test = resource->data;
+ struct weston_test *test = wl_resource_get_user_data(resource);
struct weston_seat *seat = get_seat(test);
test->compositor->focus = 1;
@@ -147,8 +148,8 @@ activate_surface(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *surface_resource)
{
struct weston_surface *surface = surface_resource ?
- surface_resource->data : NULL;
- struct weston_test *test = resource->data;
+ wl_resource_get_user_data(surface_resource) : NULL;
+ struct weston_test *test = wl_resource_get_user_data(resource);
struct weston_seat *seat;
seat = get_seat(test);
@@ -168,7 +169,7 @@ static void
send_key(struct wl_client *client, struct wl_resource *resource,
uint32_t key, enum wl_keyboard_key_state state)
{
- struct weston_test *test = resource->data;
+ struct weston_test *test = wl_resource_get_user_data(resource);
struct weston_seat *seat = get_seat(test);
test->compositor->focus = 1;