Граф коммитов

267 Коммитов

Автор SHA1 Сообщение Дата
naruse 6b1cf264a8 * ext/sdbm/_sdbm.c (sdbm_open): use size_t.
* ext/syck/bytecode.c: ditto.

* ext/sdbm/_sdbm.c (delpair): use ptrdiff_t.

* ext/sdbm/init.c: use RSTRING_LENINT.

* ext/dl/handle.c: suppress warning: shorten-64-to-32.

* ext/strscan/strscan.c: ditto.

* ext/syck/emitter.c: ditto.

* ext/syck/implicit.c: ditto.

* ext/syck/syck.c: ditto.

* ext/syck/token.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-25 06:46:57 +00:00
akr 698960439d * ext/dl/cfunc.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-11 14:17:24 +00:00
akr ac2c1a2968 * ext/dl/dl.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-10 14:12:57 +00:00
tenderlove 20e2c4cb36 * Use _WIN32 rather than checking for windows.h. Thanks Jon Forums!
[ruby-core:33977]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 03:13:18 +00:00
luislavena 5d47965174 * ext/dl/win32/registry.rb: Corrected RegCreateKeyExA signature.
Patch by Rafal Michalski [ruby-core:33874] [Ruby 1.9-Bug#4203]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 19:33:46 +00:00
naruse b2ea6df3b5 * ext/dl/lib/dl/struct.rb: clean a warning: assigned but unused
variable. patched by Kouhei Yanagita. [ruby-dev:42722]

* ext/dl/lib/dl/import.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-08 13:29:25 +00:00
usa b00dfcca17 * ext/dl/callback/mkcallback.rb (gencallback): shouldn't assume that
VALUE is the same size with long.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-25 01:31:21 +00:00
nobu cea3919ae6 * configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf format
specifier if possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 15:03:51 +00:00
usa c6465aeeb1 * ext/dl/cfunc.c (rb_dlcfunc_call): workaround for VC9 for x64.
reported by kuwamoto shintaro in [ruby-dev:42125].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-24 18:46:24 +00:00
usa f89a50b62c * ext/dl/win32/lib/win32/resolv.rb (get_info): get rid of a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-10 11:17:00 +00:00
nobu c53664c84d .cvsignore: have not been used already. [Bug #3468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
nobu 062b4d6752 * include/ruby/{intern,io}.h: add missing prototypes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22 03:02:40 +00:00
nobu 25b9eb5e57 * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]
add parent member.

* error.c (rb_typeddata_inherited_p): new function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18 07:31:54 +00:00
nobu 7aa4c13360 * ext/dl/handle.c (rb_dlhandle_close): should not pass a dynamic
string to rb_raise directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-13 11:46:01 +00:00
tenderlove ff10d93563 * ext/dl/lib/dl/import.rb (handler): add a more helpful error message
when calling import_symbol or import_function without calling
  dlload.  Thanks nobu! [ruby-core:30996]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05 23:38:35 +00:00
tarui db4a0d42dd * ext/dl/lib/dl/func.rb (call): don't overwrite original arguments
to defend from GC.
	* test/dl/test_func.rb (test_string): add test for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-25 19:43:15 +00:00
naruse 75033ea16f * ext/dl/lib/dl.rb: don't require when already loaded.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-12 15:28:47 +00:00
nobu da0ac85107 * ext/dl/cfunc.c (rb_dlcfunc_inspect): should taint the result.
[ruby-dev:41533]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-04 01:46:36 +00:00
nobu 8984ef4705 * ext/dl/cfunc.c (rb_dlcfunc_inspect): suppress warnings by
rb_sprintf.

* ext/dl/cptr.c (rb_dlptr_s_malloc): suppress warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-03 10:33:57 +00:00
usa fdc4326702 * ext/dl/dl.h (DLSTACK_TYPE): type of stack is same as VALUE.
reported by sakiyama shin in [ruby-dev:41514]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-03 00:38:59 +00:00
tenderlove 230ca5ffe5 * ext/dl/lib/dl/cparser.rb (parse_ctype): add backwards compatibility
by supporting "uint" types in the c parser. [ruby-core:29750]
* test/dl/test_cparser.rb: adding a test for "uint" changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-02 16:02:48 +00:00
nobu 87af442f94 * suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 09:10:23 +00:00
tenderlove 4bada8b864 * ext/fiddle/*: Adding fiddle library to wrap libffi
* test/fiddle/*: testing fiddle extension
* ext/dl/lib/dl.rb: Requiring fiddle if it is available
* ext/dl/lib/dl/callback.rb: using Fiddle if it is available
* ext/dl/lib/dl/func.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-06 06:59:24 +00:00
nobu 765ff64b10 * ext/dl/cfunc.c (rb_dlcfunc_call): ignore signedness.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-02 08:25:15 +00:00
nobu 977267c2e0 * ext/**/*.[ch]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
usa a3bd9a86e8 * ext/dl/win32/lib/win32/registry.rb (PredefinedKey#create): root key
name should be a string.  fixed [ruby-core:28192]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 12:34:57 +00:00
naruse e41936441b Surpress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-06 03:01:52 +00:00
nobu be30c131da * ext/dl/cptr.c (rb_dlptr_inspect): fix format specifiers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-01 22:00:42 +00:00
wanabe 7e2fa5adf4 * ext/dl/lib/dl/pack.rb (DL#pack): allow LLP64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-19 16:20:56 +00:00
naruse 59e4e93ef7 * ext/dl: revert dl with libffi because it can't run on mswin now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-25 22:49:20 +00:00
nobu 711ed72b79 * ext/dl/dl_conversions.c (rb_dl_type_to_ffi_type): support signed
long long.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-17 06:34:48 +00:00
nobu f953483787 * ext/dl/cfunc.c (rb_dlcfunc_inspect): get rid of overflow.
* ext/dl/closure.c (dlc_callback, rb_dlclosure_init): ditto.

* ext/dl/cptr.c (rb_dlptr_s_malloc): ditto.

* ext/dl/method.c (rb_dlfunction_initialize): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-17 05:26:33 +00:00
nobu 6840870291 * ext/dl/depend: updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-17 05:18:39 +00:00
nobu 4d71618c38 * ext/dl/cfunc.c (rb_dlcfunc_call): convert signed value to
unsigned.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-16 10:19:24 +00:00
nobu da2497745e * test/dl/test_{base,handle}.rb: use more verbose assertions.
* test/dl/test_import.rb (DL::LIBC::BoundQsortCallback): renamed
  to get rid of overwriting warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-16 10:03:02 +00:00
tenderlove 8f8947a260 * ext/dl/method.c: Adding DL::Method as a superclass for DL::Function
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-16 02:05:46 +00:00
tenderlove e5657a6584 * ext/dl/function.c: using ULONG2NUM to fix tests on i686.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15 23:52:08 +00:00
nobu 22ba8368ae * ext/dl/{closure,function}.c: removed C99 features and warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 02:39:18 +00:00
tenderlove b386fe21ec Wed Feb 3 10:12:09 2010 Aaron Patterson <tenderlove@ruby-lang.org>
* ext/dl/function.c: DL::Function now uses libffi

        * ext/dl/cfunc.c (rb_dl_set_last_error): set to non static so errors
          can be exposed.

        * ext/dl/closure.c: DL::Closure will now be used in place of
          ext/dl/callback/*.

        * ext/dl/dl.c: legacy callbacks removed in favor of libffi

        * ext/dl/dl_converions.(c,h): used for converting ruby types to FFI
          types.

        * ext/dl/callback/*: replaced by libffi callbacks.

        * ext/dl/lib/dl/callback.rb: Converting internal callbacks to use
          DL::Closure

        * ext/dl/lib/dl/closure.rb: Ruby parts of the new DL::Closure object

        * ext/dl/lib/dl/import.rb: More conversion to use DL::Closure object

        * ext/dl/lib/dl/value.rb (ruby2ffi): adding private method for
          DL::CPtr to ffi value conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 01:23:48 +00:00
tenderlove 6a1aebaabf * ext/dl/cptr.c (to_int): DL::CPtr supports to_int
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-04 23:21:01 +00:00
tenderlove 17ccd5d013 * ext/dl/cptr.c (rb_dlptr_s_to_ptr): when wrapping a pointer it should
keep a reference to the object it's wrapping
* test/dl/test_func.rb use standard test methods

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-12 22:41:07 +00:00
tenderlove 5de564634d * ext/dl/cfunc.c (**) updating documentation
* test/dl/test_cfunc.rb (test_ptr=, test_ptr) testing the pointer
  accessor methods on CFunc

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-08 00:21:41 +00:00
tenderlove a56bd8c31a * ext/dl/cptr.c (rb_dlptr_inspect): making inspect consistent across
platforms
* test/dl/test_cptr.rb (test_inspect): testing inspect

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-07 21:37:27 +00:00
tenderlove 35da6fdcf1 * ext/dl/cfunc.c (rb_dlcfunc_initialize): cleaning up C macros
* ext/dl/cfunc.c (**): adding documentation
* test/dl/test_cfunc.rb (test_set_calltype) testing calltype

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 22:50:40 +00:00
tenderlove bc52ea0fde * ext/dl/cptr.c (rb_dlptr_s_malloc, rb_dlptr_initialize): adding
documentation
* test/dl/test_cptr.rb (**): testing that malloc works when passed free
  functions

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 22:50:05 +00:00
tenderlove 5296367cf4 * ext/dl/cptr.c (rb_dlptr_to_str, rb_dlptr_to_s) adding documentation
* test/dl/test_cptr.rb (test_to_str, test_to_s) testing the
  stringification of DL::Ptr

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 18:29:31 +00:00
tenderlove c2d7621d8d * ext/dl/cptr.c (rb_dlptr_inspect, rb_dlptr_plus, rb_dlptr_minus)
documenting +, -, inspect
* text/dl/test_cptr.rb (test_minus, test_plus, test_inspect) testing
  minus, plus, and inspect

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 18:02:30 +00:00
tenderlove 02d55ac989 * test/dl/test_cptr.rb (test_to_ptr*): testing DL::CPtr#to_ptr
* ext/dl/cptr.c (rb_dlptr_free_set, rb_dlptr_free_get,
  rb_dlptr_s_to_ptr): adding documentation, fixing indentation

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 20:28:20 +00:00
tenderlove c30e32d075 * ext/dl/cptr.c (rb_dlptr_eql, rb_dlptr_cmp): DL::CPtr#== and DL::CPtr#<=>
should not raise an exception when compared to a different object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:12:46 +00:00
naruse 7539e11a7f * ext/dl/win32/lib/win32/registry.rb: update rdoc. [ruby-core:26022]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-02 02:24:11 +00:00