]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix compiler warnings
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 30 Jul 2008 13:28:35 +0000 (15:28 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 30 Jul 2008 13:28:35 +0000 (15:28 +0200)
checkboxtree.c

index 0d74ba75a1d8107e0d48e85e858d59d22f16734f..8d6e64a1776434298127e39e32e848571c3df7fa 100644 (file)
@@ -63,10 +63,10 @@ static int countItems(struct items * item, int what) {
     int count = 0;
 
     while (item) {
-       if (what < 0 || !item->branch && (what > 0 && item->selected == what
-                   || what == 0 && item->selected))
+       if (what < 0 || (!item->branch && ((what > 0 && item->selected == what)
+                   || (what == 0 && item->selected))))
            count++;
-       if (item->branch && (what >= 0 || what < 0 && item->selected))
+       if (item->branch && (what >= 0 || (what < 0 && item->selected)))
            count += countItems(item->branch, what);
        item = item->next;
     }
@@ -718,11 +718,12 @@ struct eventResult ctEvent(newtComponent co, struct event ev) {
 const void * newtCheckboxTreeGetCurrent(newtComponent co) {
     struct CheckboxTree * ct = co->data;
 
-    if (!ct->currItem)
+    if (!ct->currItem) {
        if (ct->itemlist)
            return ct->itemlist->data;
        else
            return NULL;
+    }
 
     return (*ct->currItem)->data;
 }