Skip to content

Commit

Permalink
mark local functions static
Browse files Browse the repository at this point in the history
  • Loading branch information
hmsk committed Jul 15, 2024
1 parent 0036a9e commit 8a32eba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ext/quickjsrb/quickjsrb.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct VMData {
struct EvalTime *eval_time;
} VMData;

void vm_free(void* ptr)
static void vm_free(void* ptr)
{
VMData *data = (VMData *)ptr;
free(data->eval_time);
Expand Down Expand Up @@ -41,7 +41,7 @@ static const rb_data_type_t vm_type = {
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
};

VALUE vm_alloc(VALUE self)
static VALUE vm_alloc(VALUE self)
{
VMData *data;
VALUE obj = TypedData_Make_Struct(self, VMData, &vm_type, data);
Expand Down Expand Up @@ -232,7 +232,7 @@ static JSValue js_quickjsrb_call_global(JSContext *ctx, JSValueConst _this, int
return to_js_value(ctx, r_result);
}

VALUE vm_m_initialize(int argc, VALUE* argv, VALUE self)
static VALUE vm_m_initialize(int argc, VALUE* argv, VALUE self)
{
VALUE r_opts;
rb_scan_args(argc, argv, ":", &r_opts);
Expand Down Expand Up @@ -301,7 +301,7 @@ static int interrupt_handler(JSRuntime *runtime, void *opaque) {
return clock() >= eval_time->started_at + eval_time->limit ? 1 : 0;
}

VALUE vm_m_evalCode(VALUE self, VALUE r_code)
static VALUE vm_m_evalCode(VALUE self, VALUE r_code)
{
VMData *data;
TypedData_Get_Struct(self, VMData, &vm_type, data);
Expand All @@ -322,7 +322,7 @@ VALUE vm_m_evalCode(VALUE self, VALUE r_code)
return result;
}

VALUE vm_m_defineGlobalFunction(VALUE self, VALUE r_name)
static VALUE vm_m_defineGlobalFunction(VALUE self, VALUE r_name)
{
rb_need_block();

Expand Down Expand Up @@ -351,7 +351,7 @@ VALUE vm_m_defineGlobalFunction(VALUE self, VALUE r_name)
return Qnil;
}

VALUE vm_m_dispose(VALUE self)
static VALUE vm_m_dispose(VALUE self)
{
VMData *data;
TypedData_Get_Struct(self, VMData, &vm_type, data);
Expand Down

0 comments on commit 8a32eba

Please sign in to comment.