summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-06-25 13:51:53 +0100
committerChris Michael <cp.michael@samsung.com>2013-06-25 14:14:04 +0100
commit0615dfe4ee1636b56086545605ea9dd6dadb95c2 (patch)
treee84e8274303b88932b6d42805f71bc156cf32c95
parent44568ef01d30c384b5b9e67f602f39c705391aa6 (diff)
Add missing safety checks for valid proxy objects before trying to
call functions on the object Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/modules/ecore_imf/wayland/text-client-protocol.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modules/ecore_imf/wayland/text-client-protocol.h b/src/modules/ecore_imf/wayland/text-client-protocol.h
index cfea94bbeb..f9de29c9e5 100644
--- a/src/modules/ecore_imf/wayland/text-client-protocol.h
+++ b/src/modules/ecore_imf/wayland/text-client-protocol.h
@@ -409,24 +409,28 @@ wl_text_input_add_listener(struct wl_text_input *wl_text_input,
409static inline void 409static inline void
410wl_text_input_set_user_data(struct wl_text_input *wl_text_input, void *user_data) 410wl_text_input_set_user_data(struct wl_text_input *wl_text_input, void *user_data)
411{ 411{
412 if (!wl_text_input) return;
412 wl_proxy_set_user_data((struct wl_proxy *) wl_text_input, user_data); 413 wl_proxy_set_user_data((struct wl_proxy *) wl_text_input, user_data);
413} 414}
414 415
415static inline void * 416static inline void *
416wl_text_input_get_user_data(struct wl_text_input *wl_text_input) 417wl_text_input_get_user_data(struct wl_text_input *wl_text_input)
417{ 418{
419 if (!wl_text_input) return NULL;
418 return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input); 420 return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input);
419} 421}
420 422
421static inline void 423static inline void
422wl_text_input_destroy(struct wl_text_input *wl_text_input) 424wl_text_input_destroy(struct wl_text_input *wl_text_input)
423{ 425{
426 if (!wl_text_input) return;
424 wl_proxy_destroy((struct wl_proxy *) wl_text_input); 427 wl_proxy_destroy((struct wl_proxy *) wl_text_input);
425} 428}
426 429
427static inline void 430static inline void
428wl_text_input_activate(struct wl_text_input *wl_text_input, struct wl_seat *seat, struct wl_surface *surface) 431wl_text_input_activate(struct wl_text_input *wl_text_input, struct wl_seat *seat, struct wl_surface *surface)
429{ 432{
433 if (!wl_text_input) return;
430 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 434 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
431 WL_TEXT_INPUT_ACTIVATE, seat, surface); 435 WL_TEXT_INPUT_ACTIVATE, seat, surface);
432} 436}
@@ -434,6 +438,7 @@ wl_text_input_activate(struct wl_text_input *wl_text_input, struct wl_seat *seat
434static inline void 438static inline void
435wl_text_input_deactivate(struct wl_text_input *wl_text_input, struct wl_seat *seat) 439wl_text_input_deactivate(struct wl_text_input *wl_text_input, struct wl_seat *seat)
436{ 440{
441 if (!wl_text_input) return;
437 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 442 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
438 WL_TEXT_INPUT_DEACTIVATE, seat); 443 WL_TEXT_INPUT_DEACTIVATE, seat);
439} 444}
@@ -441,6 +446,7 @@ wl_text_input_deactivate(struct wl_text_input *wl_text_input, struct wl_seat *se
441static inline void 446static inline void
442wl_text_input_show_input_panel(struct wl_text_input *wl_text_input) 447wl_text_input_show_input_panel(struct wl_text_input *wl_text_input)
443{ 448{
449 if (!wl_text_input) return;
444 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 450 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
445 WL_TEXT_INPUT_SHOW_INPUT_PANEL); 451 WL_TEXT_INPUT_SHOW_INPUT_PANEL);
446} 452}
@@ -448,6 +454,7 @@ wl_text_input_show_input_panel(struct wl_text_input *wl_text_input)
448static inline void 454static inline void
449wl_text_input_hide_input_panel(struct wl_text_input *wl_text_input) 455wl_text_input_hide_input_panel(struct wl_text_input *wl_text_input)
450{ 456{
457 if (!wl_text_input) return;
451 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 458 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
452 WL_TEXT_INPUT_HIDE_INPUT_PANEL); 459 WL_TEXT_INPUT_HIDE_INPUT_PANEL);
453} 460}
@@ -455,6 +462,7 @@ wl_text_input_hide_input_panel(struct wl_text_input *wl_text_input)
455static inline void 462static inline void
456wl_text_input_reset(struct wl_text_input *wl_text_input) 463wl_text_input_reset(struct wl_text_input *wl_text_input)
457{ 464{
465 if (!wl_text_input) return;
458 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 466 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
459 WL_TEXT_INPUT_RESET); 467 WL_TEXT_INPUT_RESET);
460} 468}
@@ -462,6 +470,7 @@ wl_text_input_reset(struct wl_text_input *wl_text_input)
462static inline void 470static inline void
463wl_text_input_set_surrounding_text(struct wl_text_input *wl_text_input, const char *text, uint32_t cursor, uint32_t anchor) 471wl_text_input_set_surrounding_text(struct wl_text_input *wl_text_input, const char *text, uint32_t cursor, uint32_t anchor)
464{ 472{
473 if (!wl_text_input) return;
465 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 474 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
466 WL_TEXT_INPUT_SET_SURROUNDING_TEXT, text, cursor, anchor); 475 WL_TEXT_INPUT_SET_SURROUNDING_TEXT, text, cursor, anchor);
467} 476}
@@ -469,6 +478,7 @@ wl_text_input_set_surrounding_text(struct wl_text_input *wl_text_input, const ch
469static inline void 478static inline void
470wl_text_input_set_content_type(struct wl_text_input *wl_text_input, uint32_t hint, uint32_t purpose) 479wl_text_input_set_content_type(struct wl_text_input *wl_text_input, uint32_t hint, uint32_t purpose)
471{ 480{
481 if (!wl_text_input) return;
472 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 482 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
473 WL_TEXT_INPUT_SET_CONTENT_TYPE, hint, purpose); 483 WL_TEXT_INPUT_SET_CONTENT_TYPE, hint, purpose);
474} 484}
@@ -476,6 +486,7 @@ wl_text_input_set_content_type(struct wl_text_input *wl_text_input, uint32_t hin
476static inline void 486static inline void
477wl_text_input_set_cursor_rectangle(struct wl_text_input *wl_text_input, int32_t x, int32_t y, int32_t width, int32_t height) 487wl_text_input_set_cursor_rectangle(struct wl_text_input *wl_text_input, int32_t x, int32_t y, int32_t width, int32_t height)
478{ 488{
489 if (!wl_text_input) return;
479 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 490 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
480 WL_TEXT_INPUT_SET_CURSOR_RECTANGLE, x, y, width, height); 491 WL_TEXT_INPUT_SET_CURSOR_RECTANGLE, x, y, width, height);
481} 492}
@@ -483,6 +494,7 @@ wl_text_input_set_cursor_rectangle(struct wl_text_input *wl_text_input, int32_t
483static inline void 494static inline void
484wl_text_input_set_preferred_language(struct wl_text_input *wl_text_input, const char *language) 495wl_text_input_set_preferred_language(struct wl_text_input *wl_text_input, const char *language)
485{ 496{
497 if (!wl_text_input) return;
486 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 498 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
487 WL_TEXT_INPUT_SET_PREFERRED_LANGUAGE, language); 499 WL_TEXT_INPUT_SET_PREFERRED_LANGUAGE, language);
488} 500}
@@ -490,6 +502,7 @@ wl_text_input_set_preferred_language(struct wl_text_input *wl_text_input, const
490static inline void 502static inline void
491wl_text_input_commit_state(struct wl_text_input *wl_text_input, uint32_t serial) 503wl_text_input_commit_state(struct wl_text_input *wl_text_input, uint32_t serial)
492{ 504{
505 if (!wl_text_input) return;
493 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 506 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
494 WL_TEXT_INPUT_COMMIT_STATE, serial); 507 WL_TEXT_INPUT_COMMIT_STATE, serial);
495} 508}
@@ -497,6 +510,7 @@ wl_text_input_commit_state(struct wl_text_input *wl_text_input, uint32_t serial)
497static inline void 510static inline void
498wl_text_input_invoke_action(struct wl_text_input *wl_text_input, uint32_t button, uint32_t index) 511wl_text_input_invoke_action(struct wl_text_input *wl_text_input, uint32_t button, uint32_t index)
499{ 512{
513 if (!wl_text_input) return;
500 wl_proxy_marshal((struct wl_proxy *) wl_text_input, 514 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
501 WL_TEXT_INPUT_INVOKE_ACTION, button, index); 515 WL_TEXT_INPUT_INVOKE_ACTION, button, index);
502} 516}
@@ -506,18 +520,21 @@ wl_text_input_invoke_action(struct wl_text_input *wl_text_input, uint32_t button
506static inline void 520static inline void
507wl_text_input_manager_set_user_data(struct wl_text_input_manager *wl_text_input_manager, void *user_data) 521wl_text_input_manager_set_user_data(struct wl_text_input_manager *wl_text_input_manager, void *user_data)
508{ 522{
523 if (!wl_text_input_manager) return;
509 wl_proxy_set_user_data((struct wl_proxy *) wl_text_input_manager, user_data); 524 wl_proxy_set_user_data((struct wl_proxy *) wl_text_input_manager, user_data);
510} 525}
511 526
512static inline void * 527static inline void *
513wl_text_input_manager_get_user_data(struct wl_text_input_manager *wl_text_input_manager) 528wl_text_input_manager_get_user_data(struct wl_text_input_manager *wl_text_input_manager)
514{ 529{
530 if (!wl_text_input_manager) return NULL;
515 return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input_manager); 531 return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input_manager);
516} 532}
517 533
518static inline void 534static inline void
519wl_text_input_manager_destroy(struct wl_text_input_manager *wl_text_input_manager) 535wl_text_input_manager_destroy(struct wl_text_input_manager *wl_text_input_manager)
520{ 536{
537 if (!wl_text_input_manager) return;
521 wl_proxy_destroy((struct wl_proxy *) wl_text_input_manager); 538 wl_proxy_destroy((struct wl_proxy *) wl_text_input_manager);
522} 539}
523 540
@@ -526,6 +543,8 @@ wl_text_input_manager_create_text_input(struct wl_text_input_manager *wl_text_in
526{ 543{
527 struct wl_proxy *id; 544 struct wl_proxy *id;
528 545
546 if (!wl_text_input_manager) return NULL;
547
529 id = wl_proxy_create((struct wl_proxy *) wl_text_input_manager, 548 id = wl_proxy_create((struct wl_proxy *) wl_text_input_manager,
530 &wl_text_input_interface); 549 &wl_text_input_interface);
531 if (!id) 550 if (!id)