mirror of
https://github.com/boostorg/sort.git
synced 2026-07-21 13:33:28 +00:00
Fix overflow issue with signed subtraction in float_sort
Also fix a problem with windows running tune.pl
This commit is contained in:
@@ -410,7 +410,7 @@ namespace spreadsort {
|
||||
max, min))
|
||||
return;
|
||||
unsigned log_divisor = get_log_divisor<float_log_mean_bin_size>(
|
||||
last - first, rough_log_2_size(Size_type(max - min)));
|
||||
last - first, rough_log_2_size(Size_type(max/2 - min/2)) + 1);
|
||||
Div_type div_min = min >> log_divisor;
|
||||
Div_type div_max = max >> log_divisor;
|
||||
unsigned bin_count = unsigned(div_max - div_min) + 1;
|
||||
@@ -507,7 +507,7 @@ namespace spreadsort {
|
||||
if (is_sorted_or_find_extremes(first, last, max, min, rshift))
|
||||
return;
|
||||
unsigned log_divisor = get_log_divisor<float_log_mean_bin_size>(
|
||||
last - first, rough_log_2_size(Size_type(max - min)));
|
||||
last - first, rough_log_2_size(Size_type(max/2 - min/2)) + 1);
|
||||
Div_type div_min = min >> log_divisor;
|
||||
Div_type div_max = max >> log_divisor;
|
||||
unsigned bin_count = unsigned(div_max - div_min) + 1;
|
||||
@@ -605,7 +605,7 @@ namespace spreadsort {
|
||||
if (is_sorted_or_find_extremes(first, last, max, min, rshift, comp))
|
||||
return;
|
||||
unsigned log_divisor = get_log_divisor<float_log_mean_bin_size>(
|
||||
last - first, rough_log_2_size(Size_type(max - min)));
|
||||
last - first, rough_log_2_size(Size_type(max/2 - min/2)) + 1);
|
||||
Div_type div_min = min >> log_divisor;
|
||||
Div_type div_max = max >> log_divisor;
|
||||
unsigned bin_count = unsigned(div_max - div_min) + 1;
|
||||
|
||||
Reference in New Issue
Block a user