search for: ull2num

Displaying 8 results from an estimated 8 matches for "ull2num".

2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...r; 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] = (VALUE) handle; + argv[1] = ULL2NUM (count); + argv[2] = ULL2NUM (offset); + argv[3] = may_trim ? Qtrue : Qfalse; + exception_happened = 0; + last_error = 0; + (void) funcall2 (Qnil, rb_intern ("zero"), 4, argv); + if (last_error == EOPNOTSUPP || + exception_happened == EXCEPTION_NO_METHOD_ERROR) { + nbdkit_de...
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,
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 May 21
6
Possible problems with EventLog#write
Hi, I''ve got EventLog#write and EventLog.add_event_source methods done. Well, I *think* they''re done, but I can''t get the data (text) to work properly, and I''m not sure if it''s a bug in my .mc file, the add_event_source method, the write method, or just a goof in my test file. The source, category and event id seem to be ok. However, the
2011 Dec 08
0
[hivex] [PATCH 2/8] generator: Add new return type to ABI: RLenValue
...pr " return rv;\n" + | RLenValue -> + pr " VALUE rv = rb_hash_new ();\n"; + pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n"; + pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"off\")), ULL2NUM (r));\n"; + pr " return rv;\n" | RLenTypeVal -> pr " VALUE rv = rb_hash_new ();\n"; pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n"; -- 1.7.6.4
2011 Oct 19
1
[hivex][PATCH 2/8] generator: Add new return type to ABI: RLenValue
...pr " return rv;\n" + | RLenValue -> + pr " VALUE rv = rb_hash_new ();\n"; + pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n"; + pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"off\")), ULL2NUM (r));\n"; + pr " return rv;\n" | RLenTypeVal -> pr " VALUE rv = rb_hash_new ();\n"; pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n"; -- 1.7.4.4
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...(match fst style with | RErr -> - pr " return Qnil;\n" + pr " return Qnil;\n" | RInt _ | RBool _ -> - pr " return INT2NUM (r);\n" + pr " return INT2NUM (r);\n" | RInt64 _ -> - pr " return ULL2NUM (r);\n" + pr " return ULL2NUM (r);\n" | RConstString _ -> - pr " return rb_str_new2 (r);\n"; + pr " return rb_str_new2 (r);\n"; | RConstOptString _ -> - pr " if (r)\n"; - pr " return rb_str_n...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...(match argt with @@ -483,7 +484,7 @@ Init__guestfs (void) List.iter ( fun (name, bitmask) -> pr " rb_define_const (m_guestfs, \"EVENT_%s\",\n" - (String.uppercase name); + (String.uppercase_ascii name); pr " ULL2NUM (UINT64_C (0x%x)));\n" bitmask; ) events; pr " rb_define_const (m_guestfs, \"EVENT_ALL\",\n"; diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml index 21ef6e3..8b98927 100644 --- a/generator/tests_c_api.ml +++ b/generator/tests_c_api.ml @@ -20,6 +20,7 @...