aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
...
* * bignum.c (rb_ll2big): Don't overflow on signed integer negation.akr2013-04-101-0/+24
| | | | | | | | | | | | * ext/bigdecimal/bigdecimal.c (MUL_OVERFLOW_SIGNED_VALUE_P): New macro. (AddExponent): Don't overflow on signed integer multiplication. (VpCtoV): Don't overflow on signed integer arithmetic. (VpCtoV): Don't overflow on signed integer arithmetic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2013-04-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix #6154 by introducing new EAGAIN/EWOULDBLOCK/EINPROGRESSheadius2013-04-084-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | subclasses that include WaitReadable or WaitWritable rather than extending them into the exception object each time. * error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and export them for use in WaitReadable/Writable exceptions. * io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail for nonblocking failures using those exceptions. Use that function in io_getpartial and io_write_nonblock instead of rb_mod_sys_fail * ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include WaitReadable and WaitWritable. Use those classes for write_would_block and read_would_block instead of rb_mod_sys_fail. * ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in bsock_sendmsg_internal and bsock_recvmsg_internal. * ext/socket/init.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in rsock_s_recvfrom_nonblock and rsock_s_connect_nonblock. * ext/socket/socket.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in sock_connect_nonblock. * include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket/extconf.rb: add -Dnobu2013-04-081-1/+1
| | | | | | | * ext/socket/extconf.rb: $defs needs -D or -U. nothing is added otherwize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket/extconf.rb: check struct in_addr6nobu2013-04-081-0/+4
| | | | | | | * ext/socket/extconf.rb: check struct in_addr6, which is defined in VC6 instead of in6_addr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* option.c: fix macro namenobu2013-04-081-1/+1
| | | | | | * ext/socket/option.c (optname_to_sym): fix macro name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* constants.c: fix macro namenobu2013-04-081-1/+1
| | | | | | * ext/socket/constants.c (rsock_cmsg_type_arg): fix macro name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32ole.c: check aritynobu2013-04-081-0/+2
| | | | | | | * ext/win32ole/win32ole.c (fole_missing): should check actual argument count before accessing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (rsock_sys_fail_raddrinfo): Renamed fromakr2013-04-062-9/+9
| | | | | | | | | | | | rsock_sys_fail_addrinfo. (rsock_sys_fail_raddrinfo_or_sockaddr): Renamed from rsock_sys_fail_addrinfo_or_sockaddr. * ext/socket/rubysocket.h: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (rsock_sys_fail_sockaddr): Takes struct sockaddrakr2013-04-062-8/+9
| | | | | | | | | | | | and socklen_t instead of String object. (rsock_sys_fail_addrinfo_or_sockaddr): Follow the above change. * ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket/extconf.rb: RSTRING_SOCKLENnobu2013-04-066-13/+20
| | | | | | | * ext/socket/extconf.rb (RSTRING_SOCKLEN): macro to cast RSTRING_LEN to socklen_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket.c: suppress warningsnobu2013-04-061-1/+1
| | | | | | | * ext/socket/socket.c (rsock_sys_fail_sockaddr): cast down explicitly to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/rubysocket.h (SockAddrStringValueWithAddrinfo): New macro.akr2013-04-063-14/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | (rsock_sockaddr_string_value_with_addrinfo): New declaration. (rsock_addrinfo_inspect_sockaddr): Ditto. (rsock_sys_fail_addrinfo): Ditto. (rsock_sys_fail_sockaddr_or_addrinfo): Ditto. * ext/socket/raddrinfo.c (rsock_addrinfo_inspect_sockaddr): Renamed from addrinfo_inspect_sockaddr and exported. (rsock_sockaddr_string_value_with_addrinfo): New function to obtain string and possibly addrinfo object. * ext/socket/socket.c (rsock_sys_fail_sockaddr): Don't use rsock_sys_fail_host_port which is IP dependent. Invoke rsock_sys_fail_addrinfo. (rsock_sys_fail_addrinfo): New function using rsock_addrinfo_inspect_sockaddr. (rsock_sys_fail_addrinfo_or_sockaddr): New function. (sock_connect): Use SockAddrStringValueWithAddrinfo and rsock_sys_fail_addrinfo_or_sockaddr. (sock_connect_nonblock): Ditto. (sock_bind): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (rsock_sys_fail_sockaddr): Delete 2nd argument.akr2013-04-062-6/+6
| | | | | | | | | * ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (rsock_sys_fail_path): Use rb_str_inspect onlyakr2013-04-061-7/+12
| | | | | | | | for String to avoid SEGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/rubysocket.h (rsock_sys_fail_host_port) Wrap by NORETURN.akr2013-04-061-3/+3
| | | | | | | | | (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (rsock_sys_fail_path): Use rb_str_inspect if theakr2013-04-061-3/+10
| | | | | | | | path contains a NUL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket: Improve socket exception message to show socket address.akr2013-04-067-28/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-core:45617] [Feature #6583] proposed Eric Hodel. * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Declared. (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. * ext/socket/udpsocket.c (udp_connect): Use rsock_sys_fail_host_port. (udp_bind): Ditto. (udp_send): Ditto. * ext/socket/init.c (rsock_init_sock): Specify a string for rb_sys_fail argument. (make_fd_nonblock): Ditto. (rsock_s_accept): Ditto. * ext/socket/ipsocket.c (init_inetsock_internal): Use rsock_sys_fail_host_port. * ext/socket/socket.c (rsock_sys_fail_host_port): Defined. (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. (setup_domain_and_type): Use rsock_sys_fail_sockaddr. (sock_connect_nonblock): Ditto. (sock_bind): Ditto. (sock_gethostname): Specify a string for rb_sys_fail argument. (socket_s_ip_address_list): Ditto. * ext/socket/basicsocket.c (bsock_shutdown): Specify a string for rb_sys_fail argument. (bsock_setsockopt): Use rsock_sys_fail_path. (bsock_getsockopt): Ditto. (bsock_getpeereid): Refine the argument for rb_sys_fail. * ext/socket/unixsocket.c (rsock_init_unixsock): Use rsock_sys_fail_path. (unix_path): Ditto. (unix_send_io): Ditto. (unix_recv_io): Ditto. (unix_addr): Ditto. (unix_peeraddr): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych/visitors/yaml_tree.rb: fix symbol keys in codertenderlove2013-04-051-1/+1
| | | | | | | emission. Thanks @tjwallace * test/psych/test_coder.rb: test for change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych/exception.rb: there should be only one exceptiontenderlove2013-04-054-10/+11
| | | | | | | | | base class. Fixes tenderlove/psych #125 * ext/psych/lib/psych.rb: require the correct exception class * ext/psych/lib/psych/syntax_error.rb: ditto * ext/psych/lib/psych/visitors/to_ruby.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych/visitors/to_ruby.rb: correctly registertenderlove2013-04-051-7/+17
| | | | | | | | self-referential strings. Fixes tenderlove/psych #135 * test/psych/test_string.rb: appropriate test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/init.c (cloexec_accept): Fix a compile error onakr2013-04-051-1/+5
| | | | | | | | | Debian GNU/kFreeBSD. Consider HAVE_ACCEPT4 is defined but SOCK_CLOEXEC is not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/-test-/win32/dln: remove static librarynobu2013-04-051-0/+1
| | | | | | * ext/-test-/win32/dln/extconf.rb: remove static library too at clean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dl/dl.h: suppress warningnobu2013-04-051-1/+1
| | | | | | * ext/dl/dl.h (dlopen): suppress unused-but-set-variable warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* curses.c: fix functionnobu2013-04-051-1/+1
| | | | | | | * ext/curses/curses.c (Init_curses): fix implementation function, crmode should be same as cbreak. [ruby-core:54013] [Bug #8222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/curses/hello.rb: Typo in Curses example by Drew Blaszzak2013-04-051-1/+1
| | | | | | | [Fixes GH-273] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Remove condition for bcc.akr2013-04-042-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/pathname/pathname.c (path_write): New method.akr2013-04-041-0/+44
| | | | | | | | | (path_binwrite): Ditto. [ruby-core:49468] [Feature #7378] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_bn.c (ossl_bn_to_i): Use bn2hex to speed up.naruse2013-04-041-2/+2
| | | | | | In general, binary to/from decimal needs extra cost. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Specify arguments to test functions.akr2013-04-031-23/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_bn.c (ossl_bn_initialize): fix can't create from bn.naruse2013-04-031-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Test functions and libraries after headers.akr2013-04-031-21/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/extmk.rb (extmake): Invoke Logging::log_close in a ensureakr2013-04-031-2/+1
| | | | | | | | clause. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/extmk.rb (extmake): Use Logging.open to switch stdout andakr2013-04-031-13/+7
| | | | | | | | | | | | | stderr. Delay Logging::log_close until the failure message is written. Write the failure message only if log file is opened. * lib/mkmf.rb (Logging.log_opened?): New method. [ruby-dev:47215] [Bug #8209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c: Bignum zero comparisonnobu2013-04-033-0/+33
| | | | | | | | * bignum.c (rb_big_eq): test as Fixnum if possible and get rid of zero length Bignum. [ruby-core:53893] [Bug #8204] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/-test-/num2int/num2int.c: Define utility methodsakr2013-04-021-13/+15
| | | | | | | | | | as module methods of Num2int. * test/-ext-/num2int/test_num2int.rb: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/-test-/num2int/num2int.c: Rename utility methodsakr2013-04-011-15/+13
| | | | | | | | | | to global functions to ease manual experiments. * test/-ext-/num2int/test_num2int.rb: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (rb_gzfile_set_mtime): Use NUM2UINT.akr2013-04-011-7/+3
| | | | | | | | | | | | | | | The old logic doesn't work well on LP64 platforms as: .. -2**63-1 => error, -2**63 .. -2**62-1 => success, -2**62 .. -2**31-1 => error, -2**31 .. 2**31-1 => success, 2**31 .. 2**62-1 => error, 2**62 .. 2**64-1 => success, 2**64 .. => error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (Zlib::Inflate.new):eregon2013-04-011-2/+2
| | | | | | | Fix documentation syntax and naming errors. Based on patch by Robin Dupret. Fix GH-271. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/-test-/num2int/num2int.c: Return string for result, instead ofakr2013-04-011-91/+39
| | | | | | | | | | printing. * test/-ext-/num2int/test_num2int.rb: updated to follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sha2.c: suppress warningsnobu2013-04-011-3/+6
| | | | | | | * ext/digest/sha2/sha2.c (SHA256_Final, SHA512_Last): suppress strict-aliasing warnings on gcc 4.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (FIX2ULONG): Make it consistent with NUM2ULONG.akr2013-03-311-0/+68
| | | | | | | | | | * ext/-test-/num2int/num2int.c: Add utility methods for FIX2XXX tests. * test/-ext-/num2int/test_num2int.rb: Add tests for FIX2XXX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* code cleanup by @vipulnsward [GH fixes #267]hsbt2013-03-292-3/+0
| | | | | | | | | | * lib/cgi/core.rb: change each to each_value * ext/bigdecimal/lib/bigdecimal/{jacobian,math}.rb: remove unused variables from bigdecimal lib git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tcltklib.c: rb_thread_alive_p macronobu2013-03-281-5/+1
| | | | | | | * ext/tk/tcltklib.c (rb_thread_alive_p): turn into a macro, so that same code is generated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tcltklib.c: suppress warningsnobu2013-03-281-10/+25
| | | | | | | | * ext/tk/tcltklib.c (lib_eventloop_core, lib_thread_callback), (ip_rbUpdateCommand, ip_rb_threadUpdateCommand, lib_toUTF8_core), (ip_invoke_core): remove unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c: adjust nestingnobu2013-03-282-77/+21
| | | | | | | | | | | | | | | * ext/tk/extconf.rb: check for rb_thread_alive_p and rb_thread_check_trap_pending. * ext/tk/tcltklib.c (rb_thread_alive_p, rb_thread_check_trap_pending): define substitutions if not available. * ext/tk/tcltklib.c (lib_eventloop_core, lib_eventloop_ensure), (lib_thread_callback, ip_rbUpdateCommand, ip_rbVwaitCommand), (ip_rbTkWaitCommand, call_queue_handler, eval_queue_handler), (invoke_queue_handler): adjust nesting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sockaddr_len): return the shortest length forakr2013-03-261-1/+1
| | | | | | | unknown socket address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warningsnaruse2013-03-231-14/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Use Qnil and NIL_Pmrkn2013-03-231-4/+4
| | | | | | | | | | | | instead of (VALUE)0 as a return value. * ext/bigdecimal/bigdecimal.c (BigDecimal_div): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_remainder): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: Fix style.mrkn2013-03-221-1659/+1720
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e