Skip to content

Commit dae5038

Browse files
S-H-GAMELINKSyui-knk
authored andcommitted
Remove unused functions from struct rb_parser_config_struct
1 parent c6c75f3 commit dae5038

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

ruby_parser.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,6 @@ rbool(VALUE v)
297297
return RBOOL(v);
298298
}
299299

300-
static int
301-
undef_p(VALUE v)
302-
{
303-
return RB_UNDEF_P(v);
304-
}
305-
306300
static int
307301
rtest(VALUE obj)
308302
{
@@ -357,18 +351,6 @@ rb_errno_ptr2(void)
357351
return rb_errno_ptr();
358352
}
359353

360-
static int
361-
fixnum_p(VALUE obj)
362-
{
363-
return (int)RB_FIXNUM_P(obj);
364-
}
365-
366-
static int
367-
symbol_p(VALUE obj)
368-
{
369-
return (int)RB_SYMBOL_P(obj);
370-
}
371-
372354
static void *
373355
zalloc(size_t elemsiz)
374356
{
@@ -447,17 +429,13 @@ static const rb_parser_config_t rb_global_parser_config = {
447429
.compile_callback = rb_suppress_tracing,
448430
.reg_named_capture_assign = reg_named_capture_assign,
449431

450-
.fixnum_p = fixnum_p,
451-
.symbol_p = symbol_p,
452-
453432
.attr_get = rb_attr_get,
454433

455434
.ary_new = rb_ary_new,
456435
.ary_push = rb_ary_push,
457436
.ary_new_from_args = rb_ary_new_from_args,
458437
.ary_unshift = rb_ary_unshift,
459438
.ary_new2 = rb_ary_new2,
460-
.ary_clear = rb_ary_clear,
461439
.ary_modify = rb_ary_modify,
462440
.array_len = rb_array_len,
463441
.array_aref = RARRAY_AREF,
@@ -586,7 +564,6 @@ static const rb_parser_config_t rb_global_parser_config = {
586564
.strtod = ruby_strtod,
587565

588566
.rbool = rbool,
589-
.undef_p = undef_p,
590567
.rtest = rtest,
591568
.nil_p = nil_p,
592569
.qnil = Qnil,

rubyparser.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,6 @@ typedef struct rb_parser_config_struct {
12481248
VALUE (*compile_callback)(VALUE (*func)(VALUE), VALUE arg);
12491249
NODE *(*reg_named_capture_assign)(struct parser_params* p, VALUE regexp, const rb_code_location_t *loc);
12501250

1251-
int (*fixnum_p)(VALUE);
1252-
int (*symbol_p)(VALUE);
1253-
12541251
/* Variable */
12551252
VALUE (*attr_get)(VALUE obj, ID id);
12561253

@@ -1260,7 +1257,6 @@ typedef struct rb_parser_config_struct {
12601257
VALUE (*ary_new_from_args)(long n, ...);
12611258
VALUE (*ary_unshift)(VALUE ary, VALUE item);
12621259
VALUE (*ary_new2)(long capa); // ary_new_capa
1263-
VALUE (*ary_clear)(VALUE ary);
12641260
void (*ary_modify)(VALUE ary);
12651261
long (*array_len)(VALUE a);
12661262
VALUE (*array_aref)(VALUE, long);
@@ -1409,7 +1405,6 @@ typedef struct rb_parser_config_struct {
14091405

14101406
/* Misc */
14111407
VALUE (*rbool)(VALUE);
1412-
int (*undef_p)(VALUE);
14131408
int (*rtest)(VALUE obj);
14141409
int (*nil_p)(VALUE obj);
14151410
VALUE qnil;

universal_parser.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@
8888
#define compile_callback p->config->compile_callback
8989
#define reg_named_capture_assign p->config->reg_named_capture_assign
9090

91-
#undef FIXNUM_P
92-
#define FIXNUM_P p->config->fixnum_p
93-
#undef SYMBOL_P
94-
#define SYMBOL_P p->config->symbol_p
95-
9691
#define rb_attr_get p->config->attr_get
9792

9893
#define rb_ary_new p->config->ary_new
@@ -102,7 +97,6 @@
10297
#define rb_ary_unshift p->config->ary_unshift
10398
#undef rb_ary_new2
10499
#define rb_ary_new2 p->config->ary_new2
105-
#define rb_ary_clear p->config->ary_clear
106100
#define rb_ary_modify p->config->ary_modify
107101
#undef RARRAY_LEN
108102
#define RARRAY_LEN p->config->array_len
@@ -245,8 +239,6 @@
245239

246240
#undef RBOOL
247241
#define RBOOL p->config->rbool
248-
#undef UNDEF_P
249-
#define UNDEF_P p->config->undef_p
250242
#undef RTEST
251243
#define RTEST p->config->rtest
252244
#undef NIL_P

0 commit comments

Comments
 (0)