* growing larger than a "rename_limit" square matrix, ie:
*
* num_create * num_src > rename_limit * rename_limit
- *
- * but handles the potential overflow case specially (and we
- * assume at least 32-bit integers)
*/
- if (rename_limit <= 0 || rename_limit > 32767)
+ if (rename_limit <= 0)
rename_limit = 32767;
if ((num_create <= rename_limit || num_src <= rename_limit) &&
- (num_create * num_src <= rename_limit * rename_limit))
+ ((uint64_t)num_create * (uint64_t)num_src
+ <= (uint64_t)rename_limit * (uint64_t)rename_limit))
return 0;
options->needed_rename_limit =
num_src++;
}
if ((num_create <= rename_limit || num_src <= rename_limit) &&
- (num_create * num_src <= rename_limit * rename_limit))
+ ((uint64_t)num_create * (uint64_t)num_src
+ <= (uint64_t)rename_limit * (uint64_t)rename_limit))
return 2;
return 1;
}
if (options->show_rename_progress) {
progress = start_delayed_progress(
_("Performing inexact rename detection"),
- rename_dst_nr * rename_src_nr);
+ (uint64_t)rename_dst_nr * (uint64_t)rename_src_nr);
}
mx = xcalloc(st_mult(NUM_CANDIDATE_PER_DST, num_create), sizeof(*mx));
diff_free_filespec_blob(two);
}
dst_cnt++;
- display_progress(progress, (i+1)*rename_src_nr);
+ display_progress(progress, (uint64_t)(i+1)*(uint64_t)rename_src_nr);
}
stop_progress(&progress);