mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_replace): swap arguments of OBJ_INFECT.
* eval.c (rb_thread_schedule): should not select a thread which is not yet initialized. * time.c (time_plus): wrong boundary check. * time.c (time_minus): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cd956b3114
commit
35f851bcfe
14 changed files with 135 additions and 77 deletions
|
@ -64,8 +64,8 @@ Win32API_initialize(self, dllname, proc, import, export)
|
|||
int len;
|
||||
int ex;
|
||||
|
||||
Check_SafeStr(dllname);
|
||||
Check_SafeStr(proc);
|
||||
SafeStringValue(dllname);
|
||||
SafeStringValue(proc);
|
||||
hdll = LoadLibrary(RSTRING(dllname)->ptr);
|
||||
if (!hdll)
|
||||
rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
|
||||
|
@ -90,7 +90,7 @@ Win32API_initialize(self, dllname, proc, import, export)
|
|||
case T_ARRAY:
|
||||
ptr = RARRAY(import)->ptr;
|
||||
for (i = 0, len = RARRAY(import)->len; i < len; i++) {
|
||||
Check_SafeStr(ptr[i]);
|
||||
SafeStringValue(ptr[i]);
|
||||
switch (*(char *)RSTRING(ptr[i])->ptr) {
|
||||
case 'N': case 'n': case 'L': case 'l':
|
||||
rb_ary_push(a_import, INT2FIX(_T_NUMBER));
|
||||
|
@ -105,7 +105,7 @@ Win32API_initialize(self, dllname, proc, import, export)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
Check_SafeStr(import);
|
||||
SafeStringValue(import);
|
||||
s = RSTRING(import)->ptr;
|
||||
for (i = 0, len = RSTRING(import)->len; i < len; i++) {
|
||||
switch (*s++) {
|
||||
|
@ -127,7 +127,7 @@ Win32API_initialize(self, dllname, proc, import, export)
|
|||
if (NIL_P(export)) {
|
||||
ex = _T_VOID;
|
||||
} else {
|
||||
Check_SafeStr(export);
|
||||
SafeStringValue(export);
|
||||
switch (*RSTRING(export)->ptr) {
|
||||
case 'V': case 'v':
|
||||
ex = _T_VOID;
|
||||
|
@ -228,7 +228,7 @@ Win32API_Call(argc, argv, obj)
|
|||
} else if (FIXNUM_P(str)){
|
||||
pParam = (char *)NUM2ULONG(str);
|
||||
} else {
|
||||
Check_Type(str, T_STRING);
|
||||
StringValue(str);
|
||||
rb_str_modify(str);
|
||||
pParam = RSTRING(str)->ptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue