Skip to content

Commit

Permalink
Merge pull request #243 from nobu/protoize
Browse files Browse the repository at this point in the history
Use prototype declarations
  • Loading branch information
nobu committed Nov 1, 2023
2 parents 5b7735c + 3d886a2 commit c9b5b61
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions ext/racc/cparse/cparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ static ID id_d_e_pop;
# define LONG2NUM(i) INT2NUM(i)
#endif

static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));
static ID value_to_id(VALUE v);
static inline long num_to_long(VALUE n);

static ID
value_to_id(VALUE v)
Expand All @@ -95,8 +95,8 @@ num_to_long(VALUE n)
Parser Stack Interfaces
----------------------------------------------------------------------- */

static VALUE get_stack_tail _((VALUE stack, long len));
static void cut_stack_tail _((VALUE stack, long len));
static VALUE get_stack_tail(VALUE stack, long len);
static void cut_stack_tail(VALUE stack, long len);

static VALUE
get_stack_tail(VALUE stack, long len)
Expand Down Expand Up @@ -185,27 +185,27 @@ struct cparse_params {
Parser Main Routines
----------------------------------------------------------------------- */

static VALUE racc_cparse _((VALUE parser, VALUE arg, VALUE sysdebug));
static VALUE racc_yyparse _((VALUE parser, VALUE lexer, VALUE lexmid,
VALUE arg, VALUE sysdebug));

static void call_lexer _((struct cparse_params *v));
static VALUE lexer_i _((RB_BLOCK_CALL_FUNC_ARGLIST(block_args, data)));

static VALUE assert_array _((VALUE a));
static long assert_integer _((VALUE n));
static VALUE assert_hash _((VALUE h));
static VALUE initialize_params _((VALUE vparams, VALUE parser, VALUE arg,
VALUE lexer, VALUE lexmid));
static void cparse_params_mark _((void *ptr));
static size_t cparse_params_memsize _((const void *ptr));

static void parse_main _((struct cparse_params *v,
VALUE tok, VALUE val, int resume));
static void extract_user_token _((struct cparse_params *v,
VALUE block_args, VALUE *tok, VALUE *val));
static void shift _((struct cparse_params* v, long act, VALUE tok, VALUE val));
static int reduce _((struct cparse_params* v, long act));
static VALUE racc_cparse(VALUE parser, VALUE arg, VALUE sysdebug);
static VALUE racc_yyparse(VALUE parser, VALUE lexer, VALUE lexmid,
VALUE arg, VALUE sysdebug);

static void call_lexer(struct cparse_params *v);
static VALUE lexer_i(RB_BLOCK_CALL_FUNC_ARGLIST(block_args, data));

static VALUE assert_array(VALUE a);
static long assert_integer(VALUE n);
static VALUE assert_hash(VALUE h);
static VALUE initialize_params(VALUE vparams, VALUE parser, VALUE arg,
VALUE lexer, VALUE lexmid);
static void cparse_params_mark(void *ptr);
static size_t cparse_params_memsize(const void *ptr);

static void parse_main(struct cparse_params *v,
VALUE tok, VALUE val, int resume);
static void extract_user_token(struct cparse_params *v,
VALUE block_args, VALUE *tok, VALUE *val);
static void shift(struct cparse_params* v, long act, VALUE tok, VALUE val);
static int reduce(struct cparse_params* v, long act);
static rb_block_call_func reduce0;

#ifdef DEBUG
Expand Down

0 comments on commit c9b5b61

Please sign in to comment.