insert assertion to pic_foo_ptr

This commit is contained in:
Yuichi Nishiwaki 2016-02-21 05:39:15 +09:00
parent f89a55c082
commit 07e7785241
1 changed files with 14 additions and 14 deletions

View File

@ -140,20 +140,20 @@ struct pic_checkpoint {
struct pic_object *pic_obj_ptr(pic_value);
#define pic_id_ptr(pic, o) ((pic_id *)pic_obj_ptr(o))
#define pic_sym_ptr(pic, o) ((pic_sym *)pic_obj_ptr(o))
#define pic_str_ptr(pic, o) ((struct pic_string *)pic_obj_ptr(o))
#define pic_blob_ptr(pic, o) ((struct pic_blob *)pic_obj_ptr(o))
#define pic_pair_ptr(pic, o) ((struct pic_pair *)pic_obj_ptr(o))
#define pic_vec_ptr(pic, o) ((struct pic_vector *)pic_obj_ptr(o))
#define pic_dict_ptr(pic, o) ((struct pic_dict *)pic_obj_ptr(o))
#define pic_weak_ptr(pic, o) ((struct pic_weak *)pic_obj_ptr(o))
#define pic_data_ptr(pic, o) ((struct pic_data *)pic_obj_ptr(o))
#define pic_proc_ptr(pic, o) ((struct pic_proc *)pic_obj_ptr(o))
#define pic_env_ptr(pic, o) ((struct pic_env *)pic_obj_ptr(o))
#define pic_port_ptr(pic, o) ((struct pic_port *)pic_obj_ptr(o))
#define pic_error_ptr(pic, o) ((struct pic_error *)pic_obj_ptr(o))
#define pic_rec_ptr(pic, o) ((struct pic_record *)pic_obj_ptr(o))
#define pic_id_ptr(pic, o) (assert(pic_id_p(pic, o)), (pic_id *)pic_obj_ptr(o))
#define pic_sym_ptr(pic, o) (assert(pic_sym_p(pic, o)), (pic_sym *)pic_obj_ptr(o))
#define pic_str_ptr(pic, o) (assert(pic_str_p(pic, o)), (struct pic_string *)pic_obj_ptr(o))
#define pic_blob_ptr(pic, o) (assert(pic_blob_p(pic, o)), (struct pic_blob *)pic_obj_ptr(o))
#define pic_pair_ptr(pic, o) (assert(pic_pair_p(pic, o)), (struct pic_pair *)pic_obj_ptr(o))
#define pic_vec_ptr(pic, o) (assert(pic_vec_p(pic, o)), (struct pic_vector *)pic_obj_ptr(o))
#define pic_dict_ptr(pic, o) (assert(pic_dict_p(pic, o)), (struct pic_dict *)pic_obj_ptr(o))
#define pic_weak_ptr(pic, o) (assert(pic_weak_p(pic, o)), (struct pic_weak *)pic_obj_ptr(o))
#define pic_data_ptr(pic, o) (assert(pic_data_p(pic, o, NULL)), (struct pic_data *)pic_obj_ptr(o))
#define pic_proc_ptr(pic, o) (assert(pic_proc_p(pic, o)), (struct pic_proc *)pic_obj_ptr(o))
#define pic_env_ptr(pic, o) (assert(pic_env_p(pic, o)), (struct pic_env *)pic_obj_ptr(o))
#define pic_port_ptr(pic, o) (assert(pic_port_p(pic, o)), (struct pic_port *)pic_obj_ptr(o))
#define pic_error_ptr(pic, o) (assert(pic_error_p(pic, o)), (struct pic_error *)pic_obj_ptr(o))
#define pic_rec_ptr(pic, o) (assert(pic_rec_p(pic, o)), (struct pic_record *)pic_obj_ptr(o))
#define pic_obj_p(pic,v) (pic_type(pic,v) > PIC_IVAL_END)
#define pic_env_p(pic, v) (pic_type(pic, v) == PIC_TYPE_ENV)