mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (top_include): include in the wrapped load is done for
the wrapper, not for a singleton class for wrapped main. [ruby-dev:23305] * bignum.c (rb_big_eq): use temporary double variable to save the result (internal float register may be bigger than 64 bits, for example, 80 bits on x86). [ruby-dev:23311] * eval.c (block_pass): should generate unique identifier of the pushing block. [ruby-talk:96363] * ext/socket/socket.c (make_hostent): fix memory leak, based on the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1b33576053
commit
849bc0234a
32 changed files with 197 additions and 137 deletions
36
ChangeLog
36
ChangeLog
|
@ -34,11 +34,34 @@ Sat Apr 3 17:11:05 2004 why the lucky stiff <why@ruby-lang.org>
|
|||
* ext/syck/rubyext.c: handle base60, as well as hex and octal
|
||||
with commas. implicit typing of ruby symbols.
|
||||
|
||||
Fri Apr 2 17:27:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (top_include): include in the wrapped load is done for
|
||||
the wrapper, not for a singleton class for wrapped main.
|
||||
[ruby-dev:23305]
|
||||
|
||||
Fri Apr 2 15:13:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* bignum.c (rb_big_eq): use temporary double variable to save the
|
||||
result (internal float register may be bigger than 64 bits, for
|
||||
example, 80 bits on x86). [ruby-dev:23311]
|
||||
|
||||
Fri Apr 2 14:35:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (block_pass): should generate unique identifier of the
|
||||
pushing block. [ruby-talk:96363]
|
||||
|
||||
Fri Apr 2 07:31:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/socket/socket.c (make_hostent): fix memory leak, based on
|
||||
the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>.
|
||||
|
||||
Thu Apr 1 19:58:37 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
|
||||
|
||||
* lib/soap/mapping/{factory.rb,registry.rb}: fixed illegal mapped URI
|
||||
object with soap/marshal.
|
||||
added URIFactory class for URI mapping. BasetypeFactory checks
|
||||
|
||||
Thu Apr 1 22:55:33 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/rdoc/parsers/parse_rb.rb: Allow rdoc comments in
|
||||
|
@ -98,6 +121,11 @@ Sat Mar 27 10:40:48 2004 Tanaka Akira <akr@m17n.org>
|
|||
* (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
|
||||
instead of PrettyPrint.
|
||||
|
||||
Thu Mar 25 23:28:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* time.c (time_overflow_p): backport 1.9 usec overflow function.
|
||||
(ruby-bugs PR#1307)
|
||||
|
||||
Thu Mar 25 23:15:24 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/rdoc/ri/ri_options.rb (RI::Options::show_version):
|
||||
|
@ -169,6 +197,14 @@ Sat Mar 20 20:57:10 2004 David Black <dblack@wobblini.net>
|
|||
* lib/scanf.rb: Backported 1.9 branch
|
||||
modifications/corrections to 1.8 branch
|
||||
|
||||
Sat Mar 20 23:51:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_require_safe): preserve old ruby_errinfo.
|
||||
[ruby-talk:95409]
|
||||
|
||||
* eval.c (rb_f_raise): should not clear backtrace information if
|
||||
exception object already have one.
|
||||
|
||||
Sat Mar 20 15:25:36 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/rdoc/generators/template/html/html.rb (RDoc::Page): Force
|
||||
|
|
2
array.c
2
array.c
|
@ -1767,7 +1767,7 @@ rb_ary_select(argc, argv, ary)
|
|||
long i;
|
||||
|
||||
if (argc > 0) {
|
||||
rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
result = rb_ary_new2(RARRAY(ary)->len);
|
||||
for (i = 0; i < RARRAY(ary)->len; i++) {
|
||||
|
|
11
bignum.c
11
bignum.c
|
@ -962,10 +962,13 @@ rb_big_eq(x, y)
|
|||
case T_BIGNUM:
|
||||
break;
|
||||
case T_FLOAT:
|
||||
if (rb_big2dbl(x) == RFLOAT(y)->value)
|
||||
return Qtrue;
|
||||
else
|
||||
return Qfalse;
|
||||
{
|
||||
double a, b;
|
||||
|
||||
a = RFLOAT(y)->value;
|
||||
b = rb_big2dbl(x);
|
||||
return (a == b)?Qtrue:Qfalse;
|
||||
}
|
||||
default:
|
||||
return rb_equal(y, x);
|
||||
}
|
||||
|
|
19
eval.c
19
eval.c
|
@ -4448,7 +4448,8 @@ rb_f_raise(argc, argv)
|
|||
if (argc > 0) {
|
||||
if (!rb_obj_is_kind_of(mesg, rb_eException))
|
||||
rb_raise(rb_eTypeError, "exception object expected");
|
||||
set_backtrace(mesg, (argc>2)?argv[2]:Qnil);
|
||||
if (argc>2)
|
||||
set_backtrace(mesg, argv[2]);
|
||||
}
|
||||
|
||||
if (ruby_frame != top_frame) {
|
||||
|
@ -4890,7 +4891,7 @@ massign(self, node, val, pcall)
|
|||
}
|
||||
if (pcall && list) goto arg_error;
|
||||
if (node->nd_args) {
|
||||
if (node->nd_args == (NODE*)-1) {
|
||||
if ((int)(node->nd_args) == -1) {
|
||||
/* no check for mere `*' */
|
||||
}
|
||||
else if (!list && i<len) {
|
||||
|
@ -5591,7 +5592,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
|||
rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
|
||||
argc, i);
|
||||
}
|
||||
if (node->nd_rest == -1) {
|
||||
if ((int)node->nd_rest == -1) {
|
||||
int opt = i;
|
||||
NODE *optnode = node->nd_opt;
|
||||
|
||||
|
@ -5626,7 +5627,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
|||
}
|
||||
}
|
||||
local_vars = ruby_scope->local_vars;
|
||||
if (node->nd_rest >= 0) {
|
||||
if ((int)node->nd_rest >= 0) {
|
||||
VALUE v;
|
||||
|
||||
if (argc > 0)
|
||||
|
@ -6747,6 +6748,7 @@ rb_require_safe(fname, safe)
|
|||
int safe;
|
||||
{
|
||||
VALUE result = Qnil;
|
||||
volatile VALUE errinfo = ruby_errinfo;
|
||||
int state;
|
||||
struct {
|
||||
NODE *node;
|
||||
|
@ -6824,7 +6826,7 @@ rb_require_safe(fname, safe)
|
|||
if (NIL_P(result)) {
|
||||
load_failed(fname);
|
||||
}
|
||||
ruby_errinfo = Qnil;
|
||||
ruby_errinfo = errinfo;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -7263,13 +7265,11 @@ top_include(argc, argv, self)
|
|||
{
|
||||
rb_secure(4);
|
||||
if (ruby_wrapper) {
|
||||
rb_warn("main#include in the wrapped load is effective only for toplevel");
|
||||
return rb_obj_extend(argc, argv, self);
|
||||
rb_warning("main#include in the wrapped load is effective only in wrapper module");
|
||||
return rb_mod_include(argc, argv, ruby_wrapper);
|
||||
}
|
||||
else {
|
||||
return rb_mod_include(argc, argv, rb_cObject);
|
||||
}
|
||||
}
|
||||
|
||||
VALUE rb_f_trace_var();
|
||||
VALUE rb_f_untrace_var();
|
||||
|
@ -8392,6 +8392,7 @@ block_pass(self, node)
|
|||
old_block = ruby_block;
|
||||
_block = *data;
|
||||
_block.outer = ruby_block;
|
||||
_block.uniq = block_unique++;
|
||||
ruby_block = &_block;
|
||||
PUSH_ITER(ITER_PRE);
|
||||
if (ruby_frame->iter == ITER_NOT)
|
||||
|
|
|
@ -595,7 +595,7 @@ iconv_s_iconv
|
|||
struct iconv_env_t arg;
|
||||
|
||||
if (argc < 2) /* needs `to' and `from' arguments at least */
|
||||
rb_raise(rb_eArgError, "wrong # of arguments (%d for %d)", argc, 2);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, 2);
|
||||
|
||||
arg.argc = argc -= 2;
|
||||
arg.argv = argv + 2;
|
||||
|
|
|
@ -63,7 +63,7 @@ ossl_x509_ary2sk0(VALUE ary)
|
|||
val = rb_ary_entry(ary, i);
|
||||
if (!rb_obj_is_kind_of(val, cX509Cert)) {
|
||||
sk_X509_pop_free(sk, X509_free);
|
||||
ossl_raise(eOSSLError, "object except X509 cert is in array");
|
||||
ossl_raise(eOSSLError, "object not X509 cert in array");
|
||||
}
|
||||
x509 = DupX509CertPtr(val); /* NEED TO DUP */
|
||||
sk_X509_push(sk, x509);
|
||||
|
|
|
@ -567,7 +567,7 @@ ossl_asn1_default_tag(VALUE obj)
|
|||
return i;
|
||||
}
|
||||
}
|
||||
ossl_raise(eASN1Error, "not found universal tag for %s",
|
||||
ossl_raise(eASN1Error, "universal tag for %s not found",
|
||||
rb_class2name(CLASS_OF(obj)));
|
||||
|
||||
return -1; /* dummy */
|
||||
|
@ -650,7 +650,7 @@ ossl_asn1data_initialize(VALUE self, VALUE value, VALUE tag, VALUE tag_class)
|
|||
if(!SYMBOL_P(tag_class))
|
||||
ossl_raise(eASN1Error, "invalid tag class");
|
||||
if((SYM2ID(tag_class) == sUNIVERSAL) && NUM2INT(tag) > 31)
|
||||
ossl_raise(eASN1Error, "too large tag number for Universal");
|
||||
ossl_raise(eASN1Error, "tag number for Universal too large");
|
||||
ossl_asn1_set_tag(self, tag);
|
||||
ossl_asn1_set_value(self, value);
|
||||
ossl_asn1_set_tag_class(self, tag_class);
|
||||
|
@ -865,13 +865,13 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
|
|||
if(NIL_P(tagging))
|
||||
tagging = ID2SYM(sEXPLICIT);
|
||||
if(!SYMBOL_P(tagging))
|
||||
ossl_raise(eASN1Error, "invelid tag default");
|
||||
ossl_raise(eASN1Error, "invalid tag default");
|
||||
if(NIL_P(tag_class))
|
||||
tag_class = ID2SYM(sCONTEXT_SPECIFIC);
|
||||
if(!SYMBOL_P(tag_class))
|
||||
ossl_raise(eASN1Error, "invelid tag class");
|
||||
ossl_raise(eASN1Error, "invalid tag class");
|
||||
if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
|
||||
ossl_raise(eASN1Error, "too large tag number for Universal");
|
||||
ossl_raise(eASN1Error, "tag number for Universal too large");
|
||||
}
|
||||
else{
|
||||
tag = INT2NUM(ossl_asn1_default_tag(self));
|
||||
|
|
|
@ -358,7 +358,7 @@ ossl_pkcs7_set_detached(VALUE self, VALUE flag)
|
|||
|
||||
GetPKCS7(self, p7);
|
||||
if(flag != Qtrue && flag != Qfalse)
|
||||
ossl_raise(ePKCS7Error, "must secify a boolean");
|
||||
ossl_raise(ePKCS7Error, "must specify a boolean");
|
||||
if(!PKCS7_set_detached(p7, flag == Qtrue ? 1 : 0))
|
||||
ossl_raise(ePKCS7Error, NULL);
|
||||
|
||||
|
|
|
@ -733,7 +733,7 @@ reduce0(val, data, self)
|
|||
|
||||
/* calculate transition state */
|
||||
if (RARRAY(v->state)->len == 0)
|
||||
rb_raise(RaccBug, "state stack unexpected empty");
|
||||
rb_raise(RaccBug, "state stack unexpectedly empty");
|
||||
k2 = num_to_long(LAST_I(v->state));
|
||||
k1 = num_to_long(reduce_to) - v->nt_base;
|
||||
D_printf("(goto) k1=%ld\n", k1);
|
||||
|
|
|
@ -83,7 +83,7 @@ readline_s_set_completion_proc(self, proc)
|
|||
VALUE proc;
|
||||
{
|
||||
if (!rb_respond_to(proc, rb_intern("call")))
|
||||
rb_raise(rb_eArgError, "argument have to respond to `call'");
|
||||
rb_raise(rb_eArgError, "argument must respond to `call'");
|
||||
return rb_iv_set(mReadline, COMPLETION_PROC, proc);
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ fsdbm_select(argc, argv, obj)
|
|||
struct dbmdata *dbmp;
|
||||
|
||||
if (argc > 0) {
|
||||
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
GetDBM(obj, dbmp);
|
||||
dbm = dbmp->di_dbm;
|
||||
|
|
|
@ -625,7 +625,8 @@ sock_addrinfo(host, port, socktype, flags)
|
|||
VALUE host, port;
|
||||
int socktype, flags;
|
||||
{
|
||||
struct addrinfo hints, *hintsp, *res;
|
||||
struct addrinfo hints;
|
||||
struct addrinfo* res = NULL;
|
||||
char *hostp, *portp;
|
||||
int error;
|
||||
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
|
||||
|
@ -637,13 +638,11 @@ sock_addrinfo(host, port, socktype, flags)
|
|||
socktype = SOCK_DGRAM;
|
||||
}
|
||||
|
||||
hintsp = &hints;
|
||||
MEMZERO(&hints, struct addrinfo, 1);
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_protocol = 0;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = socktype;
|
||||
hints.ai_flags = flags;
|
||||
error = getaddrinfo(hostp, portp, hintsp, &res);
|
||||
error = getaddrinfo(hostp, portp, &hints, &res);
|
||||
if (error) {
|
||||
if (hostp && hostp[strlen(hostp)-1] == '\n') {
|
||||
rb_raise(rb_eSocket, "newline at the end of hostname");
|
||||
|
@ -1043,39 +1042,43 @@ socks_s_close(sock)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static VALUE
|
||||
make_hostent(addr, ipaddr)
|
||||
struct hostent_arg {
|
||||
VALUE host;
|
||||
struct addrinfo* addr;
|
||||
VALUE (*ipaddr)_((struct sockaddr*, size_t));
|
||||
};
|
||||
|
||||
static VALUE
|
||||
make_hostent_internal(arg)
|
||||
struct hostent_arg *arg;
|
||||
{
|
||||
VALUE host = arg->host;
|
||||
struct addrinfo* addr = arg->addr;
|
||||
VALUE (*ipaddr)_((struct sockaddr*, size_t)) = arg->ipaddr;
|
||||
|
||||
struct addrinfo *ai;
|
||||
struct hostent *h;
|
||||
VALUE ary, names;
|
||||
char **pch;
|
||||
const char* hostp;
|
||||
char hbuf[NI_MAXHOST];
|
||||
|
||||
ary = rb_ary_new();
|
||||
rb_ary_push(ary, rb_str_new2(addr->ai_canonname));
|
||||
#if defined(HAVE_GETIPNODEBYNAME)
|
||||
{
|
||||
int error;
|
||||
|
||||
h = getipnodebyname(addr->ai_canonname, addr->ai_family, AI_ALL, &error);
|
||||
if (addr->ai_canonname) {
|
||||
hostp = addr->ai_canonname;
|
||||
}
|
||||
#elif defined(HAVE_GETHOSTBYNAME2)
|
||||
h = gethostbyname2(addr->ai_canonname, addr->ai_family);
|
||||
#else
|
||||
h = gethostbyname(addr->ai_canonname);
|
||||
#endif
|
||||
if (h) {
|
||||
else {
|
||||
hostp = host_str(host, hbuf, sizeof(hbuf));
|
||||
}
|
||||
rb_ary_push(ary, rb_str_new2(hostp));
|
||||
|
||||
if (addr->ai_canonname && (h = gethostbyname(addr->ai_canonname))) {
|
||||
names = rb_ary_new();
|
||||
if (h->h_aliases != NULL) {
|
||||
for (pch = h->h_aliases; *pch; pch++) {
|
||||
rb_ary_push(names, rb_str_new2(*pch));
|
||||
}
|
||||
}
|
||||
#if defined(HAVE_GETIPNODEBYNAME)
|
||||
freehostent(h);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
names = rb_ary_new2(0);
|
||||
|
@ -1089,6 +1092,22 @@ make_hostent(addr, ipaddr)
|
|||
return ary;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
make_hostent(host, addr, ipaddr)
|
||||
VALUE host;
|
||||
struct addrinfo* addr;
|
||||
VALUE (*ipaddr)_((struct sockaddr*, size_t));
|
||||
{
|
||||
VALUE ary;
|
||||
struct hostent_arg arg;
|
||||
|
||||
arg.host = host;
|
||||
arg.addr = addr;
|
||||
arg.ipaddr = ipaddr;
|
||||
ary = rb_ensure(make_hostent_internal, (VALUE)&arg,
|
||||
RUBY_METHOD_FUNC(freeaddrinfo), (VALUE)addr);
|
||||
}
|
||||
|
||||
VALUE
|
||||
tcp_sockaddr(addr, len)
|
||||
struct sockaddr *addr;
|
||||
|
@ -1102,7 +1121,7 @@ tcp_s_gethostbyname(obj, host)
|
|||
VALUE obj, host;
|
||||
{
|
||||
rb_secure(3);
|
||||
return make_hostent(sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), tcp_sockaddr);
|
||||
return make_hostent(host, sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), tcp_sockaddr);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -2013,7 +2032,7 @@ sock_s_gethostbyname(obj, host)
|
|||
VALUE obj, host;
|
||||
{
|
||||
rb_secure(3);
|
||||
return make_hostent(sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
|
||||
return make_hostent(host, sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -879,7 +879,7 @@ strio_read(argc, argv, self)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
if (NIL_P(str)) {
|
||||
str = rb_str_substr(ptr->string, ptr->pos, len);
|
||||
|
|
|
@ -146,7 +146,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
|
|||
VALUE pri;
|
||||
|
||||
if (argc < 2) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2+)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc);
|
||||
}
|
||||
|
||||
argc--;
|
||||
|
|
|
@ -811,7 +811,7 @@ ip_ruby(clientData, interp, argc, argv)
|
|||
|
||||
/* ruby command has 1 arg. */
|
||||
if (argc != 2) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments (%d for 1)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
|
||||
}
|
||||
|
||||
/* get C string from Tcl object */
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
#define OLEData_Get_Struct(obj, pole) {\
|
||||
Data_Get_Struct(obj, struct oledata, pole);\
|
||||
if(!pole->pDispatch) {\
|
||||
rb_raise(rb_eRuntimeError, "Fail to get Dispatch Interface");\
|
||||
rb_raise(rb_eRuntimeError, "failed to get Dispatch Interface");\
|
||||
}\
|
||||
}
|
||||
|
||||
|
@ -769,7 +769,7 @@ ole_val2variant(val, var)
|
|||
if(pub) free(pub);
|
||||
if(psab) free(psab);
|
||||
if(pid) free(pid);
|
||||
rb_raise(rb_eRuntimeError, "memory allocate error");
|
||||
rb_raise(rb_eRuntimeError, "memory allocation error");
|
||||
}
|
||||
val1 = val;
|
||||
i = 0;
|
||||
|
@ -907,7 +907,7 @@ ole_variant2val(pvar)
|
|||
if(pID) free(pID);
|
||||
if(pLB) free(pLB);
|
||||
if(pUB) free(pUB);
|
||||
rb_raise(rb_eRuntimeError, "memory allocate error");
|
||||
rb_raise(rb_eRuntimeError, "memory allocation error");
|
||||
}
|
||||
|
||||
obj = Qnil;
|
||||
|
@ -1361,7 +1361,7 @@ ole_create_dcom(argc, argv, self)
|
|||
if (!gole32)
|
||||
gole32 = LoadLibrary("OLE32");
|
||||
if (!gole32)
|
||||
rb_raise(rb_eRuntimeError, "Fail to load OLE32.");
|
||||
rb_raise(rb_eRuntimeError, "failed to load OLE32.");
|
||||
if (!gCoCreateInstanceEx)
|
||||
gCoCreateInstanceEx = (FNCOCREATEINSTANCEEX*)
|
||||
GetProcAddress(gole32, "CoCreateInstanceEx");
|
||||
|
@ -1388,7 +1388,7 @@ ole_create_dcom(argc, argv, self)
|
|||
SysFreeString(serverinfo.pwszName);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
|
||||
"Fail to create DCOM server : `%s' in `%s'",
|
||||
"failed to create DCOM server : `%s' in `%s'",
|
||||
StringValuePtr(ole),
|
||||
StringValuePtr(host));
|
||||
|
||||
|
@ -1415,7 +1415,7 @@ ole_bind_obj(moniker, argc, argv, self)
|
|||
hr = CreateBindCtx(0, &pBindCtx);
|
||||
if(FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
|
||||
"Fail to create bind context");
|
||||
"failed to create bind context");
|
||||
}
|
||||
|
||||
pbuf = ole_mb2wc(StringValuePtr(moniker), -1);
|
||||
|
@ -1492,7 +1492,7 @@ fole_s_connect(argc, argv, self)
|
|||
if(FAILED(hr)) {
|
||||
OLE_RELEASE(pUnknown);
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
|
||||
"Fail to create WIN32OLE server : `%s'",
|
||||
"failed to create WIN32OLE server : `%s'",
|
||||
StringValuePtr(svr_name));
|
||||
}
|
||||
|
||||
|
@ -1536,12 +1536,12 @@ fole_s_const_load(argc, argv, self)
|
|||
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
|
||||
0, lcid, &pTypeInfo);
|
||||
if(FAILED(hr)) {
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
|
||||
}
|
||||
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
|
||||
if(FAILED(hr)) {
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
|
||||
}
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
if(TYPE(klass) != T_NIL) {
|
||||
|
@ -1561,7 +1561,7 @@ fole_s_const_load(argc, argv, self)
|
|||
hr = LoadTypeLibEx(pBuf, REGKIND_NONE, &pTypeLib);
|
||||
SysFreeString(pBuf);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
|
||||
if(TYPE(klass) != T_NIL) {
|
||||
ole_const_load(pTypeLib, klass, self);
|
||||
}
|
||||
|
@ -1717,11 +1717,11 @@ fole_s_show_help(argc, argv, self)
|
|||
helpfile = target;
|
||||
}
|
||||
if (TYPE(helpfile) != T_STRING) {
|
||||
rb_raise(rb_eTypeError, "1st parametor must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD).");
|
||||
rb_raise(rb_eTypeError, "1st parameter must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD).");
|
||||
}
|
||||
hwnd = ole_show_help(helpfile, helpcontext);
|
||||
if(hwnd == 0) {
|
||||
rb_raise(rb_eRuntimeError, "fail to open help file:%s",
|
||||
rb_raise(rb_eRuntimeError, "failed to open help file:%s",
|
||||
StringValuePtr(helpfile));
|
||||
}
|
||||
return Qnil;
|
||||
|
@ -1775,7 +1775,7 @@ fole_initialize(argc, argv, self)
|
|||
&IID_IDispatch, (void**)&pDispatch);
|
||||
if(FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
|
||||
"Fail to create WIN32OLE object from `%s'",
|
||||
"failed to create WIN32OLE object from `%s'",
|
||||
StringValuePtr(svr_name));
|
||||
}
|
||||
|
||||
|
@ -1876,7 +1876,7 @@ ole_invoke(argc, argv, self, wFlags)
|
|||
rb_scan_args(argc, argv, "1*", &cmd, ¶mS);
|
||||
OLEData_Get_Struct(self, pole);
|
||||
if(!pole->pDispatch) {
|
||||
rb_raise(rb_eRuntimeError, "Fail to get dispatch interface.");
|
||||
rb_raise(rb_eRuntimeError, "failed to get dispatch interface.");
|
||||
}
|
||||
wcmdname = ole_mb2wc(StringValuePtr(cmd), -1);
|
||||
hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
|
||||
|
@ -2431,7 +2431,7 @@ fole_each(self)
|
|||
|
||||
if (FAILED(hr)) {
|
||||
VariantClear(&result);
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to get IEnum Interface");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to get IEnum Interface");
|
||||
}
|
||||
|
||||
if (V_VT(&result) == VT_UNKNOWN)
|
||||
|
@ -2444,7 +2444,7 @@ fole_each(self)
|
|||
(void**)&pEnum);
|
||||
if (FAILED(hr) || !pEnum) {
|
||||
VariantClear(&result);
|
||||
ole_raise(hr, rb_eRuntimeError, "Fail to get IEnum Interface");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to get IEnum Interface");
|
||||
}
|
||||
|
||||
VariantClear(&result);
|
||||
|
@ -2499,7 +2499,7 @@ ole_method_sub(self, pOwnerTypeInfo, pTypeInfo, name)
|
|||
VALUE method = Qnil;
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
}
|
||||
for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
|
||||
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
|
||||
|
@ -2538,7 +2538,7 @@ olemethod_from_typeinfo(self, pTypeInfo, name)
|
|||
VALUE method = Qnil;
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
}
|
||||
method = ole_method_sub(self, 0, pTypeInfo, name);
|
||||
if (method != Qnil) {
|
||||
|
@ -2574,7 +2574,7 @@ ole_methods_sub(pOwnerTypeInfo, pTypeInfo, methods, mask)
|
|||
WORD i;
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
}
|
||||
for(i = 0; i < pTypeAttr->cFuncs; i++) {
|
||||
pstr = NULL;
|
||||
|
@ -2615,7 +2615,7 @@ ole_methods_from_typeinfo(pTypeInfo, mask)
|
|||
VALUE methods = rb_ary_new();
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
}
|
||||
|
||||
ole_methods_sub(0, pTypeInfo, methods, mask);
|
||||
|
@ -2648,7 +2648,7 @@ typeinfo_from_ole(pole, ppti)
|
|||
HRESULT hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
|
||||
0, lcid, &pTypeInfo);
|
||||
if(FAILED(hr)) {
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
|
||||
}
|
||||
hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo,
|
||||
-1,
|
||||
|
@ -2658,7 +2658,7 @@ typeinfo_from_ole(pole, ppti)
|
|||
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &i);
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
|
||||
}
|
||||
count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
|
||||
for (i = 0; i < count; i++) {
|
||||
|
@ -2773,12 +2773,12 @@ fole_obj_help( self )
|
|||
|
||||
hr = pole->pDispatch->lpVtbl->GetTypeInfo( pole->pDispatch, 0, lcid, &pTypeInfo );
|
||||
if(FAILED(hr)) {
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
|
||||
}
|
||||
hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
|
||||
if(FAILED(hr)) {
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
|
||||
}
|
||||
hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
|
||||
&bstr, NULL, NULL, NULL);
|
||||
|
@ -3011,7 +3011,7 @@ fole_method_help( self, cmdname )
|
|||
OLEData_Get_Struct(self, pole);
|
||||
hr = typeinfo_from_ole(pole, &pTypeInfo);
|
||||
if(FAILED(hr))
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to get ITypeInfo");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to get ITypeInfo");
|
||||
method = folemethod_s_allocate(cWIN32OLE_METHOD);
|
||||
obj = olemethod_from_typeinfo(method, pTypeInfo, cmdname);
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
|
@ -3046,7 +3046,7 @@ foletype_s_ole_classes(self, typelib)
|
|||
pbuf = ole_mb2wc(StringValuePtr(file), -1);
|
||||
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
|
||||
SysFreeString(pbuf);
|
||||
ole_classes_from_typelib(pTypeLib, classes);
|
||||
OLE_RELEASE(pTypeLib);
|
||||
|
@ -3221,7 +3221,7 @@ foletype_initialize(self, typelib, oleclass)
|
|||
pbuf = ole_mb2wc(StringValuePtr(file), -1);
|
||||
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
|
||||
SysFreeString(pbuf);
|
||||
if (oleclass_from_typelib(self, pTypeLib, oleclass) == Qfalse) {
|
||||
OLE_RELEASE(pTypeLib);
|
||||
|
@ -3414,7 +3414,7 @@ ole_type_major_version(pTypeInfo)
|
|||
HRESULT hr;
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
ver = INT2FIX(pTypeAttr->wMajorVerNum);
|
||||
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
|
||||
return ver;
|
||||
|
@ -3443,7 +3443,7 @@ ole_type_minor_version(pTypeInfo)
|
|||
HRESULT hr;
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
ver = INT2FIX(pTypeAttr->wMinorVerNum);
|
||||
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
|
||||
return ver;
|
||||
|
@ -3472,7 +3472,7 @@ ole_type_typekind(pTypeInfo)
|
|||
HRESULT hr;
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
typekind = INT2FIX(pTypeAttr->typekind);
|
||||
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
|
||||
return typekind;
|
||||
|
@ -3622,7 +3622,7 @@ ole_variables(pTypeInfo)
|
|||
VALUE variables = rb_ary_new();
|
||||
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
|
||||
}
|
||||
|
||||
for(i = 0; i < pTypeAttr->cVars; i++) {
|
||||
|
@ -3702,7 +3702,7 @@ static ole_variable_ole_type(pTypeInfo, var_index)
|
|||
VALUE type;
|
||||
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetVarDesc");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
|
||||
type = ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), Qnil);
|
||||
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
|
||||
return type;
|
||||
|
@ -3731,7 +3731,7 @@ static ole_variable_ole_type_detail(pTypeInfo, var_index)
|
|||
VALUE type = rb_ary_new();
|
||||
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetVarDesc");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
|
||||
ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), type);
|
||||
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
|
||||
return type;
|
||||
|
@ -3970,7 +3970,7 @@ ole_method_return_type(pTypeInfo, method_index)
|
|||
|
||||
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
|
||||
|
||||
type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
|
||||
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
|
||||
|
@ -4002,7 +4002,7 @@ ole_method_return_vtype(pTypeInfo, method_index)
|
|||
|
||||
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
|
||||
if (FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
|
||||
|
||||
vt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
|
||||
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
|
||||
|
@ -4066,7 +4066,7 @@ ole_method_invkind(pTypeInfo, method_index)
|
|||
VALUE invkind;
|
||||
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
|
||||
if(FAILED(hr))
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
|
||||
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
|
||||
invkind = INT2FIX(pFuncDesc->invkind);
|
||||
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
|
||||
return invkind;
|
||||
|
@ -5269,7 +5269,7 @@ fev_initialize(argc, argv, self)
|
|||
rb_scan_args(argc, argv, "11", &ole, &itf);
|
||||
|
||||
if (!rb_obj_is_kind_of(ole, cWIN32OLE)) {
|
||||
rb_raise(rb_eTypeError, "1st parametor must be WIN32OLE object.");
|
||||
rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE object.");
|
||||
}
|
||||
|
||||
if(TYPE(itf) != T_NIL) {
|
||||
|
@ -5285,7 +5285,7 @@ fev_initialize(argc, argv, self)
|
|||
hr = find_default_source(ole, &iid, &pTypeInfo);
|
||||
}
|
||||
if (FAILED(hr)) {
|
||||
ole_raise(hr, rb_eRuntimeError, "not found interface");
|
||||
ole_raise(hr, rb_eRuntimeError, "interface not found");
|
||||
}
|
||||
|
||||
OLEData_Get_Struct(ole, pole);
|
||||
|
@ -5296,7 +5296,7 @@ fev_initialize(argc, argv, self)
|
|||
if (FAILED(hr)) {
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
ole_raise(hr, rb_eRuntimeError,
|
||||
"fail to query IConnectionPointContainer");
|
||||
"failed to query IConnectionPointContainer");
|
||||
}
|
||||
|
||||
hr = pContainer->lpVtbl->FindConnectionPoint(pContainer,
|
||||
|
@ -5305,7 +5305,7 @@ fev_initialize(argc, argv, self)
|
|||
OLE_RELEASE(pContainer);
|
||||
if (FAILED(hr)) {
|
||||
OLE_RELEASE(pTypeInfo);
|
||||
ole_raise(hr, rb_eRuntimeError, "fail to query IConnectionPoint");
|
||||
ole_raise(hr, rb_eRuntimeError, "failed to query IConnectionPoint");
|
||||
}
|
||||
pIEV = EVENTSINK_Constructor();
|
||||
pIEV->m_iid = iid;
|
||||
|
|
2
file.c
2
file.c
|
@ -2062,7 +2062,7 @@ rb_file_s_umask(argc, argv)
|
|||
omask = umask(NUM2INT(argv[0]));
|
||||
}
|
||||
else {
|
||||
rb_raise(rb_eArgError, "wrong number of argument");
|
||||
rb_raise(rb_eArgError, "wrong number of arguments");
|
||||
}
|
||||
return INT2FIX(omask);
|
||||
}
|
||||
|
|
6
hash.c
6
hash.c
|
@ -286,7 +286,7 @@ rb_hash_s_create(argc, argv, klass)
|
|||
}
|
||||
|
||||
if (argc % 2 != 0) {
|
||||
rb_raise(rb_eArgError, "odd number args for Hash");
|
||||
rb_raise(rb_eArgError, "odd number of arguments for Hash");
|
||||
}
|
||||
|
||||
hash = hash_alloc(klass);
|
||||
|
@ -802,7 +802,7 @@ rb_hash_select(argc, argv, hash)
|
|||
VALUE result;
|
||||
|
||||
if (argc > 0) {
|
||||
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
result = rb_ary_new();
|
||||
rb_hash_foreach(hash, select_i, result);
|
||||
|
@ -2018,7 +2018,7 @@ env_select(argc, argv)
|
|||
char **env;
|
||||
|
||||
if (argc > 0) {
|
||||
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
result = rb_ary_new();
|
||||
env = GET_ENVIRON(environ);
|
||||
|
|
|
@ -120,7 +120,7 @@ module Net # :nodoc:
|
|||
#
|
||||
# def fetch( uri_str, limit = 10 )
|
||||
# # You should choose better exception.
|
||||
# raise ArgumentError, 'http redirect too deep' if limit == 0
|
||||
# raise ArgumentError, 'HTTP redirect too deep' if limit == 0
|
||||
#
|
||||
# response = Net::HTTP.get_response(URI.parse(uri_str))
|
||||
# case response
|
||||
|
@ -442,7 +442,7 @@ module Net # :nodoc:
|
|||
# Finishes HTTP session and closes TCP connection.
|
||||
# Raises IOError if not started.
|
||||
def finish
|
||||
raise IOError, 'HTTP session not started yet' unless started?
|
||||
raise IOError, 'HTTP session not yet started' unless started?
|
||||
do_finish
|
||||
end
|
||||
|
||||
|
@ -1762,11 +1762,11 @@ module Net # :nodoc:
|
|||
end
|
||||
|
||||
def stream_check
|
||||
raise IOError, 'try to read body out of block' if @socket.closed?
|
||||
raise IOError, 'attempt to read body out of block' if @socket.closed?
|
||||
end
|
||||
|
||||
def procdest(dest, block)
|
||||
raise ArgumentError, 'both of arg and block are given for HTTP method' \
|
||||
raise ArgumentError, 'both arg and block given for HTTP method' \
|
||||
if dest and block
|
||||
if block
|
||||
ReadAdapter.new(block)
|
||||
|
|
|
@ -859,7 +859,7 @@ module Net # :nodoc:
|
|||
# firewall.
|
||||
# Errno::ETIMEDOUT:: connection timed out (possibly due to packets
|
||||
# being dropped by an intervening firewall).
|
||||
# Errno::NETUNREACH:: there is no route to that network.
|
||||
# Errno::ENETUNREACH:: there is no route to that network.
|
||||
# SocketError:: hostname not known or other socket error.
|
||||
# Net::IMAP::ByeResponseError:: we connected to the host, but they
|
||||
# immediately said goodbye to us.
|
||||
|
|
|
@ -292,7 +292,7 @@ module Net
|
|||
# This method must not be called while POP3 session is opened.
|
||||
# This method raises POPAuthenticationError if authentication fails.
|
||||
def auth_only( account, password )
|
||||
raise IOError, 'opening already opened POP session' if started?
|
||||
raise IOError, 'opening previously opened POP session' if started?
|
||||
start(account, password) {
|
||||
;
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ module Net
|
|||
|
||||
# Finishes a POP3 session and closes TCP connection.
|
||||
def finish
|
||||
raise IOError, 'POP session not started yet' unless started?
|
||||
raise IOError, 'POP session not yet started' unless started?
|
||||
do_finish
|
||||
end
|
||||
|
||||
|
|
|
@ -371,7 +371,7 @@ module Net # :nodoc:
|
|||
# Finishes the SMTP session and closes TCP connection.
|
||||
# Raises IOError if not started.
|
||||
def finish
|
||||
raise IOError, 'not started yet' unless started?
|
||||
raise IOError, 'not yet started' unless started?
|
||||
do_finish
|
||||
end
|
||||
|
||||
|
@ -472,7 +472,7 @@ module Net # :nodoc:
|
|||
|
||||
def send0( from_addr, to_addrs )
|
||||
raise IOError, 'closed session' unless @socket
|
||||
raise ArgumentError, 'mail destination does not given' if to_addrs.empty?
|
||||
raise ArgumentError, 'mail destination not given' if to_addrs.empty?
|
||||
if $SAFE > 0
|
||||
raise SecurityError, 'tainted from_addr' if from_addr.tainted?
|
||||
to_addrs.each do |to|
|
||||
|
@ -499,7 +499,7 @@ module Net # :nodoc:
|
|||
private
|
||||
|
||||
def check_auth_args( user, secret, authtype )
|
||||
raise ArgumentError, 'both of user and secret are required'\
|
||||
raise ArgumentError, 'both user and secret are required'\
|
||||
unless user and secret
|
||||
auth_method = "auth_#{authtype || 'cram_md5'}"
|
||||
raise ArgumentError, "wrong auth type #{authtype}"\
|
||||
|
|
|
@ -119,7 +119,7 @@ private
|
|||
return parts.dup
|
||||
end
|
||||
if parts.length != result.length
|
||||
raise RuntimeError.new("Incomplete prarmeterOrder list.")
|
||||
raise RuntimeError.new("Incomplete parameter order list.")
|
||||
end
|
||||
result
|
||||
end
|
||||
|
|
|
@ -467,7 +467,7 @@ module XMLRPC
|
|||
else
|
||||
# is a normal return value
|
||||
raise "Missing return value!" if parser.params.size == 0
|
||||
raise "To many return values. Only one allowed!" if parser.params.size > 1
|
||||
raise "Too many return values. Only one allowed!" if parser.params.size > 1
|
||||
[true, parser.params[0]]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -842,7 +842,6 @@ flo_eq(x, y)
|
|||
return num_equal(x, y);
|
||||
}
|
||||
a = RFLOAT(x)->value;
|
||||
if (isnan(a) || isnan(b)) return Qfalse;
|
||||
return (a == b)?Qtrue:Qfalse;
|
||||
}
|
||||
|
||||
|
|
4
re.c
4
re.c
|
@ -1251,7 +1251,7 @@ match_select(argc, argv, match)
|
|||
VALUE match;
|
||||
{
|
||||
if (argc > 0) {
|
||||
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
else {
|
||||
struct re_registers *regs = RMATCH(match)->regs;
|
||||
|
@ -1651,7 +1651,7 @@ rb_reg_initialize_m(argc, argv, self)
|
|||
|
||||
rb_check_frozen(self);
|
||||
if (argc == 0 || argc > 3) {
|
||||
rb_raise(rb_eArgError, "wrong number of argument");
|
||||
rb_raise(rb_eArgError, "wrong number of arguments");
|
||||
}
|
||||
if (TYPE(argv[0]) == T_REGEXP) {
|
||||
if (argc > 1) {
|
||||
|
|
|
@ -108,7 +108,7 @@ sign_bits(base, p)
|
|||
(posarg = -1, GETNTHARG(n))))
|
||||
|
||||
#define GETNTHARG(nth) \
|
||||
((nth >= argc) ? (rb_raise(rb_eArgError, "too few argument."), 0) : argv[nth])
|
||||
((nth >= argc) ? (rb_raise(rb_eArgError, "too few arguments."), 0) : argv[nth])
|
||||
|
||||
#define GETASTER(val) do { \
|
||||
t = p++; \
|
||||
|
@ -718,7 +718,7 @@ rb_f_sprintf(argc, argv)
|
|||
* the format string may contain `n$'-style argument selector.
|
||||
*/
|
||||
if (RTEST(ruby_verbose) && nextarg < argc) {
|
||||
rb_raise(rb_eArgError, "too many argument for format string");
|
||||
rb_raise(rb_eArgError, "too many arguments for format string");
|
||||
}
|
||||
#endif
|
||||
rb_str_resize(result, blen);
|
||||
|
|
2
struct.c
2
struct.c
|
@ -726,7 +726,7 @@ rb_struct_select(argc, argv, s)
|
|||
long i;
|
||||
|
||||
if (argc > 0) {
|
||||
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
|
||||
}
|
||||
result = rb_ary_new();
|
||||
for (i = 0; i < RSTRUCT(s)->len; i++) {
|
||||
|
|
14
time.c
14
time.c
|
@ -110,10 +110,10 @@ time_init(time)
|
|||
#define NMOD(x,y) ((y)-(-((x)+1)%(y))-1)
|
||||
|
||||
void
|
||||
time_overflow_p(sec, usec)
|
||||
time_t sec, usec;
|
||||
time_overflow_p(secp, usecp)
|
||||
time_t *secp, *usecp;
|
||||
{
|
||||
time_t tmp;
|
||||
time_t tmp, sec = *secp, usec = *usecp;
|
||||
|
||||
if (usec >= 1000000) { /* usec positive overflow */
|
||||
tmp = sec + usec / 1000000;
|
||||
|
@ -135,6 +135,8 @@ time_overflow_p(sec, usec)
|
|||
if (sec < 0 || (sec == 0 && usec < 0))
|
||||
rb_raise(rb_eArgError, "time must be positive");
|
||||
#endif
|
||||
*secp = sec;
|
||||
*usecp = usec;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -146,7 +148,7 @@ time_new_internal(klass, sec, usec)
|
|||
struct time_object *tobj;
|
||||
|
||||
GetTimeval(time, tobj);
|
||||
time_overflow_p(sec, usec);
|
||||
time_overflow_p(&sec, &usec);
|
||||
tobj->tv.tv_sec = sec;
|
||||
tobj->tv.tv_usec = usec;
|
||||
|
||||
|
@ -1895,7 +1897,7 @@ time_mdump(time)
|
|||
tm = gmtime(&t);
|
||||
|
||||
if ((tm->tm_year & 0x1ffff) != tm->tm_year)
|
||||
rb_raise(rb_eArgError, "too big year to marshal");
|
||||
rb_raise(rb_eArgError, "year too big to marshal");
|
||||
|
||||
p = 0x1 << 31 | /* 1 */
|
||||
tm->tm_year << 14 | /* 17 */
|
||||
|
@ -1990,7 +1992,7 @@ time_mload(time, str)
|
|||
sec = make_time_t(&tm, Qtrue);
|
||||
usec = (time_t)(s & 0xfffff);
|
||||
}
|
||||
time_overflow_p(sec, usec);
|
||||
time_overflow_p(&sec, &usec);
|
||||
|
||||
GetTimeval(time, tobj);
|
||||
tobj->tm_got = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue