1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/socket.c (Init_socket): remove obsolete constants:

IPsocket, TCPsocket, SOCKSsocket, TCPserver, UDPsocket,
  UNIXsocket, UNIXserver.

* eval.c (formal_assign): post splat arguments should have had
  higher priority than optional arguments, since they are
  mandatory.  [ruby-dev:28715]

* eval.c (VIS_MASK): broken. should be 15.  [ruby-dev:28715]

* io.c (argf_getc): should return one-character string.
  [ruby-dev:28715]

* io.c (rb_io_readchar): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-06-13 11:31:27 +00:00
parent f2ded65a58
commit 5a712cfb8c
5 changed files with 34 additions and 15 deletions

View file

@ -1,3 +1,22 @@
Tue Jun 13 17:22:19 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (Init_socket): remove obsolete constants:
IPsocket, TCPsocket, SOCKSsocket, TCPserver, UDPsocket,
UNIXsocket, UNIXserver.
Tue Jun 13 09:07:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (formal_assign): post splat arguments should have had
higher priority than optional arguments, since they are
mandatory. [ruby-dev:28715]
* eval.c (VIS_MASK): broken. should be 15. [ruby-dev:28715]
* io.c (argf_getc): should return one-character string.
[ruby-dev:28715]
* io.c (rb_io_readchar): ditto.
Sun Jun 11 23:20:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (sym_call): disallow to call private methods.
@ -21,6 +40,7 @@ Sun Jun 11 04:38:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (sym_to_proc): imported Symbol#to_proc from ActiveSupport.
>>>>>>> 1.5068
Sat Jun 10 18:02:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/lib/bigdecimal/newton.rb (Newton::nlsolve): typo

16
eval.c
View file

@ -254,7 +254,7 @@ static int vis_mode;
#define VIS_PROTECTED 2
#define VIS_MODFUNC 5
#define VIS_LOCAL 8
#define VIS_MASK 16
#define VIS_MASK 15
#define VIS_SET(f) (vis_mode=(f))
#define VIS_TEST(f) (vis_mode&(f))
#define VIS_MODE() (vis_mode)
@ -5555,6 +5555,7 @@ formal_assign(VALUE recv, NODE *node, int argc, const VALUE *argv, VALUE *local_
{
int i;
int nopt = 0;
int npost = 0;
if (nd_type(node) != NODE_ARGS) {
rb_bug("no argument-node");
@ -5591,18 +5592,23 @@ formal_assign(VALUE recv, NODE *node, int argc, const VALUE *argv, VALUE *local_
}
}
argv += i; argc -= i;
if (node->nd_rest && nd_type(node->nd_rest) == NODE_POSTARG) {
npost = node->nd_rest->nd_head->nd_alen;
}
if (node->nd_opt) {
NODE *opt = node->nd_opt;
int ac = argc - npost;
while (opt && argc) {
while (opt && ac) {
assign(recv, opt->nd_head, *argv, 1);
argv++; argc--;
argv++; ac--;
++i;
opt = opt->nd_next;
}
if (opt) {
rb_eval(recv, opt);
}
argc = ac + npost;
}
if (!node->nd_rest) {
i = nopt;
@ -5613,9 +5619,7 @@ formal_assign(VALUE recv, NODE *node, int argc, const VALUE *argv, VALUE *local_
if (argc > 0) {
int n = 1;
v = rb_ary_new4(argc,argv);
if (nd_type(node->nd_rest) == NODE_POSTARG) {
n += node->nd_rest->nd_head->nd_alen;
}
n += npost;
i += n*256;
}
else {

View file

@ -3642,7 +3642,6 @@ Init_socket()
rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup=", bsock_do_not_reverse_lookup_set, 1);
rb_cIPSocket = rb_define_class("IPSocket", rb_cBasicSocket);
rb_define_global_const("IPsocket", rb_cIPSocket);
rb_define_method(rb_cIPSocket, "addr", ip_addr, 0);
rb_define_method(rb_cIPSocket, "peeraddr", ip_peeraddr, 0);
rb_define_method(rb_cIPSocket, "recvfrom", ip_recvfrom, -1);
@ -3650,13 +3649,11 @@ Init_socket()
rb_define_singleton_method(rb_cIPSocket, "getaddress", ip_s_getaddress, 1);
rb_cTCPSocket = rb_define_class("TCPSocket", rb_cIPSocket);
rb_define_global_const("TCPsocket", rb_cTCPSocket);
rb_define_singleton_method(rb_cTCPSocket, "gethostbyname", tcp_s_gethostbyname, 1);
rb_define_method(rb_cTCPSocket, "initialize", tcp_init, -1);
#ifdef SOCKS
rb_cSOCKSSocket = rb_define_class("SOCKSSocket", rb_cTCPSocket);
rb_define_global_const("SOCKSsocket", rb_cSOCKSSocket);
rb_define_method(rb_cSOCKSSocket, "initialize", socks_init, 2);
#ifdef SOCKS5
rb_define_method(rb_cSOCKSSocket, "close", socks_s_close, 0);
@ -3664,7 +3661,6 @@ Init_socket()
#endif
rb_cTCPServer = rb_define_class("TCPServer", rb_cTCPSocket);
rb_define_global_const("TCPserver", rb_cTCPServer);
rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0);
rb_define_method(rb_cTCPServer, "accept_nonblock", tcp_accept_nonblock, 0);
rb_define_method(rb_cTCPServer, "sysaccept", tcp_sysaccept, 0);
@ -3672,7 +3668,6 @@ Init_socket()
rb_define_method(rb_cTCPServer, "listen", sock_listen, 1);
rb_cUDPSocket = rb_define_class("UDPSocket", rb_cIPSocket);
rb_define_global_const("UDPsocket", rb_cUDPSocket);
rb_define_method(rb_cUDPSocket, "initialize", udp_init, -1);
rb_define_method(rb_cUDPSocket, "connect", udp_connect, 2);
rb_define_method(rb_cUDPSocket, "bind", udp_bind, 2);
@ -3680,7 +3675,6 @@ Init_socket()
#ifdef HAVE_SYS_UN_H
rb_cUNIXSocket = rb_define_class("UNIXSocket", rb_cBasicSocket);
rb_define_global_const("UNIXsocket", rb_cUNIXSocket);
rb_define_method(rb_cUNIXSocket, "initialize", unix_init, 1);
rb_define_method(rb_cUNIXSocket, "path", unix_path, 0);
rb_define_method(rb_cUNIXSocket, "addr", unix_addr, 0);
@ -3693,7 +3687,6 @@ Init_socket()
rb_define_singleton_method(rb_cUNIXSocket, "pair", unix_s_socketpair, -1);
rb_cUNIXServer = rb_define_class("UNIXServer", rb_cUNIXSocket);
rb_define_global_const("UNIXserver", rb_cUNIXServer);
rb_define_method(rb_cUNIXServer, "initialize", unix_svr_init, 1);
rb_define_method(rb_cUNIXServer, "accept", unix_accept, 0);
rb_define_method(rb_cUNIXServer, "accept_nonblock", unix_accept_nonblock, 0);

4
io.c
View file

@ -2039,7 +2039,7 @@ rb_getc(FILE *f)
static VALUE
rb_io_readchar(VALUE io)
{
VALUE c = rb_io_getc(io);
VALUE c = rb_io_getc_m(io);
if (NIL_P(c)) {
rb_eof_error();
@ -5356,7 +5356,7 @@ argf_getc(void)
ch = rb_funcall3(current_file, rb_intern("getc"), 0, 0);
}
else {
ch = rb_io_getc(current_file);
ch = rb_io_getc_m(current_file);
}
if (NIL_P(ch) && next_p != -1) {
argf_close(current_file);

View file

@ -13,6 +13,7 @@
**********************************************************************/
#include "ruby.h"
#include "re.h"
#include <ctype.h>
#include <math.h>
#include <stdarg.h>
@ -428,6 +429,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
len = prec;
}
}
/* need to adjust multi-byte string pos */
if (flags&FWIDTH) {
if (width > len) {
CHECK(width);