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");
rprintf(FINFO,"hash search b=%ld len=%.0f\n",
(long) s->blength, (double)len);
- /* cast is to make s->blength signed; it should always be reasonably
- * small */
- k = MIN(len, (OFF_T) s->blength);
+ k = MIN(len, (OFF_T)s->blength);
map = (schar *)map_ptr(buf,0,k);
if (sum != s->sums[i].sum1) continue;
/* also make sure the two blocks are the same length */
- l = MIN(s->blength,len-offset);
+ l = MIN((OFF_T)s->blength, len-offset);
if (l != s->sums[i].len) continue;
if (verbose > 3)
matched(f,s,buf,offset,i);
offset += s->sums[i].len - 1;
- k = MIN((len-offset), s->blength);
+ k = MIN((OFF_T)s->blength, len-offset);
map = (schar *)map_ptr(buf,offset,k);
sum = get_checksum1((char *)map, k);
s1 = sum & 0xFFFF;
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;
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) {