[Ruby] Pass Qnil instead of NULL to rb_funcall()

This silences GCC -Wconversion-null warning (on by default with recent
GCC).
This commit is contained in:
Olly Betts 2018-04-03 18:01:58 +12:00
commit 3bea8f6b7e
4 changed files with 17 additions and 13 deletions

View file

@ -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);