From 3bea8f6b7e0449946c12a0ce2c5aa893d6026883 Mon Sep 17 00:00:00 2001
From: Olly Betts
%typemap(in) (int nattributes, const char **names, const int *values)
(VALUE keys_arr, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
}
@@ -3717,7 +3717,7 @@ the keys and values from the hash:
%typemap(in) (int nattributes, const char **names, const int *values)
(VALUE keys_arr, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
$2 = NULL;
$3 = NULL;
if ($1 > 0) {
@@ -3736,13 +3736,13 @@ of the keys) and then start looping over the elements in that array:
%typemap(in) (int nattributes, const char **names, const int *values)
(VALUE keys_arr, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
$2 = NULL;
$3 = NULL;
if ($1 > 0) {
$2 = (char **) malloc($1*sizeof(char *));
$3 = (int *) malloc($1*sizeof(int));
- keys_arr = rb_funcall($input, rb_intern("keys"), 0, NULL);
+ keys_arr = rb_funcall($input, rb_intern("keys"), 0, Qnil);
for (i = 0; i < $1; i++) {
}
}
@@ -3758,13 +3758,13 @@ corresponding to that key in the hash:
%typemap(in) (int nattributes, const char **names, const int *values)
(VALUE keys_arr, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
$2 = NULL;
$3 = NULL;
if ($1 > 0) {
$2 = (char **) malloc($1*sizeof(char *));
$3 = (int *) malloc($1*sizeof(int));
- keys_arr = rb_funcall($input, rb_intern("keys"), 0, NULL);
+ keys_arr = rb_funcall($input, rb_intern("keys"), 0, Qnil);
for (i = 0; i < $1; i++) {
key = rb_ary_entry(keys_arr, i);
val = rb_hash_aref($input, key);
@@ -3781,13 +3781,13 @@ value is a Fixnum:
%typemap(in) (int nattributes, const char **names, const int *values)
(VALUE keys_arr, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
$2 = NULL;
$3 = NULL;
if ($1 > 0) {
$2 = (char **) malloc($1*sizeof(char *));
$3 = (int *) malloc($1*sizeof(int));
- keys_arr = rb_funcall($input, rb_intern("keys"), 0, NULL);
+ keys_arr = rb_funcall($input, rb_intern("keys"), 0, Qnil);
for (i = 0; i < $1; i++) {
key = rb_ary_entry(keys_arr, i);
val = rb_hash_aref($input, key);
@@ -3805,13 +3805,13 @@ equivalents and store them in our local C arrays:
%typemap(in) (int nattributes, const char **names, const int *values)
(VALUE keys_arr, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
$2 = NULL;
$3 = NULL;
if ($1 > 0) {
$2 = (char **) malloc($1*sizeof(char *));
$3 = (int *) malloc($1*sizeof(int));
- keys_arr = rb_funcall($input, rb_intern("keys"), 0, NULL);
+ keys_arr = rb_funcall($input, rb_intern("keys"), 0, Qnil);
for (i = 0; i < $1; i++) {
key = rb_ary_entry(keys_arr, i);
val = rb_hash_aref($input, key);
diff --git a/Examples/ruby/hashargs/example.i b/Examples/ruby/hashargs/example.i
index 10e209e5f..4c3f3070b 100644
--- a/Examples/ruby/hashargs/example.i
+++ b/Examples/ruby/hashargs/example.i
@@ -2,13 +2,13 @@
%typemap(in) (int nattributes, const char **names, const int *values) (VALUE keys_ary, int i, VALUE key, VALUE val) {
Check_Type($input, T_HASH);
- $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, NULL));
+ $1 = NUM2INT(rb_funcall($input, rb_intern("size"), 0, Qnil));
$2 = NULL;
$3 = NULL;
if ($1 > 0) {
$2 = (char **) malloc($1*sizeof(char *));
$3 = (int *) malloc($1*sizeof(int));
- keys_ary = rb_funcall($input, rb_intern("keys"), 0, NULL);
+ keys_ary = rb_funcall($input, rb_intern("keys"), 0, Qnil);
for (i = 0; i < $1; i++) {
key = rb_ary_entry(keys_ary, i);
val = rb_hash_aref($input, key);
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx
index 69a849d16..641604620 100644
--- a/Source/Modules/ruby.cxx
+++ b/Source/Modules/ruby.cxx
@@ -3046,7 +3046,7 @@ public:
if (argc > 0) {
Printf(w->code, "%s = rb_funcall(swig_get_self(), rb_intern(\"%s\"), %d%s);\n", Swig_cresult_name(), methodName, argc, args);
} else {
- Printf(w->code, "%s = rb_funcall(swig_get_self(), rb_intern(\"%s\"), 0, NULL);\n", Swig_cresult_name(), methodName);
+ Printf(w->code, "%s = rb_funcall(swig_get_self(), rb_intern(\"%s\"), 0, Qnil);\n", Swig_cresult_name(), methodName);
}
if ( initstack ) Printf(w->code, "SWIG_RELEASE_STACK;\n");
}