diff options
author | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2007-01-20 14:05:38 +0000 |
---|---|---|
committer | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2007-01-20 14:05:38 +0000 |
commit | ebab52f8e03782cf34b9c5e89c1591b66572dff9 (patch) | |
tree | f5f6272ef32781ad78a14887c7540a32b19b26fe | |
parent | 812fa726f6b3f9f473e60d29d23eaabbf741d3cc (diff) | |
download | lcd4linux-ebab52f8e03782cf34b9c5e89c1591b66572dff9.tar.gz |
keypad widget cleanup
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@752 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-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; |