diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-16 14:12:59 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-11-17 22:18:39 -0800 |
commit | 2b44fb5002c3e498ba66b60d763c2ac3fef3283e (patch) | |
tree | 650e22b3d9ed77549de88a3859f85b21a3075fa0 /src/lisp/ao_lisp_mem.c | |
parent | d68d89a2b8d2c1ebde355171f99e5205dbd0ea43 (diff) |
altos/lisp: Eliminate compiler warning about array bounds at -O3
Using ao_lisp_pool - 4 caused the compiler to whinge about computing
an address outside the bounds of the array. Sigh. Restructure the code
to do the adjustment-by-4 in the integer computations instead of the
pointer ones.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_mem.c')
-rw-r--r-- | src/lisp/ao_lisp_mem.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/lisp/ao_lisp_mem.c b/src/lisp/ao_lisp_mem.c index 53ebf757..12a5ba55 100644 --- a/src/lisp/ao_lisp_mem.c +++ b/src/lisp/ao_lisp_mem.c @@ -252,23 +252,6 @@ static inline uint16_t pool_offset(void *addr) { return ((uint8_t *) addr) - ao_lisp_pool; } -/* - * Convert back and forth between 'poly's used - * as short addresses in the pool and addresses. - * These are used in the chunk code. - */ -static inline ao_poly pool_poly(void *addr) { -#if DBG_MEM - if (!AO_LISP_IS_POOL(addr)) - ao_lisp_abort(); -#endif - return ((uint8_t *) addr) - AO_LISP_POOL_BASE; -} - -static inline void *pool_ref(ao_poly p) { - return AO_LISP_POOL_BASE + p; -} - static inline void mark(uint8_t *tag, int offset) { int byte = offset >> 5; int bit = (offset >> 2) & 7; |