From cec9715ba23b405c72adad777adb202923991d79 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Wed, 11 Jan 2023 23:09:56 +0000 Subject: [PATCH] Silence sign-compare warnings in lists.c --- src/lists.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lists.c b/src/lists.c index cab88364..c475736a 100644 --- a/src/lists.c +++ b/src/lists.c @@ -795,7 +795,7 @@ lget ( LISTID lid ) void * lget_n ( LISTID lid, unsigned int n ) { - int i; + unsigned int i; LIST * l; LISTNODE * ln; @@ -803,7 +803,7 @@ lget_n ( LISTID lid, unsigned int n ) CKLMAGIC(l); - if ((n<1)||(n>lsize(l))) { + if (n < 1 || n > (unsigned int) lsize(l)) { return NULL; } @@ -836,7 +836,7 @@ lget_n ( LISTID lid, unsigned int n ) LNODEID lget_ln ( LISTID lid, unsigned int n ) { - int i; + unsigned int i; LIST * l; LISTNODE * ln; @@ -844,7 +844,7 @@ lget_ln ( LISTID lid, unsigned int n ) CKLMAGIC(l); - if ((n<1)||(n>lsize(l))) { + if (n < 1 || n > (unsigned int) lsize(l)) { return NULL; } @@ -944,7 +944,7 @@ insert_ln ( LIST * l, LISTNODE * ln, void * data_ptr ) int lins_n ( LISTID lid, void * data_ptr, unsigned int n ) { - int i; + unsigned int i; LIST * l; LISTNODE * ln; @@ -952,7 +952,7 @@ lins_n ( LISTID lid, void * data_ptr, unsigned int n ) CKLMAGIC(l); - if ((n<1)||(n>(l->num+1))) { + if (n < 1 || n > (unsigned int) (l->num+1)) { return -1; } @@ -1185,7 +1185,7 @@ lrmv_ln ( LISTID lid, LNODEID lnid ) void * lrmv_n ( LISTID lid, unsigned int n ) { - int i; + unsigned int i; LIST * l; LISTNODE * ln; @@ -1193,7 +1193,7 @@ lrmv_n ( LISTID lid, unsigned int n ) CKLMAGIC(l); - if ((n<1)||(n>l->num)) { + if (n < 1 || n > (unsigned int) l->num) { return NULL; }