Commit a261989c authored by Martin Pool's avatar Martin Pool

More signedness fixes; should be harmless.

parent 7b5c3eb0
/*
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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment