summaryrefslogtreecommitdiff
path: root/ext/Win32API/Win32API.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 11:56:42 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 11:56:42 +0000
commit6790891ef083b77faaf9d779463dfa0569a96ae5 (patch)
treeeea89a4ca3ea28c330bd3681f26964023fa8413f /ext/Win32API/Win32API.c
parent5b5e4a6fc1e2829e6a2e1fb41986e951070646c7 (diff)
* ext/Win32API/Win32API.c (Win32API_initialize): use RSTRING_PTR and
RSTRING_LEN. * ext/tk/stubs.c, ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: ditto. * ext/win32ole/win32ole.c (ole_val2olevariantdata): ditto. * lib/mkmf.rb (create_makefile): follow nil.to_s. * win32/resource.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/Win32API/Win32API.c')
-rw-r--r--ext/Win32API/Win32API.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
index 96ce8c6636..221a46df1b 100644
--- a/ext/Win32API/Win32API.c
+++ b/ext/Win32API/Win32API.c
@@ -50,18 +50,18 @@ Win32API_initialize(self, dllname, proc, import, export)
SafeStringValue(dllname);
SafeStringValue(proc);
- hdll = LoadLibrary(RSTRING(dllname)->ptr);
+ hdll = LoadLibrary(RSTRING_PTR(dllname));
if (!hdll)
- rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
+ rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING_PTR(dllname));
rb_iv_set(self, "__hdll__", Data_Wrap_Struct(rb_cData, 0, Win32API_FreeLibrary, (void*)hdll));
- hproc = (HANDLE)GetProcAddress(hdll, RSTRING(proc)->ptr);
+ hproc = (HANDLE)GetProcAddress(hdll, RSTRING_PTR(proc));
if (!hproc) {
str = rb_str_new3(proc);
str = rb_str_cat(str, "A", 1);
- hproc = (HANDLE)GetProcAddress(hdll, RSTRING(str)->ptr);
+ hproc = (HANDLE)GetProcAddress(hdll, RSTRING_PTR(str));
if (!hproc)
rb_raise(rb_eRuntimeError, "GetProcAddress: %s or %s\n",
- RSTRING(proc)->ptr, RSTRING(str)->ptr);
+ RSTRING_PTR(proc), RSTRING_PTR(str));
}
rb_iv_set(self, "__dll__", UINT2NUM((unsigned long)hdll));
rb_iv_set(self, "__dllname__", dllname);
@@ -75,7 +75,7 @@ Win32API_initialize(self, dllname, proc, import, export)
ptr = RARRAY(import)->ptr;
for (i = 0, len = RARRAY(import)->len; i < len; i++) {
SafeStringValue(ptr[i]);
- switch (*(char *)RSTRING(ptr[i])->ptr) {
+ switch (*(char *)RSTRING_PTR(ptr[i])) {
case 'N': case 'n': case 'L': case 'l':
rb_ary_push(a_import, INT2FIX(_T_NUMBER));
break;
@@ -90,8 +90,8 @@ Win32API_initialize(self, dllname, proc, import, export)
break;
default:
SafeStringValue(import);
- s = RSTRING(import)->ptr;
- for (i = 0, len = RSTRING(import)->len; i < len; i++) {
+ s = RSTRING_PTR(import);
+ for (i = 0, len = RSTRING_LEN(import); i < len; i++) {
switch (*s++) {
case 'N': case 'n': case 'L': case 'l':
rb_ary_push(a_import, INT2FIX(_T_NUMBER));
@@ -117,7 +117,7 @@ Win32API_initialize(self, dllname, proc, import, export)
ex = _T_VOID;
} else {
SafeStringValue(export);
- switch (*RSTRING(export)->ptr) {
+ switch (*RSTRING_PTR(export)) {
case 'V': case 'v':
ex = _T_VOID;
break;