From: sopwith Date: Tue, 19 Aug 1997 02:53:35 +0000 (+0000) Subject: "comparison between signed and unsigned" warnings fixed X-Git-Tag: r0-12~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a880525e052eb5058d77dcdf9d03395b6e4e9d20;p=thirdparty%2Fnewt.git "comparison between signed and unsigned" warnings fixed --- diff --git a/checkbox.c b/checkbox.c index ca5db93..2f83298 100644 --- a/checkbox.c +++ b/checkbox.c @@ -60,7 +60,7 @@ void newtListitemSet(newtComponent co, char * text) { free(li->text); li->text = strdup(text); - if (strlen(text) + 4 > co->width) + if (strlen(text) + 4 > (unsigned int)co->width) co->width = strlen(text) + 4; } diff --git a/dialogboxes.c b/dialogboxes.c index 55a59b2..a240776 100644 --- a/dialogboxes.c +++ b/dialogboxes.c @@ -190,9 +190,9 @@ int listBox(char * text, int height, int width, poptContext optCon, } else itemInfo[numItems].text = ""; - if (strlen(itemInfo[numItems].text) > maxTextWidth) + if (strlen(itemInfo[numItems].text) > (unsigned int)maxTextWidth) maxTextWidth = strlen(itemInfo[numItems].text); - if (strlen(itemInfo[numItems].tag) > maxTagWidth) + if (strlen(itemInfo[numItems].tag) > (unsigned int)maxTagWidth) maxTagWidth = strlen(itemInfo[numItems].tag); numItems++; @@ -283,7 +283,7 @@ int checkList(char * text, int height, int width, poptContext optCon, else cbStates[numBoxes] = ' '; - if (strlen(cbInfo[numBoxes].tag) > maxWidth) + if (strlen(cbInfo[numBoxes].tag) > (unsigned int)maxWidth) maxWidth = strlen(cbInfo[numBoxes].tag); numBoxes++; diff --git a/entry.c b/entry.c index a593be6..4549f59 100644 --- a/entry.c +++ b/entry.c @@ -32,7 +32,7 @@ static struct componentOps entryOps = { void newtEntrySet(newtComponent co, char * value, int cursorAtEnd) { struct entry * en = co->data; - if ((strlen(value) + 1) > en->bufAlloced) { + if ((strlen(value) + 1) > (unsigned int)en->bufAlloced) { free(en->buf); en->bufAlloced = strlen(value) + 1; en->buf = malloc(en->bufAlloced); @@ -78,7 +78,7 @@ newtComponent newtEntry(int left, int top, char * initialValue, int width, else co->takesFocus = 0; - if (initialValue && strlen(initialValue) > width) { + if (initialValue && strlen(initialValue) > (unsigned int)width) { en->bufAlloced = strlen(initialValue) + 1; } en->buf = malloc(en->bufAlloced); diff --git a/listbox.c b/listbox.c index 272fc3e..026803b 100644 --- a/listbox.c +++ b/listbox.c @@ -327,7 +327,7 @@ int newtListboxInsertEntry(newtComponent co, char * text, void * data, int newtListboxDeleteEntry(newtComponent co, int num) { struct listbox * li = co->data; int i, widest = 0, t; - struct items *item, *item2; + struct items *item, *item2 = NULL; if(num > li->numItems) num = li->numItems; diff --git a/test.c b/test.c index 4ff32e5..7ac3524 100644 --- a/test.c +++ b/test.c @@ -28,7 +28,7 @@ void suspend(void) { newtResume(); } -void main(void) { +int main(void) { newtComponent b1, b2, r1, r2, r3, e2, e3, l1, l2, l3, scale; newtComponent lb, t, rsf, answer; newtComponent cs[10]; @@ -136,4 +136,6 @@ void main(void) { for(i = 0; i < numsel; i++) puts(selectedList[i]); } + + return 0; }