summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-11 16:24:34 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-11 16:24:34 +0000
commit75fec1ca48a5430dcac9c1766f7ebb40e0328ad4 (patch)
tree5712119a07472055397468222e054adac0d95d92 /ext
parent5fc3a4126c8069ebb370e34a5a5ca3d274586f8c (diff)
* ext/dl/sym.c (rb_dlsym_inspect): Use "0x%x" rather for pointers.
This might not be very right but it is commonly used in other parts of the code; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp> in [ruby-dev:30532]. * ext/dl/ptr.c (rb_dlptr_inspect): Ditto. * ext/dl/lib/dl/import.rb (DL::Importable::Internal::import, DL::Importable::Internal::callback): Avoid race condition for an instance variable; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp> in [ruby-dev:30530]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/dl/lib/dl/import.rb4
-rw-r--r--ext/dl/ptr.c2
-rw-r--r--ext/dl/sym.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb
index 63c9b2c..01ee249 100644
--- a/ext/dl/lib/dl/import.rb
+++ b/ext/dl/lib/dl/import.rb
@@ -87,7 +87,7 @@ module DL
" rs = dec.call(rs) if (dec && rs)",
" @retval = r",
" @args = rs",
- " @retval",
+ " r",
"}",
].join("\n"))
@@ -169,7 +169,7 @@ module DL
" rs = dec.call(rs) if dec",
" @retval = r",
" @args = rs",
- " return @retval",
+ " return r",
"end",
"module_function :#{mname}",
].join("\n")
diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c
index 59de4d8..4d75a3d 100644
--- a/ext/dl/ptr.c
+++ b/ext/dl/ptr.c
@@ -466,7 +466,7 @@ rb_dlptr_inspect(VALUE self)
char str[1024];
Data_Get_Struct(self, struct ptr_data, data);
- snprintf(str, 1023, "#<%s:0x%p ptr=0x%p size=%ld free=0x%p>",
+ snprintf(str, 1023, "#<%s:0x%x ptr=0x%x size=%ld free=0x%x>",
rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, data->free);
return rb_str_new2(str);
}
diff --git a/ext/dl/sym.c b/ext/dl/sym.c
index 40b2035..87d07e7 100644
--- a/ext/dl/sym.c
+++ b/ext/dl/sym.c
@@ -268,7 +268,7 @@ rb_dlsym_inspect(VALUE self)
str_size = RSTRING(proto)->len + 100;
str = dlmalloc(str_size);
snprintf(str, str_size - 1,
- "#<DL::Symbol:0x%p func=0x%p '%s'>",
+ "#<DL::Symbol:0x%x func=0x%x '%s'>",
sym, sym->func, RSTRING(proto)->ptr);
val = rb_tainted_str_new2(str);
dlfree(str);