зеркало из https://github.com/github/ruby.git
Prefer `enum ruby_tag_type` over `int`
This commit is contained in:
Родитель
a91800c4a0
Коммит
28a2105a55
12
eval.c
12
eval.c
|
@ -463,7 +463,7 @@ rb_class_modify_check(VALUE klass)
|
|||
}
|
||||
}
|
||||
|
||||
NORETURN(static void rb_longjmp(rb_execution_context_t *, int, volatile VALUE, VALUE));
|
||||
NORETURN(static void rb_longjmp(rb_execution_context_t *, enum ruby_tag_type, volatile VALUE, VALUE));
|
||||
static VALUE get_errinfo(void);
|
||||
#define get_ec_errinfo(ec) rb_ec_get_errinfo(ec)
|
||||
|
||||
|
@ -541,7 +541,7 @@ exc_setup_message(const rb_execution_context_t *ec, VALUE mesg, VALUE *cause)
|
|||
}
|
||||
|
||||
static void
|
||||
setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
|
||||
setup_exception(rb_execution_context_t *ec, enum ruby_tag_type tag, volatile VALUE mesg, VALUE cause)
|
||||
{
|
||||
VALUE e;
|
||||
int line;
|
||||
|
@ -645,7 +645,7 @@ rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause)
|
|||
}
|
||||
|
||||
static void
|
||||
rb_longjmp(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
|
||||
rb_longjmp(rb_execution_context_t *ec, enum ruby_tag_type tag, volatile VALUE mesg, VALUE cause)
|
||||
{
|
||||
mesg = exc_setup_message(ec, mesg, &cause);
|
||||
setup_exception(ec, tag, mesg, cause);
|
||||
|
@ -655,10 +655,10 @@ rb_longjmp(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause
|
|||
|
||||
static VALUE make_exception(int argc, const VALUE *argv, int isstr);
|
||||
|
||||
NORETURN(static void rb_exc_exception(VALUE mesg, int tag, VALUE cause));
|
||||
NORETURN(static void rb_exc_exception(VALUE mesg, enum ruby_tag_type tag, VALUE cause));
|
||||
|
||||
static void
|
||||
rb_exc_exception(VALUE mesg, int tag, VALUE cause)
|
||||
rb_exc_exception(VALUE mesg, enum ruby_tag_type tag, VALUE cause)
|
||||
{
|
||||
if (!NIL_P(mesg)) {
|
||||
mesg = make_exception(1, &mesg, FALSE);
|
||||
|
@ -985,7 +985,7 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int *pstate)
|
|||
VALUE
|
||||
rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2)
|
||||
{
|
||||
int state;
|
||||
enum ruby_tag_type state;
|
||||
volatile VALUE result = Qnil;
|
||||
VALUE errinfo;
|
||||
rb_execution_context_t * volatile ec = GET_EC();
|
||||
|
|
|
@ -290,9 +290,9 @@ NORETURN(void rb_print_undef(VALUE, ID, rb_method_visibility_t));
|
|||
NORETURN(void rb_print_undef_str(VALUE, VALUE));
|
||||
NORETURN(void rb_print_inaccessible(VALUE, ID, rb_method_visibility_t));
|
||||
NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
|
||||
NORETURN(void rb_vm_jump_tag_but_local_jump(int));
|
||||
NORETURN(void rb_vm_jump_tag_but_local_jump(enum ruby_tag_type));
|
||||
|
||||
VALUE rb_vm_make_jump_tag_but_local_jump(int state, VALUE val);
|
||||
VALUE rb_vm_make_jump_tag_but_local_jump(enum ruby_tag_type state, VALUE val);
|
||||
rb_cref_t *rb_vm_cref(void);
|
||||
rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void);
|
||||
VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, VALUE block_handler, VALUE filename);
|
||||
|
|
4
ractor.c
4
ractor.c
|
@ -590,7 +590,7 @@ ractor_check_ints(rb_execution_context_t *ec, rb_ractor_t *cr, ractor_sleep_clea
|
|||
RACTOR_UNLOCK(cr);
|
||||
{
|
||||
if (cf_func) {
|
||||
int state;
|
||||
enum ruby_tag_type state;
|
||||
EC_PUSH_TAG(ec);
|
||||
if ((state = EC_EXEC_TAG()) == TAG_NONE) {
|
||||
rb_thread_check_ints();
|
||||
|
@ -1319,7 +1319,7 @@ ractor_try_yield(rb_execution_context_t *ec, rb_ractor_t *cr, struct rb_ractor_q
|
|||
type = basket_type_will;
|
||||
}
|
||||
else {
|
||||
int state;
|
||||
enum ruby_tag_type state;
|
||||
|
||||
// begin
|
||||
EC_PUSH_TAG(ec);
|
||||
|
|
2
thread.c
2
thread.c
|
@ -4364,7 +4364,7 @@ rb_thread_wait_for_single_fd(int fd, int events, struct timeval *timeout)
|
|||
int result = 0;
|
||||
nfds_t nfds;
|
||||
struct waiting_fd wfd;
|
||||
int state;
|
||||
enum ruby_tag_type state;
|
||||
volatile int lerrno;
|
||||
|
||||
rb_execution_context_t *ec = GET_EC();
|
||||
|
|
4
vm.c
4
vm.c
|
@ -1981,7 +1981,7 @@ rb_vm_localjump_error(const char *mesg, VALUE value, int reason)
|
|||
}
|
||||
|
||||
VALUE
|
||||
rb_vm_make_jump_tag_but_local_jump(int state, VALUE val)
|
||||
rb_vm_make_jump_tag_but_local_jump(enum ruby_tag_type state, VALUE val)
|
||||
{
|
||||
const char *mesg;
|
||||
|
||||
|
@ -2013,7 +2013,7 @@ rb_vm_make_jump_tag_but_local_jump(int state, VALUE val)
|
|||
}
|
||||
|
||||
void
|
||||
rb_vm_jump_tag_but_local_jump(int state)
|
||||
rb_vm_jump_tag_but_local_jump(enum ruby_tag_type state)
|
||||
{
|
||||
VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
|
||||
if (!NIL_P(exc)) rb_exc_raise(exc);
|
||||
|
|
|
@ -435,7 +435,7 @@ rb_exec_event_hooks(rb_trace_arg_t *trace_arg, rb_hook_list_t *hooks, int pop_p)
|
|||
trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) {
|
||||
const VALUE errinfo = ec->errinfo;
|
||||
const VALUE old_recursive = ec->local_storage_recursive_hash;
|
||||
int state = 0;
|
||||
enum ruby_tag_type state = 0;
|
||||
|
||||
/* setup */
|
||||
ec->local_storage_recursive_hash = ec->local_storage_recursive_hash_for_trace;
|
||||
|
|
Загрузка…
Ссылка в новой задаче