]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
"comparison between signed and unsigned" warnings fixed
authorsopwith <sopwith>
Tue, 19 Aug 1997 02:53:35 +0000 (02:53 +0000)
committersopwith <sopwith>
Tue, 19 Aug 1997 02:53:35 +0000 (02:53 +0000)
checkbox.c
dialogboxes.c
entry.c
listbox.c
test.c

index ca5db93a5622bf48a212d3497255c97eba4f32ca..2f8329872cc66e9943fcdb34f693f0b70cf0ccfd 100644 (file)
@@ -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;
 }
 
index 55a59b2ac63914d49d6e02d865d281e22a0d1f06..a2407765434237466429d055eabfa57522377317 100644 (file)
@@ -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 a593be6a5ad52557918bf6c4a5f9e26a032e6bca..4549f5941acaa65ee42ec4ce3b71ee742febf0e3 100644 (file)
--- 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);
index 272fc3ea639ac7b04409ee8304708598ce2ba192..026803bbed217490c587e999741156425f2b200d 100644 (file)
--- 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 4ff32e5234fb5a8fc5729fa241f9f47ef2204d77..7ac3524b83aec3eb2ba249f5a2b84e93db523696 100644 (file)
--- 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;
 }