projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Don't store computed telemetry fields
[fw/altos]
/
src
/
lisp
/
ao_lisp_poly.c
diff --git
a/src/lisp/ao_lisp_poly.c
b/src/lisp/ao_lisp_poly.c
index 9717fd73131b30712bf7a033f874417b8016034c..fb3b06fe8f2d90c00f4ae1589b61acb5fc71d078 100644
(file)
--- a/
src/lisp/ao_lisp_poly.c
+++ b/
src/lisp/ao_lisp_poly.c
@@
-14,12
+14,6
@@
#include "ao_lisp.h"
#include "ao_lisp.h"
-#if 0
-#define DBG(...) printf (__VA_ARGS__)
-#else
-#define DBG(...)
-#endif
-
struct ao_lisp_funcs {
void (*print)(ao_poly);
void (*patom)(ao_poly);
struct ao_lisp_funcs {
void (*print)(ao_poly);
void (*patom)(ao_poly);
@@
-54,6
+48,10
@@
static const struct ao_lisp_funcs ao_lisp_funcs[AO_LISP_NUM_TYPE] = {
.print = ao_lisp_lambda_print,
.patom = ao_lisp_lambda_print,
},
.print = ao_lisp_lambda_print,
.patom = ao_lisp_lambda_print,
},
+ [AO_LISP_STACK] = {
+ .print = ao_lisp_stack_print,
+ .patom = ao_lisp_stack_print,
+ },
};
static const struct ao_lisp_funcs *
};
static const struct ao_lisp_funcs *
@@
-89,8
+87,8
@@
ao_lisp_ref(ao_poly poly) {
if (poly == AO_LISP_NIL)
return NULL;
if (poly & AO_LISP_CONST)
if (poly == AO_LISP_NIL)
return NULL;
if (poly & AO_LISP_CONST)
- return (void *) (
AO_LISP_CONST_BASE + (poly & AO_LISP_REF_MASK)
);
- return (void *) (
AO_LISP_POOL_BASE + (poly & AO_LISP_REF_MASK)
);
+ return (void *) (
ao_lisp_const + (poly & AO_LISP_REF_MASK) - 4
);
+ return (void *) (
ao_lisp_pool + (poly & AO_LISP_REF_MASK) - 4
);
}
ao_poly
}
ao_poly
@@
-99,6
+97,6
@@
ao_lisp_poly(const void *addr, ao_poly type) {
if (a == NULL)
return AO_LISP_NIL;
if (AO_LISP_IS_CONST(a))
if (a == NULL)
return AO_LISP_NIL;
if (AO_LISP_IS_CONST(a))
- return AO_LISP_CONST | (a -
AO_LISP_CONST_BASE
) | type;
- return (a -
AO_LISP_POOL_BASE
) | type;
+ return AO_LISP_CONST | (a -
ao_lisp_const + 4
) | type;
+ return (a -
ao_lisp_pool + 4
) | type;
}
}