From a261989cda6f671352e6323f11d2d98e923c622e Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 25 Jan 2002 23:07:33 +0000 Subject: [PATCH] More signedness fixes; should be harmless. --- fileio.c | 10 ++++++---- flist.c | 2 +- match.c | 6 +++--- receiver.c | 4 ++-- sender.c | 4 ++-- util.c | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/fileio.c b/fileio.c index 3ed28036..92631bc7 100644 --- a/fileio.c +++ b/fileio.c @@ -1,5 +1,6 @@ /* Copyright (C) Andrew Tridgell 1998 + Copyright (C) 2002 by Martin Pool This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +39,7 @@ int sparse_end(int f) static int write_sparse(int f,char *buf,size_t len) { - int l1=0,l2=0; + size_t l1=0, l2=0; int ret; for (l1=0;l1 0) do_lseek(f,l2,SEEK_CUR); diff --git a/flist.c b/flist.c index ab729c80..96ed47f2 100644 --- a/flist.c +++ b/flist.c @@ -980,7 +980,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) } if (f != -1) { - io_end_buffering(f); + io_end_buffering(); stats.flist_size = stats.total_written - start_write; stats.num_files = flist->count; if (write_batch) /* dw */ diff --git a/match.c b/match.c index 7b0f6017..adc298e7 100644 --- a/match.c +++ b/match.c @@ -71,7 +71,7 @@ static void build_hash_table(struct sum_struct *s) if (!tag_table || !targets) out_of_memory("build_hash_table"); - for (i=0;icount;i++) { + for (i=0;i<(int) s->count;i++) { targets[i].i = i; targets[i].t = gettag(s->sums[i].sum1); } @@ -175,7 +175,7 @@ static void hash_search(int f,struct sum_struct *s, sum = (s1 & 0xffff) | (s2 << 16); tag_hits++; - for (; jcount && targets[j].t == t; j++) { + for (; j < (int) s->count && targets[j].t == t; j++) { int l, i = targets[j].i; if (sum != s->sums[i].sum1) continue; @@ -201,7 +201,7 @@ static void hash_search(int f,struct sum_struct *s, /* we've found a match, but now check to see if last_i can hint at a better match */ - for (j++; jcount && targets[j].t == t; j++) { + for (j++; j < (int) s->count && targets[j].t == t; j++) { int i2 = targets[j].i; if (i2 == last_i + 1) { if (sum != s->sums[i2].sum1) break; diff --git a/receiver.c b/receiver.c index 5776ff28..6b6b63a5 100644 --- a/receiver.c +++ b/receiver.c @@ -249,7 +249,7 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname, i = -(i+1); offset2 = i*(OFF_T)n; len = n; - if (i == count-1 && remainder != 0) + if (i == (int) count-1 && remainder != 0) len = remainder; stats.matched_data += len; @@ -265,7 +265,7 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname, sum_update(map,len); } - if (fd != -1 && write_file(fd,map,len) != len) { + if (fd != -1 && write_file(fd,map,len) != (int) len) { rprintf(FERROR,"write failed on %s : %s\n", fname,strerror(errno)); exit_cleanup(RERR_FILEIO); diff --git a/sender.c b/sender.c index d9fc5e6c..ca853ef5 100644 --- a/sender.c +++ b/sender.c @@ -55,14 +55,14 @@ static struct sum_struct *receive_sums(int f) s->sums = (struct sum_buf *)malloc(sizeof(s->sums[0])*s->count); if (!s->sums) out_of_memory("receive_sums"); - for (i=0;icount;i++) { + for (i=0; i < (int) s->count;i++) { s->sums[i].sum1 = read_int(f); read_buf(f,s->sums[i].sum2,csum_length); s->sums[i].offset = offset; s->sums[i].i = i; - if (i == s->count-1 && s->remainder != 0) { + if (i == (int) s->count-1 && s->remainder != 0) { s->sums[i].len = s->remainder; } else { s->sums[i].len = s->n; diff --git a/util.c b/util.c index f3c126bc..64473a30 100644 --- a/util.c +++ b/util.c @@ -559,7 +559,7 @@ static void glob_expand_one(char *s, char **argv, int *argc, int maxargs) globfree(&globbuf); return; } - for (i=0; i<(maxargs - (*argc)) && i