summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--ext/Win32API/Win32API.c16
-rw-r--r--ruby.c11
3 files changed, 27 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b21f98131..da45ce8599 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 15 01:32:31 1999 WATANABE Hirofumi <eban@os.rim.or.jp>
+
+ * ext/Win32API/Win32API.c (Win32API_Call): need to use NUM2ULONG,
+ not NUM2INT.
+
Tue Oct 12 22:29:04 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (block_pass): should copy block to prevent modifications.
@@ -30,6 +35,10 @@ Mon Oct 4 12:42:32 1999 Kazuhiko Izawa <izawa@erec.che.tohoku.ac.jp>
* pack.c (pack_unpack): % in printf format should be %%.
+Wed Oct 6 17:13:19 1999 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+
+ * ruby.c (addpath): rubylib_mangled_path() modified.
+
Mon Oct 4 10:01:40 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* variable.c (rb_obj_instance_variables): should always return
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
index 9f75653132..8efb3ddad6 100644
--- a/ext/Win32API/Win32API.c
+++ b/ext/Win32API/Win32API.c
@@ -140,7 +140,7 @@ Win32API_Call(argc, argv, obj)
obj_proc = rb_iv_get(obj, "__proc__");
- ApiFunction = (FARPROC)NUM2INT(obj_proc);
+ ApiFunction = (FARPROC)NUM2ULONG(obj_proc);
obj_import = rb_iv_get(obj, "__import__");
obj_export = rb_iv_get(obj, "__export__");
@@ -159,7 +159,7 @@ Win32API_Call(argc, argv, obj)
switch (timport) {
case _T_NUMBER:
case _T_INTEGER:
- lParam = NUM2INT(rb_ary_entry(args, i));
+ lParam = NUM2ULONG(rb_ary_entry(args, i));
#if defined(_MSC_VER) || defined(__LCC__)
_asm {
mov eax, lParam
@@ -173,9 +173,15 @@ Win32API_Call(argc, argv, obj)
break;
case _T_POINTER:
str = rb_ary_entry(args, i);
- Check_Type(str, T_STRING);
- rb_str_modify(str);
- pParam = RSTRING(str)->ptr;
+ if (NIL_P(str)) {
+ pParam = 0;
+ } else if (FIXNUM_P(str)){
+ pParam = (char *)NUM2ULONG(str);
+ } else {
+ Check_Type(str, T_STRING);
+ rb_str_modify(str);
+ pParam = RSTRING(str)->ptr;
+ }
#if defined(_MSC_VER) || defined(__LCC__)
_asm {
mov eax, dword ptr pParam
diff --git a/ruby.c b/ruby.c
index 0b4d486ec8..752b2b18fc 100644
--- a/ruby.c
+++ b/ruby.c
@@ -176,8 +176,11 @@ rubylib_mangle(s, l)
strcpy(ret + newl, s + oldl);
return ret;
}
+#define rubylib_mangled_path(s, l) rb_str_new2(rubylib_mangle((s), (l)))
+#define rubylib_mangled_path2(s) rb_str_new2(rubylib_mangle((s), 0))
#else
-#define rubylib_mangle(s, l) (s)
+#define rubylib_mangled_path(s, l) rb_str_new((s), (l))
+#define rubylib_mangled_path2(s) rb_str_new2(s)
#endif
static void
@@ -202,18 +205,18 @@ addpath(path)
while (*p) {
while (*p == sep) p++;
if (s = strchr(p, sep)) {
- rb_ary_push(ary, rb_str_new(rubylib_mangle(p, (int)(s-p)), (int)(s-p)));
+ rb_ary_push(ary, rubylib_mangled_path(p, (int)(s-p)));
p = s + 1;
}
else {
- rb_ary_push(ary, rb_str_new2(rubylib_mangle(p, 0)));
+ rb_ary_push(ary, rubylib_mangled_path2(p));
break;
}
}
rb_load_path = rb_ary_plus(ary, rb_load_path);
}
else {
- rb_ary_unshift(rb_load_path, rb_str_new2(rubylib_mangle(path, 0)));
+ rb_ary_unshift(rb_load_path, rubylib_mangled_path2(path));
}
}