diff options
author | yui-knk <[email protected]> | 2024-04-15 21:26:38 +0900 |
---|---|---|
committer | Yuichiro Kaneko <[email protected]> | 2024-04-16 07:15:45 +0900 |
commit | ebaa87f62692f4dfe5e209b3337d54ce147e8dcd () | |
tree | 06cb62273a73dc0d68f3b374e2204e8feb80595a | |
parent | f5d89267c46ea86c34b9e174e999fea15d48a8e1 (diff) |
Remove unused functions from `struct rb_parser_config_struct`
-rw-r--r-- | node.c | 1 | ||||
-rw-r--r-- | ruby_parser.c | 17 | ||||
-rw-r--r-- | rubyparser.h | 5 | ||||
-rw-r--r-- | universal_parser.c | 5 |
4 files changed, 0 insertions, 28 deletions
@@ -81,7 +81,6 @@ rb_node_buffer_new(void) #define xfree ast->node_buffer->config->free #define rb_xmalloc_mul_add ast->node_buffer->config->xmalloc_mul_add #define ruby_xrealloc(var,size) (ast->node_buffer->config->realloc_n((void *)var, 1, size)) -#define rb_gc_mark_and_move ast->node_buffer->config->gc_mark_and_move #endif typedef void node_itr_t(rb_ast_t *ast, void *ctx, NODE *node); @@ -309,18 +309,6 @@ syntax_error_new(void) return rb_class_new_instance(0, 0, rb_eSyntaxError); } -static VALUE -obj_write(VALUE old, VALUE *slot, VALUE young) -{ - return RB_OBJ_WRITE(old, slot, young); -} - -static VALUE -default_rs(void) -{ - return rb_default_rs; -} - static void * memmove2(void *dest, const void *src, size_t t, size_t n) { @@ -429,7 +417,6 @@ static const rb_parser_config_t rb_global_parser_config = { .ary_push = rb_ary_push, .ary_new_from_args = rb_ary_new_from_args, .ary_unshift = rb_ary_unshift, - .ary_modify = rb_ary_modify, .array_len = rb_array_len, .array_aref = RARRAY_AREF, @@ -476,7 +463,6 @@ static const rb_parser_config_t rb_global_parser_config = { .stderr_tty_p = rb_stderr_tty_p, .write_error_str = rb_write_error_str, - .default_rs = default_rs, .io_write = rb_io_write, .io_flush = rb_io_flush, .io_puts = rb_io_puts, @@ -501,7 +487,6 @@ static const rb_parser_config_t rb_global_parser_config = { .enc_mbcput = enc_mbcput, .enc_find_index = rb_enc_find_index, .enc_from_index = enc_from_index, - .enc_associate_index = rb_enc_associate_index, .enc_isspace = enc_isspace, .enc_coderange_7bit = ENC_CODERANGE_7BIT, .enc_coderange_unknown = ENC_CODERANGE_UNKNOWN, @@ -528,10 +513,8 @@ static const rb_parser_config_t rb_global_parser_config = { .sized_xfree = ruby_sized_xfree, .sized_realloc_n = ruby_sized_realloc_n, - .obj_write = obj_write, .gc_guard = gc_guard, .gc_mark = rb_gc_mark, - .gc_mark_and_move = rb_gc_mark_and_move, .reg_compile = rb_reg_compile, .reg_check_preprocess = rb_reg_check_preprocess, @@ -1264,7 +1264,6 @@ typedef struct rb_parser_config_struct { VALUE (*ary_push)(VALUE ary, VALUE elem); VALUE (*ary_new_from_args)(long n, ...); VALUE (*ary_unshift)(VALUE ary, VALUE item); - void (*ary_modify)(VALUE ary); long (*array_len)(VALUE a); VALUE (*array_aref)(VALUE, long); @@ -1318,7 +1317,6 @@ typedef struct rb_parser_config_struct { /* IO */ int (*stderr_tty_p)(void); void (*write_error_str)(VALUE mesg); - VALUE (*default_rs)(void); VALUE (*io_write)(VALUE io, VALUE str); VALUE (*io_flush)(VALUE io); VALUE (*io_puts)(int argc, const VALUE *argv, VALUE out); @@ -1345,7 +1343,6 @@ typedef struct rb_parser_config_struct { int (*enc_mbcput)(unsigned int c, void *buf, rb_encoding *enc); int (*enc_find_index)(const char *name); rb_encoding *(*enc_from_index)(int idx); - VALUE (*enc_associate_index)(VALUE obj, int encindex); int (*enc_isspace)(OnigCodePoint c, rb_encoding *enc); rb_encoding *(*enc_compatible)(VALUE str1, VALUE str2); VALUE (*enc_from_encoding)(rb_encoding *enc); @@ -1378,10 +1375,8 @@ typedef struct rb_parser_config_struct { /* GC */ void (*sized_xfree)(void *x, size_t size); void *(*sized_realloc_n)(void *ptr, size_t new_count, size_t element_size, size_t old_count); - VALUE (*obj_write)(VALUE, VALUE *, VALUE); void (*gc_guard)(VALUE); void (*gc_mark)(VALUE); - void (*gc_mark_and_move)(VALUE *ptr); /* Re */ VALUE (*reg_compile)(VALUE str, int options, const char *sourcefile, int sourceline); @@ -95,7 +95,6 @@ #undef rb_ary_new_from_args #define rb_ary_new_from_args p->config->ary_new_from_args #define rb_ary_unshift p->config->ary_unshift -#define rb_ary_modify p->config->ary_modify #undef RARRAY_LEN #define RARRAY_LEN p->config->array_len #define RARRAY_AREF p->config->array_aref @@ -154,7 +153,6 @@ #define rb_stderr_tty_p p->config->stderr_tty_p #define rb_write_error_str p->config->write_error_str -#define rb_default_rs p->config->default_rs() #define rb_io_write p->config->io_write #define rb_io_flush p->config->io_flush #define rb_io_puts p->config->io_puts @@ -179,7 +177,6 @@ #define rb_enc_mbcput p->config->enc_mbcput #define rb_enc_find_index p->config->enc_find_index #define rb_enc_from_index p->config->enc_from_index -#define rb_enc_associate_index p->config->enc_associate_index #define rb_enc_isspace p->config->enc_isspace #define ENC_CODERANGE_7BIT p->config->enc_coderange_7bit #define ENC_CODERANGE_UNKNOWN p->config->enc_coderange_unknown @@ -202,8 +199,6 @@ #define ruby_sized_xfree p->config->sized_xfree #define SIZED_REALLOC_N(v, T, m, n) ((v) = (T *)p->config->sized_realloc_n((void *)(v), (m), sizeof(T), (n))) -#undef RB_OBJ_WRITE -#define RB_OBJ_WRITE(old, slot, young) p->config->obj_write((VALUE)(old), (VALUE *)(slot), (VALUE)(young)) #undef RB_GC_GUARD #define RB_GC_GUARD p->config->gc_guard #define rb_gc_mark p->config->gc_mark |