diff options
-rw-r--r-- | widget_gpo.c | 14 | ||||
-rw-r--r-- | widget_keypad.c | 24 |
2 files changed, 16 insertions, 22 deletions
diff --git a/widget_gpo.c b/widget_gpo.c index 3ac7a4e..2b8ed98 100644 --- a/widget_gpo.c +++ b/widget_gpo.c @@ -106,14 +106,12 @@ int widget_gpo_init(WIDGET * Self) int widget_gpo_quit(WIDGET * Self) { - if (Self) { - if (Self->data) { - WIDGET_GPO *GPO = Self->data; - property_free(&GPO->expression); - property_free(&GPO->update); - free(Self->data); - Self->data = NULL; - } + if (Self && Self->data) { + WIDGET_GPO *GPO = Self->data; + property_free(&GPO->expression); + property_free(&GPO->update); + free(Self->data); + Self->data = NULL; } return 0; } diff --git a/widget_keypad.c b/widget_keypad.c index 6714091..687630d 100644 --- a/widget_keypad.c +++ b/widget_keypad.c @@ -110,14 +110,12 @@ int widget_keypad_init(WIDGET * Self) int widget_keypad_find(WIDGET * Self, void *needle) { WIDGET_KEYPAD *keypad; - unsigned int *n = needle; - - if (Self) { - if (Self->data) { - keypad = Self->data; - if (keypad->key == *n) - return 0; - } + KEYPADKEY key = *(KEYPADKEY *) needle; + + if (Self && Self->data) { + keypad = Self->data; + if (keypad->key == key) + return 0; } return -1; @@ -125,12 +123,10 @@ int widget_keypad_find(WIDGET * Self, void *needle) int widget_keypad_quit(WIDGET * Self) { - if (Self) { - if (Self->data) { - WIDGET_KEYPAD *keypad = Self->data; - property_free(&keypad->expression); - free(Self->data); - } + if (Self && Self->data) { + WIDGET_KEYPAD *keypad = Self->data; + property_free(&keypad->expression); + free(Self->data); Self->data = NULL; } return 0; |