search for: qnil

Displaying 20 results from an estimated 82 matches for "qnil".

Did you mean: nil
2004 Jul 31
3
Bug in new_work_item
Hi all, Windows 2000 Ruby 1.8.2 R7 VC++ 6.0 I noticed that if I try to call new_work_item and give the task a name that already exists, I get a segfault: C:\eclipse\workspace\win32-taskscheduler>ruby test.rb "0.1.0" test.rb:22:in `new_work_item'': NewWorkItem() function failed (Win32::TaskSchedul erError) from test.rb:22 test.rb:22: [BUG] Segmentation fault ruby
2004 Oct 23
0
win32-ipc, with blocks (code review please)
...IT_OBJECT_0 + 1); // signalled } if((dwWait >= WAIT_ABANDONED_0) && (dwWait < WAIT_ABANDONED_0 + len)){ return INT2NUM(-(dwWait - WAIT_ABANDONED_0 + 1)); // an abandoned mutex } if(dwWait == WAIT_TIMEOUT){ return INT2NUM(0); // Timed out } return Qnil; } static VALUE ipc_wait_any(int argc, VALUE* argv, VALUE klass) { VALUE rbObject, rbTimeout; DWORD dwTimeout = INFINITE; rb_scan_args(argc,argv,"11",&rbObject,&rbTimeout); if(TYPE(rbObject)!=T_ARRAY) { rb_raise(rb_eArgError,"Invalid Object Handles&qu...
2006 Dec 23
0
[794] trunk/wxruby2: Fix get_ruby_object so it works with SWIG tracking, move find_window_xx
...object(wxObject *obj) </del><ins>+static VALUE get_ruby_object(wxObject *wx_obj) </ins><span class="cx"> { </span><del>-&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( ! obj ) </del><ins>+ if ( ! wx_obj ) return Qnil; + + // Get the wx class and the ruby class we are converting into + wxString class_name( wx_obj->GetClassInfo()->GetClassName() ); + VALUE r_class; + if ( class_name.Len() > 2 ) </ins><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&...
2007 Jul 21
0
[1135] trunk/wxruby2/swig/mark_free_impl.i: Convert from DOS to Unix newlines
...amp;nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn false; -} - -// Notes that the window has been signalled as destroyed by a -// WindowDestroyEvent handled by wxRubyApp -void GC_SetWindowDeleted(void *ptr) -{ - VALUE rb_win = SWIG_RubyInstanceFor(ptr); - if ( rb_win != Qnil ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp rb_ivar_set(rb_win, wx_destroyed_sym, Qtrue); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp SWIG_RubyUnlinkObjects(ptr...
2004 Mar 11
5
win32-etc-0.2.2 testing wanted
I''ve commited code for win32-etc 0.2.2, which adds the configure_user and configure_group methods. Testing appreciated. On my home system, I can''t get configure_user to work, but I haven''t any real idea why it fails. The configure_group method seems to work fine, however. Dan _________________________________________________________________ Fast. Reliable. Get
2007 Sep 05
0
[ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
...integer data. Right now this is accepted: @lst.set_item_data(x,[x,x]) I don''t know how it supposed to work, but it seems that the ruby object is converted to long and then back (ListCtrl.i): VALUE get_item_data(int row) { if ( row < 0 || row >= self->GetItemCount() ) return Qnil; long item_data = self->GetItemData(row); if ( item_data == 0 ) return Qnil; return (VALUE)item_data; } VALUE set_item_data(int row, VALUE ruby_obj) { if ( row < 0 || row >= self->GetItemCount() ) { rb_raise(rb_eIndexError, "Uninitialized item"); } long it...
2006 Dec 07
0
Fwd: win32-service problems with patch
...// this might be over engineering the solution, but I don''t - // want to block Service_Ctrl longer than necessary and the - // critical section will block it. - VALUE val = rb_hash_aref(EventHookHash, INT2NUM(waiting_control_code)); - if(val!=Qnil) { - VALUE thread = rb_thread_create(Service_Event_Dispatch, (void*) val); - rb_funcall(thread_group, cAdd, 1, thread); + if (waiting_control_code != SERVICE_CONTROL_STOP) { + // if there is a code, create a ruby thread to deal with it +...
2007 Sep 04
4
listctrl set_item_data
Hi, I have used set_item_data with ruby objects (an array) and got a crash. The reason is simple, the objects were deallocated by the GC. The easy solution would be to accept only long parameters (like the original interface). The hard is to play by the GC''s rules and increase the reference count and decrease on deletion. Regards, teki
2017 Feb 02
3
[nbdkit PATCH 0/2] Ruby bindings for .zero
Similar to python and perl. But MUCH easier (especially considering that this is the first time I've every tried to run Ruby). I even had fun making set_error() polymorphic. Eric Blake (2): ruby: Expose nbdkit_set_error to ruby script ruby: Support zero callback plugins/ruby/example.rb | 11 ++++++++ plugins/ruby/nbdkit-ruby-plugin.pod | 54
2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...p;nbsp&nbsp&nbsp&nbspreturn returnVal; </span><span class="cx"> } </span><ins>+ + VALUE get_item_data(int row) + { +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( row < 0 || row >= self->GetItemCount() ) return Qnil; +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsplong item_data = self->GetItemData(row); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( item_data == 0 ) return Qnil; +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp...
2007 Jul 21
0
[1127] trunk/wxruby2: Move shared C++ GC functions into separate file included into wx.i
...amp;nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn false; +} + +// Notes that the window has been signalled as destroyed by a +// WindowDestroyEvent handled by wxRubyApp +void GC_SetWindowDeleted(void *ptr) +{ + VALUE rb_win = SWIG_RubyInstanceFor(ptr); + if ( rb_win != Qnil ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp rb_ivar_set(rb_win, wx_destroyed_sym, Qtrue); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp} +} + +// Carries out marki...
2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...index fc2e8ad..33d7968 100644 --- a/plugins/ruby/ruby.c +++ b/plugins/ruby/ruby.c @@ -36,12 +36,14 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> +#include <errno.h> #include <nbdkit-plugin.h> #include <ruby.h> static VALUE nbdkit_module = Qnil; +static int last_error; static VALUE set_error(VALUE self, VALUE arg) @@ -58,6 +60,7 @@ set_error(VALUE self, VALUE arg) } else { err = NUM2INT(arg); } + last_error = err; nbdkit_set_error(err); return Qnil; } @@ -367,6 +370,30 @@ plugin_rb_trim (void *handle, uint32_t count,...
2007 Oct 25
2
Using strtok via win32/api
Hi all, I''m having a little trouble with strtok: require ''win32/api'' include Win32 strtok = API.new(''strtok'', ''PP, ''P'', ''msvcrt'') string = "A string\tof ,,tokens\nand some more tokens"; seps = " ,\t\n"; puts "Tokens:" token = strtok.call(string, seps) while token puts
2006 Oct 22
0
[707] trunk/wxruby2/swig/classes/Window.i: Window-paint method now implemented in Ruby (Alex Fenton)
...t causes swig to define SWIGTYPE_p_wxPaintDC -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp// which is needed by our paint() method - VALUE this_should_never_be_called(wxPaintDC *tmp) { -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp return Qnil; - } - - VALUE paint() - { -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp wxWindow *ptr = self; -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp if(rb_block_...
2007 Mar 21
4
Problem with PaintDC(MSW)
When implementing EVT_PAINT handlers in c++ the PaintDC object is constructed at the beginning of the function, and auto destructed at it''s end, which informs wxwidgets that "invalid regions in the window have been repainted". Under ruby, this is not the case and causes a stream of EVT_PAINT events to be sent to the given window (until one of PaintDC objects is destructed by
2007 May 21
0
[1026] trunk/wxruby2/swig/shared/control_with_items.i: Memory mgmt: USe __wx_destroyed__ instead of __swig_dead__; fix some
...amp;nbsp&nbsp&nbsp&nbspif ( returnVal == NULL ) </del><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( returnVal ) </ins><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp return Qnil; </span><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn returnVal; </span><span class="cx"> } </span><span class="lines">@@ -22,7 +22,7 @@ </span><span class="cx"&...
2011 Aug 25
4
[PATCH 0/3] ruby: Fix event handler failure
I won't pretend I really understand what's going on here. I've CC'd this message to Chris since he might have a better idea. https://bugzilla.redhat.com/show_bug.cgi?id=733297 In this bug, it appears that the event log callback goes out of scope and is garbage collected. (This is despite the fact we registered it as a global root). When we invoke the callback later,
2007 May 21
0
[1022] trunk/wxruby2/swig/classes/App.i: Memory mgmt: use Wx::App to mark still-alive Windows, set up Wx::THE_APP const
...p;nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsprb_gc_mark(rb_obj); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp } +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn Qnil; + } + + static void mark_wxRubyApp(void *ptr) + { + +#ifdef __WXDEBUG__ +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspprintf("=== Starting App GC mark phase\n"); +#endif + +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp// If the App...
2007 Jul 20
0
[1123] trunk/wxruby2/swig/wx.i: Check sizers being marked have a ruby rep and are not internal Wx-only,
...quot;> void GC_SetWindowDeleted(void *ptr) </span><span class="cx"> { </span><span class="cx"> VALUE rb_win = SWIG_RubyInstanceFor(ptr); </span><del>- rb_ivar_set(rb_win, wx_destroyed_sym, Qtrue); </del><ins>+ if ( rb_win != Qnil ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsprb_ivar_set(rb_win, wx_destroyed_sym, Qtrue); </ins><span class="cx"> } </span><span class="cx"> </span><span class="cx"> // Carries out marking of Sizer obj...
2006 Aug 15
0
Problem with directors and Ruby
...e input parameter''s name and type gets confused with the second parameter''s type (relevant lines from sample.cpp): void SwigDirector_wxWindow::GetTextExtent(wxString const &string, int *x, int *y, int *descent, int *externalLeading, wxFont const *font) const { VALUE obj0 = Qnil ; VALUE obj1 = Qnil ; VALUE result; if (swig_get_up()) { wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font); return; } obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&string), SWIGTYPE_p_wxString, 0 ); obj1 = SWIG_NewPointerObj(SWIG_as_voidptr(x), SWIGTYPE_p_int, 0 );...