Made the types used in the sum_buf and sum_struct structures consistent
[rsync/rsync.git] / match.c
diff --git a/match.c b/match.c
index 926aad6..1c7794a 100644 (file)
--- a/match.c
+++ b/match.c
@@ -62,9 +62,9 @@ static void build_hash_table(struct sum_struct *s)
        int i;
 
        if (!tag_table)
-               tag_table = (int *)malloc(sizeof(tag_table[0])*TABLESIZE);
+               tag_table = new_array(int, TABLESIZE);
 
-       targets = (struct target *)malloc(sizeof(targets[0])*s->count);
+       targets = new_array(struct target, s->count);
        if (!tag_table || !targets)
                out_of_memory("build_hash_table");
 
@@ -105,7 +105,7 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf,
        OFF_T j;
 
        if (verbose > 2 && i >= 0)
-               rprintf(FINFO,"match at %.0f last_match=%.0f j=%d len=%d n=%.0f\n",
+               rprintf(FINFO,"match at %.0f last_match=%.0f j=%d len=%u n=%.0f\n",
                        (double)offset,(double)last_match,i,s->sums[i].len,(double)n);
 
        send_token(f,i,buf,last_match,n,i<0?0:s->sums[i].len);
@@ -136,7 +136,7 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf,
 
 
 static void hash_search(int f,struct sum_struct *s,
-                       struct map_struct *buf,OFF_T len)
+                       struct map_struct *buf, OFF_T len)
 {
        OFF_T offset, end;
        int j,k, last_i;
@@ -185,7 +185,8 @@ static void hash_search(int f,struct sum_struct *s,
                sum = (s1 & 0xffff) | (s2 << 16);
                tag_hits++;
                for (; j < (int) s->count && targets[j].t == t; j++) {
-                       int l, i = targets[j].i;
+                       unsigned int l;
+                       int i = targets[j].i;
 
                        if (sum != s->sums[i].sum1) continue;
 
@@ -284,7 +285,7 @@ static void hash_search(int f,struct sum_struct *s,
 void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
 {
        char file_sum[MD4_SUM_LENGTH];
-       extern int write_batch;  /*  dw */
+       extern int write_batch;
 
        last_match = 0;
        false_alarms = 0;
@@ -319,7 +320,7 @@ void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
        if (verbose > 2)
                rprintf(FINFO,"sending file_sum\n");
        write_buf(f,file_sum,MD4_SUM_LENGTH);
-       if (write_batch) /* dw */
+       if (write_batch)
                write_batch_delta_file(file_sum, MD4_SUM_LENGTH);
 
        if (targets) {