Displaying 9 results from an estimated 9 matches for "rarray_len".
Did you mean:
array_len
2009 Feb 17
2
install.rb:655:in `command'': system("make") failed (RuntimeError) (GatoLinux)
I am using ruby *1.8.4* (2005-12-24).
I added this code:
#define RARRAY_LEN(a) \
((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? \
(long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
(RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)) : \
RARRAY(a)->as.heap.len)
#define RARRAY_PTR(a) \
((RBASIC(a)->flags & RARRAY_EMBE...
2011 Jan 05
0
Fwd: Review of libguestfs ruby bindings
...will get back a valid string (even if it is empty), or the
interpreter will raise an exception (in which case the rest of your function
won't be called anyway).
7) In ruby_guestfs_test0() and other places, there is code like:
Check_Type (strlistv, T_ARRAY);
{
size_t i, len;
len = RARRAY_LEN (strlistv);
strlist = guestfs_safe_malloc (g, sizeof (char *) * (len+1));
for (i = 0; i < len; ++i) {
VALUE v = rb_ary_entry (strlistv, i);
strlist[i] = StringValueCStr (v);
}
strlist[len] = NULL;
}
Unfortunately this can cause a memory leak. I have an upcoming bl...
2008 Nov 11
6
Build problem with ruby-1.9.1-preview1
Hi all,
I wanted to have a look at wxRuby on a recent version of ruby 1.9
(ruby-1.9.1-preview1) on Ubuntu 8.10 x86.
Here is the result :
chauk-mean at MyUbuntu:~/wxruby2$ ruby19 -v
ruby 1.9.1 (2008-10-28 revision 19983) [i686-linux]
chauk-mean at MyUbuntu:~/wxruby2$ rake19 WXRUBY_VERSION=1.9.9 gem
(in /home/chauk-mean/wxruby2)
Enabling DYNAMIC build
Enabling RELEASE build
Enabling UNICODE build
2007 Jan 08
0
[846] trunk/wxruby2/swig/classes/MultiChoiceDialog.i: Fixed - don''t use Ruby 1.9-style API calls cos this breaks older SWIGs
...8 23:12:07 UTC (rev 846)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- for (int i = 0; i < RARRAY_LEN($input); i++)
</del><ins>+ for (int i = 0; i < RARRAY($input)->len; i++)
</ins><span class="cx"> {
</span><span class="cx"> int item = NUM2INT(rb_ary_entry($input,i));
</span><span class="cx"> tmp...
2011 Dec 07
1
[PATCH] hivex: Fix Ruby bindings for 1.9; let the user explicitly choose ruby, rake
...[test "x$RAKE" != "xno" && test -n "$HAVE_LIBRUBY"])
diff --git a/generator/generator.ml b/generator/generator.ml
index 065c25d..dd13d6a 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -3265,6 +3265,14 @@ and generate_ruby_c () =
#define RARRAY_LEN(r) (RARRAY((r))->len)
#endif
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(r) (RSTRING((r))->len)
+#endif
+
+#ifndef RSTRING_PTR
+#define RSTRING_PTR(r) (RSTRING((r))->ptr)
+#endif
+
static VALUE m_hivex; /* hivex module */
static VALUE c_hivex; /* hive_h handle */
static VALUE e_Err...
2007 Jan 08
0
[845] trunk/wxruby2/swig/classes: Added MultiChoiceDialog in class form
...for SetSelections - note that GetSelectiosn is dealt with the standard
+// typemap(out) ArrayInt in typemap.i
+%typemap(in) const wxArrayInt& selections (wxArrayInt tmp){
+ if (($input == Qnil) || (TYPE($input) != T_ARRAY))
+ {
+ $1 = &tmp;
+ }
+ else
+ {
+ for (int i = 0; i < RARRAY_LEN($input); i++)
+ {
+ int item = NUM2INT(rb_ary_entry($input,i));
+ tmp.Add(item);
+ }
+ $1 = &tmp;
+ }
+}
+
+%import "include/wxObject.h"
+%import "include/wxWindow.h"
+%import "include/wxEvtHandler.h"
+%import "include/wxDialog.h"
+
+%...
2009 Jul 14
4
[ActiveRecord::Base].collect {|a,b| ...} weirdness
Hey everyone.
My mind has been boggled by an issue I ran into a few hours ago. I am
completely lost as to why the following code behaves the way it does
and would appreciate any hints from you guys. It would already be
super-helpful if others could post their output for the following so
that I can figure out whether this is weirdness specific to my setup
or a global phenomenon.
So far,
2012 Aug 14
7
[PATCH 0/7] Add tar compress, numericowner, excludes flags.
https://bugzilla.redhat.com/show_bug.cgi?id=847880
https://bugzilla.redhat.com/show_bug.cgi?id=847881
This patch series adds various optional arguments to the tar-in and
tar-out commands.
Firstly (1/7) an optional "compress" flag is added to select
compression. This makes the calls tgz-in/tgz-out/txz-in/txz-out
deprecated, and expands the range of compression types available.
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...pr " const char *%s = !NIL_P (%sv) ? StringValueCStr (%sv) : NULL;\n" n n n
- | StringList n ->
- pr " char **%s;\n" n;
- pr " Check_Type (%sv, T_ARRAY);\n" n;
- pr " {\n";
- pr " int i, len;\n";
- pr " len = RARRAY_LEN (%sv);\n" n;
- pr " %s = guestfs_safe_malloc (g, sizeof (char *) * (len+1));\n"
- n;
- pr " for (i = 0; i < len; ++i) {\n";
- pr " VALUE v = rb_ary_entry (%sv, i);\n" n;
- pr " %s[i] = StringValueCStr (v);\n" n;
-...