From e93536bf9a18c279c5b9ca70b952f845a33e6281 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 23 Feb 2016 22:48:06 +0900 Subject: [PATCH] struct pic_cont -> struct cont --- contrib/10.callcc/callcc.c | 2 +- extlib/benz/cont.c | 20 ++++++++++---------- extlib/benz/error.c | 2 +- extlib/benz/include/picrin/private/object.h | 6 +++--- extlib/benz/include/picrin/private/state.h | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/10.callcc/callcc.c b/contrib/10.callcc/callcc.c index 0afe3d7e..fdd3f6d3 100644 --- a/contrib/10.callcc/callcc.c +++ b/contrib/10.callcc/callcc.c @@ -5,7 +5,7 @@ struct fullcont { jmp_buf jmp; - struct pic_cont *prev_jmp; + struct cont *prev_jmp; struct checkpoint *cp; diff --git a/extlib/benz/cont.c b/extlib/benz/cont.c index 3ddbf7db..cd1fdafc 100644 --- a/extlib/benz/cont.c +++ b/extlib/benz/cont.c @@ -6,7 +6,7 @@ #include "picrin/private/object.h" #include "picrin/private/state.h" -struct pic_cont { +struct cont { PIC_JMPBUF *jmp; int id; @@ -20,13 +20,13 @@ struct pic_cont { int retc; pic_value *retv; - struct pic_cont *prev; + struct cont *prev; }; -static const pic_data_type cont_type = { "pic_cont", NULL, NULL }; +static const pic_data_type cont_type = { "cont", NULL, NULL }; void -pic_save_point(pic_state *pic, struct pic_cont *cont, PIC_JMPBUF *jmp) +pic_save_point(pic_state *pic, struct cont *cont, PIC_JMPBUF *jmp) { cont->jmp = jmp; @@ -45,7 +45,7 @@ pic_save_point(pic_state *pic, struct pic_cont *cont, PIC_JMPBUF *jmp) } void -pic_load_point(pic_state *pic, struct pic_cont *cont) +pic_load_point(pic_state *pic, struct cont *cont) { pic_wind(pic, pic->cp, cont->cp); @@ -110,7 +110,7 @@ cont_call(pic_state *pic) int argc; pic_value *argv; int id; - struct pic_cont *cc, *cont; + struct cont *cc, *cont; pic_get_args(pic, "*", &argc, &argv); @@ -139,22 +139,22 @@ cont_call(pic_state *pic) } pic_value -pic_make_cont(pic_state *pic, struct pic_cont *cont) +pic_make_cont(pic_state *pic, struct cont *cont) { return pic_lambda(pic, cont_call, 1, pic_data_value(pic, cont, &cont_type)); } -struct pic_cont * +struct cont * pic_alloca_cont(pic_state *pic) { - return pic_alloca(pic, sizeof(struct pic_cont)); + return pic_alloca(pic, sizeof(struct cont)); } static pic_value pic_callcc(pic_state *pic, pic_value proc) { PIC_JMPBUF jmp; - struct pic_cont *cont = pic_alloca_cont(pic); + struct cont *cont = pic_alloca_cont(pic); if (PIC_SETJMP(pic, jmp)) { return pic_valuesk(pic, cont->retc, cont->retv); diff --git a/extlib/benz/error.c b/extlib/benz/error.c index fea8a857..1e902b0b 100644 --- a/extlib/benz/error.c +++ b/extlib/benz/error.c @@ -69,7 +69,7 @@ dynamic_set(pic_state *pic) pic_value pic_start_try(pic_state *pic, PIC_JMPBUF *jmp) { - struct pic_cont *cont; + struct cont *cont; pic_value handler; pic_value var, old_val, new_val; pic_value in, out; diff --git a/extlib/benz/include/picrin/private/object.h b/extlib/benz/include/picrin/private/object.h index 9d157a4f..6abe4d63 100644 --- a/extlib/benz/include/picrin/private/object.h +++ b/extlib/benz/include/picrin/private/object.h @@ -188,9 +188,9 @@ void pic_rope_decref(pic_state *, struct rope *); #define pic_func_p(pic, proc) (pic_type(pic, proc) == PIC_TYPE_FUNC) #define pic_irep_p(pic, proc) (pic_type(pic, proc) == PIC_TYPE_IREP) -struct pic_cont *pic_alloca_cont(pic_state *); -pic_value pic_make_cont(pic_state *, struct pic_cont *); -void pic_save_point(pic_state *, struct pic_cont *, PIC_JMPBUF *); +struct cont *pic_alloca_cont(pic_state *); +pic_value pic_make_cont(pic_state *, struct cont *); +void pic_save_point(pic_state *, struct cont *, PIC_JMPBUF *); void pic_exit_point(pic_state *); void pic_wind(pic_state *, struct checkpoint *, struct checkpoint *); pic_value pic_dynamic_wind(pic_state *, pic_value in, pic_value thunk, pic_value out); diff --git a/extlib/benz/include/picrin/private/state.h b/extlib/benz/include/picrin/private/state.h index 92f26679..16e5ccb2 100644 --- a/extlib/benz/include/picrin/private/state.h +++ b/extlib/benz/include/picrin/private/state.h @@ -40,7 +40,7 @@ struct pic_state { void *userdata; struct checkpoint *cp; - struct pic_cont *cc; + struct cont *cc; int ccnt; pic_value *sp;