From: Miroslav Lichvar Date: Wed, 30 Jul 2008 13:28:35 +0000 (+0200) Subject: fix compiler warnings X-Git-Tag: r0-52-11~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbe50e6606fc9dac720a096e3985cef20ca118dd;p=thirdparty%2Fnewt.git fix compiler warnings --- diff --git a/checkboxtree.c b/checkboxtree.c index 0d74ba7..8d6e64a 100644 --- a/checkboxtree.c +++ b/checkboxtree.c @@ -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; }