From d227c223798b273688ebc84f7b0fae4701ea8752 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 10 Mar 2014 01:11:01 +0900 Subject: [PATCH] change native_stack marker type to char * --- include/picrin.h | 2 +- include/picrin/cont.h | 2 +- src/cont.c | 8 ++++---- src/state.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/picrin.h b/include/picrin.h index 5ef6b53b..22069652 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -121,7 +121,7 @@ typedef struct { struct pic_object *arena[PIC_ARENA_SIZE]; int arena_idx; - pic_value *native_stack_start; + char *native_stack_start; } pic_state; typedef pic_value (*pic_func_t)(pic_state *); diff --git a/include/picrin/cont.h b/include/picrin/cont.h index 3e7b0360..67c86f6c 100644 --- a/include/picrin/cont.h +++ b/include/picrin/cont.h @@ -15,7 +15,7 @@ struct pic_cont { pic_block *blk; - pic_value *stk_pos, *stk_ptr; + char *stk_pos, *stk_ptr; size_t stk_len; pic_value *st_ptr; diff --git a/src/cont.c b/src/cont.c index 12b96d56..e9659423 100644 --- a/src/cont.c +++ b/src/cont.c @@ -78,9 +78,9 @@ static void save_cont(pic_state *, struct pic_cont **); static void restore_cont(pic_state *, struct pic_cont *); static size_t -native_stack_length(pic_state *pic, pic_value **pos) +native_stack_length(pic_state *pic, char **pos) { - pic_value t; + char t; *pos = (pic->native_stack_start > &t) ? &t @@ -95,7 +95,7 @@ static void save_cont(pic_state *pic, struct pic_cont **c) { struct pic_cont *cont; - pic_value *pos; + char *pos; cont = *c = (struct pic_cont *)pic_obj_alloc(pic, sizeof(struct pic_cont), PIC_TT_CONT); @@ -142,7 +142,7 @@ native_stack_extend(pic_state *pic, struct pic_cont *cont) NORETURN static void restore_cont(pic_state *pic, struct pic_cont *cont) { - pic_value v; + char v; struct pic_cont *tmp = cont; if (&v < pic->native_stack_start) { diff --git a/src/state.c b/src/state.c index 428b6229..a8064649 100644 --- a/src/state.c +++ b/src/state.c @@ -15,7 +15,7 @@ void pic_init_core(pic_state *); pic_state * pic_open(int argc, char *argv[], char **envp) { - pic_value t; + char t; pic_state *pic; int ai;