search for: num2int

Displaying 20 results from an estimated 34 matches for "num2int".

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
2007 Apr 13
0
[961] branches/wxruby2/wxwidgets_282/swig: Move wxDateTime typemap into shared file, map to core Time class instead
...t;> #include <wx/calctrl.h> </span><span class="cx"> %} </span><span class="cx"> </span><ins>+ + +%typemap(in) wxCalendarDateBorder { +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$1 = (wxCalendarDateBorder)NUM2INT($input); +} + +%typemap(out) wxCalendarDateBorder { + $result = INT2NUM((int)$1); +} + </ins><span class="cx"> %ignore wxCalendarCtrl::wxCalendarCtrl(); </span><span class="cx"> </span><span class="cx"> %import "include/wxOb...
2007 Jun 26
0
[1084] trunk/wxruby2/swig/classes/SystemSettings.i: Fix missing punctuation in SystemSettings typemaps
...6,12 +6,12 @@ </span><span class="cx"> %module wxSystemSettings </span><span class="cx"> GC_MANAGE_AS_OBJECT(wxSystemSettings); </span><span class="cx"> </span><del>-%typemap(in) wxSystemColour "$1 = (wxSystemColour)NUM2INT($input)"; -%typemap(out) wxSystemColour " $result = INT2NUM((int)$1)"; -%typemap(in) wxSystemFont "$1 = (wxSystemFont)NUM2INT($input)"; -%typemap(out) wxSystemFont "$result = INT2NUM((int)$1)"; -%typemap(in) wxSystemMetric "$1 = (wxSystemMetric)NUM2INT($input...
2007 Jun 26
0
[1080] trunk/wxruby2/swig: Moved typemaps specific to SystemSetting out of general typemap file
...-6,6 +6,13 @@ </span><span class="cx"> %module wxSystemSettings </span><span class="cx"> GC_MANAGE_AS_OBJECT(wxSystemSettings); </span><span class="cx"> </span><ins>+%typemap(in) wxSystemColour "$1 = (wxSystemColour)NUM2INT($input)"; +%typemap(out) wxSystemColour " $result = INT2NUM((int)$1)"; +%typemap(in) wxSystemFont "$1 = (wxSystemFont)NUM2INT($input)"; +%typemap(out) wxSystemFont "$result = INT2NUM((int)$1)"; +%typemap(in) wxSystemMetric "$1 = (wxSystemMetric)NUM2INT($input...
2006 Aug 24
4
typemap.i patch
This patch adds %directorout typemaps for the GetTextExtent functions _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2006 Sep 20
3
Fix for non-centered windows
Two patches here: First one removes virtual from a function that shouldn''t have been virtual. Second one applies a typemap to catch GetRectFromChildWindow. For reasons that are completely beyond me the standard ruby OUTPUT typemaps don''t define directorargouts. I will take a stab at patching SWIG''s default typemaps someday so we get this fixed for free on all our
2007 Jun 25
0
[1072] trunk/wxruby2/swig/shared/datetime.i: Add typemap for DateTime::WeekDay; plug mem leak with wxDateTime arg
...lude <wx/datetime.h> </span><span class="cx"> %} </span><span class="cx"> </span><del>-%typemap(in) const wxDateTime& { </del><ins>+%typemap(in) wxDateTime& { </ins><span class="cx"> int y = NUM2INT(rb_funcall($input, rb_intern("year"), 0)); </span><span class="cx"> int rMonth = NUM2INT(rb_funcall($input, rb_intern("month"), 0)); </span><span class="cx"> int rDay = NUM2INT(rb_funcall($input, rb_intern("mday"), 0)...
2007 Jun 23
0
[1064] trunk/wxruby2/swig/Events.i: Removed unused func, updated comments
...span><span class="cx"> } </span><span class="cx"> </span><del>-static VALUE connect_fnc(int argc, VALUE *argv, VALUE self) -{ - if (argc != 3) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)", argc); - - int id = NUM2INT(argv[0]); - int lastId = NUM2INT(argv[1]); - int type = NUM2INT(argv[2]); - - internal_connect(self, id, lastId, type); - return Qnil; -} - </del><span class="cx"> %} </span></span></pre> </div> </div> </body> </html>
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
2004 Nov 16
0
Re: Win32, file descriptors and rb_io_check_writable()
...ough wordpad handles them properly). I guess I should find an >octal dump tool for windows to verify. Hopefully, you''ll see what I >mean. > Sorry if you receive this message again. My mail account seems to be messed. That is due to detault translation mode. Insert _setmode(NUM2INT(args[0]),_O_TEXT); after RFILE(self)->fptr->mode = rb_io_mode_flags("w+"); RFILE(self)->fptr->f = rb_fdopen(NUM2INT(args[0]),"w+"); in case of TEXT MODE. >Regards, > >Dan Regards, Park Heesob --MIME Multi-part separator--
2004 Nov 16
0
Re: Win32, file descriptors and rb_io_check_writable()
Hi Park, > That is due to detault translation mode. > > Insert > _setmode(NUM2INT(args[0]),_O_TEXT); > after > RFILE(self)->fptr->mode = rb_io_mode_flags("w+"); > RFILE(self)->fptr->f = rb_fdopen(NUM2INT(args[0]),"w+"); > in case of TEXT MODE. Ah, thanks. On a side note, any clue as to why Nobu''s suggestion doesn'&...
2006 Sep 21
1
typemap.i.patch: The Next Generatio
OK, I figured it out. It was basically right the first time. I was bit in the backside by macro side effects. Turns out NUM2INT causes its argument to be called twice so it was double shifting. This version doesn''t do that. Roy _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2007 May 29
0
[1035] trunk/wxruby2/swig/classes/EvtHandler.i: Removed a heap of redundant stuff that''s been #if 0''d for a while
...->Connect(firstId, lastId, eventType, function, userData); -} - -static VALUE internal_evt_with_id(int argc, VALUE *argv, VALUE self, - wxEventType eventType) -{ - if (argc != 1) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); - - int id = NUM2INT(argv[0]); - //printf("evt_with_id(%d) %s\n", id, rb_block_given_p() ? "with block" : ""); - - internal_connect(self, id, id, eventType); - return Qnil; -} - -static VALUE internal_evt_with_id_range(int argc, VALUE *argv, VALUE self, - wxEventType event...
2007 May 31
0
[1039] trunk/wxruby2/swig/Events.i: Remove some debugging output
...or, "wrong # of arguments(%d for 1)",argc); </span><span class="cx"> </span><span class="lines">@@ -299,7 +297,6 @@ </span><span class="cx"> </span><span class="cx"> int idStart = NUM2INT(argv[0]); </span><span class="cx"> int idEnd = NUM2INT(argv[1]); </span><del>- //printf("evt_with_id(%d) %s\n", id, rb_block_given_p() ? "with block" : ""); </del><span class="cx"> </span><span cl...
2008 Jan 11
9
[ wxruby-Bugs-17013 ] Notebook#get_current_page
Bugs item #17013, was opened at 2008-01-11 06:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=17013&group_id=35 Category: Missing API call Group: None Status: Open Resolution: None Priority: 3 Submitted By: Daniel Brumbaugh Keeney (db-keen) Assigned to: Nobody (None) Summary: Notebook#get_current_page Initial Comment: Notebook#get_current_page
2005 Jan 20
1
ChangeNotify help wanted
Hi all, I''ve checked in some code to win32-changenotify. Unfortunately, it doesn''t work right. I need some help. I don''t understand what, exactly, I''m supposed to pass to ReadDirectoryChangesW() for the 2nd argument, nor how to read the data back out. There''s also a WCHAR issue that needs to be worked out with regards to the FileName
2006 Dec 30
1
wxTreeItemId
...s deleted. Rather than trying to fix this. I''m wondering if it''s easier to do away with the wxTreeItemId class, and just use typemaps to convert these to ruby Integers (as in 0.6.0). The following seems to work for me: %typemap(in) wxTreeItemId& "$1 = new wxTreeItemId(NUM2INT($input));" %typemap(directorin) wxTreeItemId& "$input = LONG2NUM( (long)$1.m_pItem );" %typemap(out) wxTreeItemId "$result = LONG2NUM( (long)$1.m_pItem );" I''m not sure the overhead of directors etc is needed for TreeItemId - the only method that wxTreeItemId...
2006 Sep 20
1
typemap.i.patch
This patch implements a more generic solution to the problem that will work for all our integer types at least. Use this instead of the last version I sent, please. Roy _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2004 Nov 07
2
Problems with DeviceIoControl()
...RD dwBytesReturned; int fn; USHORT inBuf = COMPRESSION_FORMAT_DEFAULT; if((rbBool != Qtrue) && (rbBool != Qfalse)){ rb_raise(rb_eTypeError,"Argument must be true or false"); } if(rbBool == Qfalse){ inBuf = COMPRESSION_FORMAT_NONE; } fn = NUM2INT(rb_funcall(self,rb_intern("fileno"),0,0)); h = (HANDLE)_get_osfhandle(fn); // Get HANDLE based on fileno if(h == INVALID_HANDLE_VALUE){ rb_raise(cFileError,ErrorDescription(GetLastError())); } rv = DeviceIoControl( h, FSCTL_SET_COMPRESSION, (LPVOID...
2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...; #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, uint64_t offset) } static int +plugin_rb_zero (void *handle, uint32_t count, uint64_t offset, int may_trim) +{ + volatile VALUE argv[4]; + + argv[0] =...