summaryrefslogtreecommitdiff
path: root/src/core/ao_convert_pa.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-12-16 16:06:41 -0800
committerKeith Packard <keithp@keithp.com>2012-12-16 16:06:41 -0800
commit8bcf3a88a78cd9d69da413d0d18233e8a532a10c (patch)
tree803ddf3c79fe31e53f46a01b82be15e52866052d /src/core/ao_convert_pa.c
parent22a58b0f9b82ea8c7abeda79ca7a4cd21c3dc93c (diff)
parent00bc1a090a294e103370b8ab0a0fe5d7a2acfe92 (diff)
Merge branch 'master' into hacking-cc1120aprs
Diffstat (limited to 'src/core/ao_convert_pa.c')
-rw-r--r--src/core/ao_convert_pa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/ao_convert_pa.c b/src/core/ao_convert_pa.c
index 55fe6e7d..fe6e0ef6 100644
--- a/src/core/ao_convert_pa.c
+++ b/src/core/ao_convert_pa.c
@@ -43,13 +43,13 @@ ao_pa_to_altitude(int32_t pa)
if (pa < 0)
pa = 0;
- if (pa > 120000)
- pa = 120000;
+ if (pa > 120000L)
+ pa = 120000L;
o = pa >> ALT_SHIFT;
part = pa & ALT_MASK;
- low = (alt_t) FETCH_ALT(o) * (ALT_SCALE - part);
- high = (alt_t) FETCH_ALT(o+1) * part + (ALT_SCALE >> 1);
+ low = (int32_t) FETCH_ALT(o) * (ALT_SCALE - part);
+ high = (int32_t) FETCH_ALT(o+1) * part + (ALT_SCALE >> 1);
return (low + high) >> ALT_SHIFT;
}