diff options
author | Martin Pool <mbp@samba.org> | 2002-01-25 23:07:33 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2002-01-25 23:07:33 +0000 |
commit | a261989cda6f671352e6323f11d2d98e923c622e (patch) | |
tree | b53a6d9d6b0cc12baab44a7e74395e9808266b40 | |
parent | 7b5c3eb05efb0d67348c92d81da599c64e0c03db (diff) | |
download | rsync-a261989cda6f671352e6323f11d2d98e923c622e.tar.gz |
More signedness fixes; should be harmless.
-rw-r--r-- | fileio.c | 10 | ||||
-rw-r--r-- | flist.c | 2 | ||||
-rw-r--r-- | match.c | 6 | ||||
-rw-r--r-- | receiver.c | 4 | ||||
-rw-r--r-- | sender.c | 4 | ||||
-rw-r--r-- | util.c | 2 |
6 files changed, 15 insertions, 13 deletions
@@ -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<len && buf[l1]==0;l1++) ; @@ -56,10 +57,11 @@ static int write_sparse(int f,char *buf,size_t len) if (l1 == len) return len; - if ((ret=write(f,buf+l1,len-(l1+l2))) != len-(l1+l2)) { - if (ret == -1 || ret == 0) return ret; + ret = write(f, buf + l1, len - (l1+l2)); + if (ret == -1 || ret == 0) + return ret; + else if (ret != (int) (len - (l1+l2))) return (l1+ret); - } if (l2 > 0) do_lseek(f,l2,SEEK_CUR); @@ -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 */ @@ -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;i<s->count;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 (; j<s->count && 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++; j<s->count && 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; @@ -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); @@ -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;i<s->count;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; @@ -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<globbuf.gl_pathc;i++) { + for (i=0; i<(maxargs - (*argc)) && i < (int) globbuf.gl_pathc;i++) { if (i == 0) free(argv[*argc]); argv[(*argc) + i] = strdup(globbuf.gl_pathv[i]); if (!argv[(*argc) + i]) out_of_memory("glob_expand"); |