diff --git a/include/picrin.h b/include/picrin.h index 6f8dbb94..5ef6b53b 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -68,18 +68,18 @@ typedef struct { struct pic_env *env; } pic_callinfo; -struct pic_block { +typedef struct pic_block { struct pic_block *prev; int depth; struct pic_proc *in, *out; unsigned refcnt; -}; +} pic_block; typedef struct { int argc; char **argv, **envp; - struct pic_block *blk; + pic_block *blk; pic_value *sp; pic_value *stbase, *stend; diff --git a/include/picrin/cont.h b/include/picrin/cont.h index dd43607b..3e7b0360 100644 --- a/include/picrin/cont.h +++ b/include/picrin/cont.h @@ -13,7 +13,7 @@ struct pic_cont { PIC_OBJECT_HEADER jmp_buf jmp; - struct pic_block *blk; + pic_block *blk; pic_value *stk_pos, *stk_ptr; size_t stk_len; @@ -40,7 +40,7 @@ struct pic_cont { } while (0) #define PIC_BLK_DECREF(pic,blk) do { \ - struct pic_block *_a = (blk), *_b; \ + pic_block *_a = (blk), *_b; \ while (_a) { \ if (! --_a->refcnt) { \ _b = _a->prev; \ diff --git a/src/cont.c b/src/cont.c index 88bf3a7b..12b96d56 100644 --- a/src/cont.c +++ b/src/cont.c @@ -182,7 +182,7 @@ restore_cont(pic_state *pic, struct pic_cont *cont) } static void -walk_to_block(pic_state *pic, struct pic_block *here, struct pic_block *there) +walk_to_block(pic_state *pic, pic_block *here, pic_block *there) { if (here == there) return; @@ -282,10 +282,10 @@ pic_cont_dynamic_wind(pic_state *pic) /* enter */ pic_apply_argv(pic, in, 0); { - struct pic_block *here; + pic_block *here; here = pic->blk; - pic->blk = (struct pic_block *)pic_alloc(pic, sizeof(struct pic_block)); + pic->blk = (pic_block *)pic_alloc(pic, sizeof(pic_block)); pic->blk->prev = here; pic->blk->depth = here->depth + 1; pic->blk->in = in; diff --git a/src/gc.c b/src/gc.c index 1cce8404..ec830474 100644 --- a/src/gc.c +++ b/src/gc.c @@ -318,7 +318,7 @@ static void gc_mark(pic_state *, pic_value); static void gc_mark_object(pic_state *pic, struct pic_object *obj); static void -gc_mark_block(pic_state *pic, struct pic_block *blk) +gc_mark_block(pic_state *pic, pic_block *blk) { while (blk) { if (blk->in) diff --git a/src/state.c b/src/state.c index 7c468306..428b6229 100644 --- a/src/state.c +++ b/src/state.c @@ -28,7 +28,7 @@ pic_open(int argc, char *argv[], char **envp) pic->envp = envp; /* root block */ - pic->blk = (struct pic_block *)malloc(sizeof(struct pic_block)); + pic->blk = (pic_block *)malloc(sizeof(pic_block)); pic->blk->prev = NULL; pic->blk->depth = 0; pic->blk->in = pic->blk->out = NULL; diff --git a/src/system.c b/src/system.c index afe4301a..2591fa20 100644 --- a/src/system.c +++ b/src/system.c @@ -31,7 +31,7 @@ pic_system_exit(pic_state *pic) { pic_value v; int argc, status = EXIT_SUCCESS; - struct pic_block *blk; + pic_block *blk; argc = pic_get_args(pic, "|o", &v); if (argc == 1) {