Skip to content

Commit d244610

Browse files
committed
Remove some warnings in ruby loader.
1 parent 09d4db4 commit d244610

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

source/loaders/rb_loader/source/rb_loader_impl.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const char *rb_type_deserialize(loader_impl impl, VALUE v, value *result)
216216
}
217217
else if (v_type == T_CLASS)
218218
{
219-
VALUE class_name = rb_funcall(v, rb_intern("name"), 0);
219+
VALUE class_name = rb_funcall(v, rb_intern("name"), 0, NULL);
220220
const char *class_name_str = RSTRING_PTR(class_name);
221221
size_t it, last = 0, length = RSTRING_LEN(class_name);
222222

@@ -403,7 +403,7 @@ function_return function_rb_interface_invoke(function func, function_impl impl,
403403
}
404404
else
405405
{
406-
result_value = rb_funcall(rb_function->rb_module->instance, rb_function->method_id, 0);
406+
result_value = rb_funcall(rb_function->rb_module->instance, rb_function->method_id, 0, NULL);
407407
}
408408

409409
value v = NULL;
@@ -907,7 +907,7 @@ VALUE rb_loader_impl_load_data(loader_impl impl, const loader_naming_path path)
907907
{
908908
VALUE load_path_array = rb_gv_get("$:");
909909

910-
VALUE load_path_array_size = rb_funcall(load_path_array, rb_intern("size"), 0);
910+
VALUE load_path_array_size = rb_funcall(load_path_array, rb_intern("size"), 0, NULL);
911911

912912
VALUE module_path = rb_str_new_cstr(path);
913913

@@ -978,7 +978,7 @@ int rb_loader_impl_module_eval(VALUE module, VALUE module_data, VALUE *result)
978978

979979
rb_io_puts(1, &inspect, rb_stderr);
980980

981-
backtrace = rb_funcall(exception, rb_intern("backtrace"), 0);
981+
backtrace = rb_funcall(exception, rb_intern("backtrace"), 0, NULL);
982982

983983
rb_io_puts(1, &backtrace, rb_stderr);
984984
}
@@ -995,7 +995,7 @@ loader_impl_rb_module rb_loader_impl_load_from_file_module(loader_impl impl, con
995995
{
996996
VALUE name_value = rb_str_new_cstr(name);
997997

998-
VALUE name_capitalized = rb_funcall(name_value, rb_intern("capitalize"), 0);
998+
VALUE name_capitalized = rb_funcall(name_value, rb_intern("capitalize"), 0, NULL);
999999

10001000
VALUE module = rb_define_module(RSTRING_PTR(name_capitalized));
10011001

@@ -1120,7 +1120,7 @@ loader_impl_rb_module rb_loader_impl_load_from_memory_module(loader_impl impl, c
11201120
{
11211121
VALUE name_value = rb_str_new_cstr(name);
11221122

1123-
VALUE name_capitalized = rb_funcall(name_value, rb_intern("capitalize"), 0);
1123+
VALUE name_capitalized = rb_funcall(name_value, rb_intern("capitalize"), 0, NULL);
11241124

11251125
VALUE module = rb_define_module(RSTRING_PTR(name_capitalized));
11261126

@@ -1338,17 +1338,17 @@ loader_impl_rb_function rb_function_create(loader_impl impl, loader_impl_rb_modu
13381338

13391339
void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_str, enum class_visibility_id visibility, const char *method_type_str, VALUE methods, int (*register_method)(klass, method))
13401340
{
1341-
VALUE methods_v_size = rb_funcall(methods, rb_intern("size"), 0);
1341+
VALUE methods_v_size = rb_funcall(methods, rb_intern("size"), 0, NULL);
13421342
int method_index, methods_size = FIX2INT(methods_v_size);
13431343

13441344
for (method_index = 0; method_index < methods_size; ++method_index)
13451345
{
13461346
VALUE rb_method = rb_ary_entry(methods, method_index);
1347-
VALUE name = rb_funcall(rb_method, rb_intern("id2name"), 0);
1347+
VALUE name = rb_funcall(rb_method, rb_intern("id2name"), 0, NULL);
13481348
const char *method_name_str = RSTRING_PTR(name);
13491349

13501350
VALUE instance_method = rb_funcall(cls, rb_intern(method_type_str), 1, rb_method);
1351-
VALUE parameters = rb_funcall(instance_method, rb_intern("parameters"), 0);
1351+
VALUE parameters = rb_funcall(instance_method, rb_intern("parameters"), 0, NULL);
13521352
size_t args_it, args_count = RARRAY_LEN(parameters);
13531353

13541354
log_write("metacall", LOG_LEVEL_DEBUG, "Method '%s' inside '%s' of type %s with %" PRIuS " parameters", method_name_str, class_name_str, method_type_str, args_count);
@@ -1389,7 +1389,7 @@ void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_
13891389
if (RARRAY_LEN(parameter_pair) == 2)
13901390
{
13911391
VALUE parameter_name_id = rb_ary_entry(parameter_pair, 1);
1392-
VALUE parameter_name = rb_funcall(parameter_name_id, rb_intern("id2name"), 0);
1392+
VALUE parameter_name = rb_funcall(parameter_name_id, rb_intern("id2name"), 0, NULL);
13931393
const char *parameter_name_str = RSTRING_PTR(parameter_name);
13941394

13951395
signature_set(s, args_it, parameter_name_str, NULL);
@@ -1410,7 +1410,7 @@ void rb_loader_impl_discover_attributes(klass c, const char *class_name_str, VAL
14101410
for (attributes_index = 0; attributes_index < attributes_size; ++attributes_index)
14111411
{
14121412
VALUE rb_attr = rb_ary_entry(attributes, attributes_index);
1413-
VALUE name = rb_funcall(rb_attr, rb_intern("id2name"), 0);
1413+
VALUE name = rb_funcall(rb_attr, rb_intern("id2name"), 0, NULL);
14141414
const char *attr_name_str = RSTRING_PTR(name);
14151415

14161416
log_write("metacall", LOG_LEVEL_DEBUG, "Attribute '%s' inside '%s'", attr_name_str, class_name_str);
@@ -1434,8 +1434,8 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo
14341434
return 0;
14351435
}
14361436

1437-
VALUE instance_methods = rb_funcall(rb_module->module, rb_intern("instance_methods"), 0);
1438-
VALUE methods_size = rb_funcall(instance_methods, rb_intern("size"), 0);
1437+
VALUE instance_methods = rb_funcall(rb_module->module, rb_intern("instance_methods"), 0, NULL);
1438+
VALUE methods_size = rb_funcall(instance_methods, rb_intern("size"), 0, NULL);
14391439
int index, size = FIX2INT(methods_size);
14401440

14411441
for (index = 0; index < size; ++index)
@@ -1444,7 +1444,7 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo
14441444

14451445
if (method != Qnil)
14461446
{
1447-
VALUE method_name = rb_funcall(method, rb_intern("id2name"), 0);
1447+
VALUE method_name = rb_funcall(method, rb_intern("id2name"), 0, NULL);
14481448

14491449
const char *method_name_str = RSTRING_PTR(method_name);
14501450

@@ -1486,8 +1486,8 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo
14861486
}
14871487

14881488
/* Now discover classes */
1489-
VALUE constants = rb_funcall(rb_module->module, rb_intern("constants"), 0);
1490-
VALUE constants_size = rb_funcall(constants, rb_intern("size"), 0);
1489+
VALUE constants = rb_funcall(rb_module->module, rb_intern("constants"), 0, NULL);
1490+
VALUE constants_size = rb_funcall(constants, rb_intern("size"), 0, NULL);
14911491
size = FIX2INT(constants_size);
14921492

14931493
for (index = 0; index < size; index++)
@@ -1498,7 +1498,7 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo
14981498
{
14991499
if (RB_TYPE_P(constant, T_SYMBOL))
15001500
{
1501-
VALUE class_name = rb_funcall(constant, rb_intern("id2name"), 0);
1501+
VALUE class_name = rb_funcall(constant, rb_intern("id2name"), 0, NULL);
15021502
const char *class_name_str = RSTRING_PTR(class_name);
15031503
VALUE cls = rb_const_get_from(rb_module->module, rb_intern(class_name_str));
15041504
loader_impl_rb_class rb_cls = malloc(sizeof(struct loader_impl_rb_class_type));

0 commit comments

Comments
 (0)