From c76033cae0fc9f60fc939c877bb7b08dd4131055 Mon Sep 17 00:00:00 2001 From: Lars Kanis <lars@greiz-reinsdorf.de> Date: Thu, 13 Mar 2014 20:10:48 +0100 Subject: [PATCH] =?UTF-8?q?Avoid=20warning:=20../../../../ext/fox16=5Fc/fr?= =?UTF-8?q?ames=5Fwrap.cpp:=20In=20function=20=E2=80=98VALUE=20FXGradientB?= =?UTF-8?q?ar=5Fgradient(FX::FXGradientBar*,=20FX::FXint)=E2=80=99:=20../.?= =?UTF-8?q?./../../ext/fox16=5Fc/frames=5Fwrap.cpp:2465:37:=20warning:=20z?= =?UTF-8?q?ero-length=20gnu=5Fprintf=20format=20string=20[-Wformat-zero-le?= =?UTF-8?q?ngth]=20=20=20=20=20=20=20=20=20=20=20=20rb=5Fraise(rb=5FeNoMem?= =?UTF-8?q?Error,"");=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?^?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- swig-interfaces/FXGradientBar.i | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/swig-interfaces/FXGradientBar.i b/swig-interfaces/FXGradientBar.i index 7d4da20..706fcf1 100644 --- a/swig-interfaces/FXGradientBar.i +++ b/swig-interfaces/FXGradientBar.i @@ -239,19 +239,18 @@ public: if(FXMALLOC(&ramp,FXColor,nramp)){ self->gradient(ramp,nramp); ary=rb_ary_new2(nramp); - for(i=0; i<nramp; i++){ - rb_ary_store(ary,i,to_ruby(ramp[i])); - } - FXFREE(&ramp); - return ary; - } - else{ - rb_raise(rb_eNoMemError,""); + for(i=0; i<nramp; i++){ + rb_ary_store(ary,i,to_ruby(ramp[i])); } + FXFREE(&ramp); + return ary; + }else{ + rb_raise(rb_eNoMemError,"Out of memory"); } + } else{ return rb_ary_new(); - } + } } } -- GitLab