Changed most instances of "remote_version" to "protocol_version", and
[rsync/rsync.git] / generator.c
index aca5f7b..0a20fac 100644 (file)
@@ -36,7 +36,7 @@ extern int csum_length;
 extern int ignore_times;
 extern int size_only;
 extern int io_timeout;
-extern int remote_version;
+extern int protocol_version;
 extern int always_checksum;
 extern int modify_window;
 extern char *compare_dest;
@@ -80,7 +80,7 @@ static int skip_file(char *fname,
                        }
                }
                file_checksum(fname,sum,st->st_size);
-               if (remote_version < 21) {
+               if (protocol_version < 21) {
                        return (memcmp(sum,file->sum,2) == 0);
                } else {
                        return (memcmp(sum,file->sum,MD4_SUM_LENGTH) == 0);
@@ -112,7 +112,7 @@ void write_sum_head(int f, struct sum_struct *sum)
 
        write_int(f, sum->count);
        write_int(f, sum->blength);
-       if (remote_version >= 27)
+       if (protocol_version >= 27)
                write_int(f, sum->s2length);
        write_int(f, sum->remainder);
 }
@@ -155,14 +155,14 @@ static void sum_sizes_sqroot_baarda(struct sum_struct *sum, uint64 len)
                blength = 0;
                do {
                        blength |= c;
-                       if (len < (uint64)(blength * blength))
+                       if (len < (uint64)blength * blength)
                                blength &= ~c;
                        c >>= 1;
                } while (c >= 8);       /* round to multiple of 8 */
                blength = MAX(blength, BLOCK_SIZE);
        }
 
-       if (remote_version < 27) {
+       if (protocol_version < 27) {
                s2length = csum_length;
        } else if (csum_length == SUM_LENGTH) {
                s2length = SUM_LENGTH;
@@ -247,8 +247,8 @@ static void generate_and_send_sums(struct map_struct *buf, OFF_T len, int f_out)
 
                if (verbose > 3) {
                        rprintf(FINFO,
-                               "chunk[%d] offset=%.0f len=%d sum1=%08lx\n",
-                               i, (double) offset, n1, (unsigned long) sum1);
+                               "chunk[%ld] offset=%.0f len=%d sum1=%08lx\n",
+                               (long)i,(double)offset,n1,(unsigned long)sum1);
                }
                write_int(f_out, sum1);
                write_buf(f_out, sum2, sum.s2length);
@@ -383,7 +383,7 @@ void recv_generator(char *fname, struct file_list *flist, int i, int f_out)
        if (am_root && preserve_devices && IS_DEVICE(file->mode)) {
                if (statret != 0 ||
                    st.st_mode != file->mode ||
-                   st.st_rdev != file->rdev) {
+                   (DEV64_T)st.st_rdev != file->rdev) {
                        delete_file(fname);
                        if (verbose > 2)
                                rprintf(FINFO,"mknod(%s,0%o,0x%x)\n",