Silence sign-compare warnings in lists.c

This commit is contained in:
Stefan Rueger 2023-01-11 23:09:56 +00:00
parent 7f0fe41b6c
commit cec9715ba2
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
1 changed files with 8 additions and 8 deletions

View File

@ -795,7 +795,7 @@ lget ( LISTID lid )
void * void *
lget_n ( LISTID lid, unsigned int n ) lget_n ( LISTID lid, unsigned int n )
{ {
int i; unsigned int i;
LIST * l; LIST * l;
LISTNODE * ln; LISTNODE * ln;
@ -803,7 +803,7 @@ lget_n ( LISTID lid, unsigned int n )
CKLMAGIC(l); CKLMAGIC(l);
if ((n<1)||(n>lsize(l))) { if (n < 1 || n > (unsigned int) lsize(l)) {
return NULL; return NULL;
} }
@ -836,7 +836,7 @@ lget_n ( LISTID lid, unsigned int n )
LNODEID LNODEID
lget_ln ( LISTID lid, unsigned int n ) lget_ln ( LISTID lid, unsigned int n )
{ {
int i; unsigned int i;
LIST * l; LIST * l;
LISTNODE * ln; LISTNODE * ln;
@ -844,7 +844,7 @@ lget_ln ( LISTID lid, unsigned int n )
CKLMAGIC(l); CKLMAGIC(l);
if ((n<1)||(n>lsize(l))) { if (n < 1 || n > (unsigned int) lsize(l)) {
return NULL; return NULL;
} }
@ -944,7 +944,7 @@ insert_ln ( LIST * l, LISTNODE * ln, void * data_ptr )
int int
lins_n ( LISTID lid, void * data_ptr, unsigned int n ) lins_n ( LISTID lid, void * data_ptr, unsigned int n )
{ {
int i; unsigned int i;
LIST * l; LIST * l;
LISTNODE * ln; LISTNODE * ln;
@ -952,7 +952,7 @@ lins_n ( LISTID lid, void * data_ptr, unsigned int n )
CKLMAGIC(l); CKLMAGIC(l);
if ((n<1)||(n>(l->num+1))) { if (n < 1 || n > (unsigned int) (l->num+1)) {
return -1; return -1;
} }
@ -1185,7 +1185,7 @@ lrmv_ln ( LISTID lid, LNODEID lnid )
void * void *
lrmv_n ( LISTID lid, unsigned int n ) lrmv_n ( LISTID lid, unsigned int n )
{ {
int i; unsigned int i;
LIST * l; LIST * l;
LISTNODE * ln; LISTNODE * ln;
@ -1193,7 +1193,7 @@ lrmv_n ( LISTID lid, unsigned int n )
CKLMAGIC(l); CKLMAGIC(l);
if ((n<1)||(n>l->num)) { if (n < 1 || n > (unsigned int) l->num) {
return NULL; return NULL;
} }