From: Ralf Papenkordt Date: 2010-08-22T06:44:59+09:00 Subject: Re: 1.9.2 breaks ncurses (STR2CSTR) - pls help R.. Kumar 1.9.1 OSX wrote: > I've tried various combinations. I either get runtime errors relating to > rb_str2ctr or just make errors. > > 1. $ perl -p -i.b -e 's/STR2CSTR/StringValuePtr/g' *.c > $ make > > form_wrap.c: In function ‘rbncurs_c_set_field_type’: > form_wrap.c:626: error: lvalue required as unary ‘&’ operand > form_wrap.c: In function ‘rbncurs_c_set_field_fore’: > form_wrap.c:698: warning: implicit conversion shortens 64-bit value into > a 32-bit value > form_wrap.c: In function ‘rbncurs_c_set_field_back’: > form_wrap.c:712: warning: implicit conversion shortens 64-bit value into > a 32-bit value > form_wrap.c: In function ‘make_arg’: > form_wrap.c:1134: warning: format not a string literal and no format > arguments > make: *** [form_wrap.o] Error 1 Unfortunately replacing STR2CSTR with StringValuePtr is not enough as outlined in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/105048. You have to make two additional changes: $ diff form_wrap.c form_wrap.c.b 626,627c626 < VALUE tmp = rb_ary_entry(arg3, (long)i); < list[i] = StringValuePtr(tmp); --- > list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i)); ... and $ diff ncurses_wrap.c ncurses_wrap.c.b ... 2244,2245d2243 < VALUE tmp = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, < argv + 1); 2247c2245,2246 < (VALUE)StringValuePtr(tmp)); --- > STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, > argv + 1))); ... Then run make make install within the installed ncurses gem. After these changes I was able to run the 2 testcases test1.rb and test2.rb of rbcurse-1.1.3. ruby test1.rb -- Posted via http://www.ruby-forum.com/.