Need to shift everyone right one bit to fit in 32 bits
Signed-off-by: Keith Packard <keithp@keithp.com>
int32_t d = a - b;
if (d < 0)
d = -d;
int32_t d = a - b;
if (d < 0)
d = -d;
return (uint32_t) ((int64_t) d * 111198 / 10000000);
}
return (uint32_t) ((int64_t) d * 111198 / 10000000);
}
uint32_t lon_dist;
/* check if it's shorter to go the other way around */
uint32_t lon_dist;
/* check if it's shorter to go the other way around */
- if (lon_a < lon_b - 1800000000)
+ if ((lon_a >> 1) < (lon_b >> 1) - (1800000000 >> 1))
lon_a += 3600000000;
lon_dist = ao_dist(lon_a, lon_b);
if (c) {
lon_a += 3600000000;
lon_dist = ao_dist(lon_a, lon_b);
if (c) {