diff options
author | Jose <jose@zeroc.com> | 2019-06-22 00:29:53 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-22 00:29:53 +0200 |
commit | c5959fd09de61604bedd75354401df6a57395d65 (patch) | |
tree | 3b0227f631c8b20fb1a1a274b92f63f52f34af2c /ruby/src/IceRuby/Util.h | |
parent | Small fix (diff) | |
parent | Enable -Wconversion with clang - Close #363 (diff) | |
download | ice-c5959fd09de61604bedd75354401df6a57395d65.tar.bz2 ice-c5959fd09de61604bedd75354401df6a57395d65.tar.xz ice-c5959fd09de61604bedd75354401df6a57395d65.zip |
Merge remote-tracking branch 'origin/3.7' into swift
Diffstat (limited to 'ruby/src/IceRuby/Util.h')
-rw-r--r-- | ruby/src/IceRuby/Util.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ruby/src/IceRuby/Util.h b/ruby/src/IceRuby/Util.h index 19fa928d392..765278b5555 100644 --- a/ruby/src/IceRuby/Util.h +++ b/ruby/src/IceRuby/Util.h @@ -8,6 +8,14 @@ #include <Config.h> #include <Ice/Ice.h> +// +// Avoid clang conversion warnings in "callRuby" calls +// +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wconversion" +# pragma clang diagnostic ignored "-Wsign-conversion" +#endif + namespace IceRuby { @@ -228,7 +236,7 @@ class RF_2 public: RF_2(Fun f, T1 t1, T2 t2) : _f(f), _t1(t1), _t2(t2) {} - inline VALUE operator()() { return _f(_t1, _t2); } + inline VALUE operator()(){ return _f(_t1, _t2); } static inline VALUE call(VALUE f) { return (*reinterpret_cast<RF_2*>(f))(); @@ -468,8 +476,6 @@ inline void callRubyVoid(Fun fun, T1 t1, T2 t2, T3 t3, T4 t4) callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); } -VALUE createArrayHelper(long); - // // Create an array with the given size. May raise RubyException. // @@ -485,11 +491,7 @@ VALUE createArrayHelper(long); // RARRAY_ASET(arr, i, val); // } // -template<typename T> -inline VALUE createArray(T sz) -{ - return createArrayHelper(static_cast<long>(sz)); -} +VALUE createArray(long); // // Create the Ruby equivalent of an Ice local exception. |