-CC=gcc -Wall -std=gnu99 -ggdb -Wno-unused-function
+CC=gcc -Werror -Wextra -Wall -Wno-unused-parameter -std=gnu99 -ggdb -Wno-unused-function
.PHONY: all clean
all: parsertest
block builtins_bind(block b) {
- for (int i=0; i<sizeof(bytecoded_builtins)/sizeof(bytecoded_builtins[0]); i++) {
+ for (unsigned i=0; i<sizeof(bytecoded_builtins)/sizeof(bytecoded_builtins[0]); i++) {
b = block_bind(bytecoded_builtins[i](), b, OP_IS_CALL_PSEUDO);
}
return gen_cbinding(&builtins, b);
int idx = jv_number_value(stack_pop().value);
stackval container = stack_pop();
- int is_array, keep_going;
+ int keep_going;
jv key, value;
if (jv_get_kind(container.value) == JV_KIND_ARRAY) {
- is_array = 1;
if (opcode == EACH) idx = 0;
else idx = idx + 1;
keep_going = idx < jv_array_length(jv_copy(container.value));
value = jv_array_get(jv_copy(container.value), idx);
}
} else if (jv_get_kind(container.value) == JV_KIND_OBJECT) {
- is_array = 0;
if (opcode == EACH) idx = jv_object_iter(container.value);
else idx = jv_object_iter_next(container.value, idx);
keep_going = jv_object_iter_valid(container.value, idx);
s->stk = 0;
}
-static void* forkable_stack_push(struct forkable_stack* s, size_t size) {
+static void* forkable_stack_push(struct forkable_stack* s, size_t sz_size) {
+ int size = (int)sz_size;
forkable_stack_check(s);
int curr = s->pos < s->savedlimit ? s->pos : s->savedlimit;
if (curr - size < 0) {
def print_table(type, name, t):
assert len(t) == 256
- print "const static",type, name+"[]", "="
+ print "static const",type, name+"[]", "="
first = True
for i in range(0,len(t),16):
print (" {" if i == 0 else " ") +\
}
static uint32_t jvp_string_remaining_space(jvp_string* s) {
+ assert(s->alloc_length >= jvp_string_length(s));
uint32_t r = s->alloc_length - jvp_string_length(s);
- assert(r >= 0);
return r;
}