summaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2013-05-05 22:37:46 +0100
committerStephen Dolan <mu@netsoc.tcd.ie>2013-05-05 22:59:53 +0100
commit47e015e9468ce109c0fb28562d2b768ba29d2de3 (patch)
treef83083835a0a12cf23731507f0b38a011271bb3d /compile.c
parentab1a97472c91a755c2138417db2fe977c263f536 (diff)
Make a few constant globals actually const.
This means the .data and .bss sections are empty, a good thing in a shared library (see #98).
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/compile.c b/compile.c
index b06e4f75..69044626 100644
--- a/compile.c
+++ b/compile.c
@@ -30,7 +30,7 @@ struct inst {
uint16_t intval;
struct inst* target;
jv constant;
- struct cfunction* cfunc;
+ const struct cfunction* cfunc;
} imm;
location source;
@@ -377,10 +377,10 @@ block gen_cond(block cond, block iftrue, block iffalse) {
BLOCK(gen_op_simple(POP), iffalse)));
}
-block gen_cbinding(struct symbol_table* t, block code) {
- for (int cfunc=0; cfunc<t->ncfunctions; cfunc++) {
+block gen_cbinding(const struct cfunction* cfunctions, int ncfunctions, block code) {
+ for (int cfunc=0; cfunc<ncfunctions; cfunc++) {
inst* i = inst_new(CLOSURE_CREATE_C);
- i->imm.cfunc = &t->cfunctions[cfunc];
+ i->imm.cfunc = &cfunctions[cfunc];
i->symbol = strdup(i->imm.cfunc->name);
code = block_bind(inst_block(i), code, OP_IS_CALL_PSEUDO);
}