Fix comparison between signed and unsigned integer compiler warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/src/heapsort.c b/src/heapsort.c
index 2479cb0..7e345c7 100644
--- a/src/heapsort.c
+++ b/src/heapsort.c
@@ -135,7 +135,7 @@ heapsort(vbase, nmemb, size, compar)
size_t nmemb, size;
int (*compar)(const void *, const void *);
{
- int cnt, i, j, l;
+ size_t cnt, i, j, l;
char tmp, *tmp1, *tmp2;
char *base, *k, *p, *t;
diff --git a/src/nlist.c b/src/nlist.c
index 7f9ed96..6c9be51 100644
--- a/src/nlist.c
+++ b/src/nlist.c
@@ -100,7 +100,8 @@ __fdnlist(fd, list)
int fd;
struct nlist *list;
{
- int n = -1, i;
+ size_t i;
+ int n = -1;
for (i = 0; i < sizeof(nlist_fn) / sizeof(nlist_fn[0]); i++) {
n = (nlist_fn[i].fn)(fd, list);
diff --git a/src/radixsort.c b/src/radixsort.c
index 45e2477..b9746fc 100644
--- a/src/radixsort.c
+++ b/src/radixsort.c
@@ -175,7 +175,7 @@ r_sort_a(const u_char **a, int n, int i, const u_char *tr, u_int endch)
* character at position i, move on to the next
* character.
*/
- if (nc == 1 && count[bmin] == n) {
+ if (nc == 1 && count[bmin] == (u_int)n) {
push(a, n, i+1);
nc = count[bmin] = 0;
continue;