X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_distance.c;h=481a53c11c5bbdc14b8392895d221d90d7204368;hb=HEAD;hp=5654182aa733e71a4005090e86c352974f2abe7a;hpb=d7df6e8c47df35c0d27f1a2559ecc305ef28d271;p=fw%2Faltos diff --git a/src/kernel/ao_distance.c b/src/kernel/ao_distance.c index 5654182a..d85f20f2 100644 --- a/src/kernel/ao_distance.c +++ b/src/kernel/ao_distance.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -100,7 +101,7 @@ ao_lon_dist(int32_t lon_a, int32_t lon_b) /* check if it's shorter to go the other way around */ if ((lon_a >> 1) < (lon_b >> 1) - (1800000000 >> 1)) - lon_a += 3600000000; + lon_a = (int32_t) ((uint32_t) lon_a + 3600000000UL); lon_dist = ao_dist(lon_a, lon_b); if (c) { if (lon_dist & 0x7f800000)