summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-12 13:59:50 -0700
committerKeith Packard <keithp@keithp.com>2012-10-12 13:59:50 -0700
commit68308908afbd1f04b17056d2be408c89b3578c86 (patch)
treeafeb849572b1b4c22e56a9fa282de124951aa69f /src/core
parent175380a436efa35bbfae2ee5e29e12e9ef86fbde (diff)
altos: Parameterize altitude table access and initialization
This allows projects to store the altitude data in different representations or with different access modes. By default, altitude data is stored in meters, but the initializers include decimeter values so those can be used instead if desired. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ao_convert_pa.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/ao_convert_pa.c b/src/core/ao_convert_pa.c
index 1413681d..2793b77c 100644
--- a/src/core/ao_convert_pa.c
+++ b/src/core/ao_convert_pa.c
@@ -19,10 +19,18 @@
#include "ao.h"
#endif
-static const int32_t altitude_table[] = {
+#ifndef AO_CONST_ATTRIB
+#define AO_CONST_ATTRIB
+#endif
+
+static const alt_t altitude_table[] AO_CONST_ATTRIB = {
#include "altitude-pa.h"
};
+#ifndef FETCH_ALT
+#define FETCH_ALT(o) altitude_table[o]
+#endif
+
#define ALT_SCALE (1 << ALT_SHIFT)
#define ALT_MASK (ALT_SCALE - 1)