X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fruby%2Fclasses.i;h=13496a86bb98fc64fc181300aaf2031b19e2ef76;hb=bf5c4d46f8453f810b6f7615d2c16c9f752f9246;hp=96bd3770d28d76666330a8034b3c6d127814614c;hpb=27d44cf6e0eaaa75979510596d6148193a8434c0;p=libsigrok.git diff --git a/bindings/ruby/classes.i b/bindings/ruby/classes.i index 96bd3770..13496a86 100644 --- a/bindings/ruby/classes.i +++ b/bindings/ruby/classes.i @@ -41,10 +41,10 @@ which provides access to the error code and description." %module(docstring=DOCSTRING) sigrok %{ +#include "config.h" + #include #include - -#include "config.h" %} %include "../swig/templates.i" @@ -113,6 +113,7 @@ static VALUE variant_to_ruby(Glib::VariantBase variant) } else { SWIG_exception(SWIG_TypeError, ("TODO: GVariant(" + variant.get_type().get_string() + ") -> Ruby").c_str()); } + return 0; /* Dummy, to avoid a compiler warning. */ } %} @@ -140,7 +141,7 @@ static VALUE variant_to_ruby(Glib::VariantBase variant) VALUE string_obj = rb_external_str_new_with_enc(message.c_str(), message.length(), rb_utf8_encoding()); - VALUE args = rb_ary_new_from_args(2, log_obj, string_obj); + VALUE args = rb_ary_new3(2, log_obj, string_obj); rb_proc_call(*proc.get(), args); }; } @@ -176,7 +177,7 @@ static VALUE variant_to_ruby(Glib::VariantBase variant) SWIG_as_voidptr(new std::shared_ptr(packet)), SWIGTYPE_p_std__shared_ptrT_sigrok__Packet_t, SWIG_POINTER_OWN); - VALUE args = rb_ary_new_from_args(2, device_obj, packet_obj); + VALUE args = rb_ary_new3(2, device_obj, packet_obj); rb_proc_call(*proc.get(), args); }; }