summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-05 07:45:32 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-05 07:45:32 +0000
commit849bc0234abaa8458f132981404e198666c5610b (patch)
tree087d802ac34ba666eb197b3023171b77d9f0829c /ext
parent1b33576053bc1f0a01deee86f9a5821cb96c65c0 (diff)
* 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
Diffstat (limited to 'ext')
-rw-r--r--ext/iconv/iconv.c2
-rw-r--r--ext/openssl/ossl.c2
-rw-r--r--ext/openssl/ossl_asn1.c10
-rw-r--r--ext/openssl/ossl_config.c2
-rw-r--r--ext/openssl/ossl_pkcs7.c2
-rw-r--r--ext/racc/cparse/cparse.c2
-rw-r--r--ext/readline/readline.c2
-rw-r--r--ext/sdbm/init.c2
-rw-r--r--ext/socket/socket.c69
-rw-r--r--ext/stringio/stringio.c2
-rw-r--r--ext/syslog/syslog.c2
-rw-r--r--ext/tcltklib/tcltklib.c2
-rw-r--r--ext/win32ole/win32ole.c80
13 files changed, 99 insertions, 80 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 4b1f4b5..638fb71 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -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;
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index ac98d6f..36a7aa5 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -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);
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index f0d8dda..09ca66f 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -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));
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index 655517c..37abff5 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -147,7 +147,7 @@ ossl_config_initialize(int argc, VALUE *argv, VALUE self)
}
}
#ifdef OSSL_NO_CONF_API
- else rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ else rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
#else
else _CONF_new_data(conf);
#endif
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index aaa12ac..57825e8 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -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);
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index c15aaf5..24c4e36 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -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);
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index cac0b1d..78a8b17 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -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);
}
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index f473555..4352d21 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -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;
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 7c1b43b..d13f648 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -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
+struct hostent_arg {
+ VALUE host;
+ struct addrinfo* addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t));
+};
+
static VALUE
-make_hostent(addr, ipaddr)
- struct addrinfo *addr;
- VALUE (*ipaddr) _((struct sockaddr*, size_t));
+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
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 46217c7..98d3c08 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -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);
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index ce386ed..477489d 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -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--;
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 6e96289..271aa00 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -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 */
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 8869ee0..0201057 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -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, &paramS);
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;