summaryrefslogtreecommitdiff
path: root/ext/dl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl')
-rw-r--r--ext/dl/dl.c2
-rw-r--r--ext/dl/handle.c3
-rw-r--r--ext/dl/ptr.c12
-rw-r--r--ext/dl/sym.c3
4 files changed, 5 insertions, 15 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index c1e5311c0a..0d806a7de7 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -554,8 +554,6 @@ rb_dl_malloc(VALUE self, VALUE size)
VALUE
rb_dl_strdup(VALUE self, VALUE str)
{
- void *p;
-
str = rb_String(str);
return rb_dlptr_new(strdup(RSTRING(str)->ptr), RSTRING(str)->len, dlfree);
}
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index 689ce4e3a5..23ad5ef066 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -133,9 +133,6 @@ rb_dlhandle_sym(int argc, VALUE argv[], VALUE self)
VALUE sym, type;
void (*func)();
VALUE val;
- struct sym_data *data;
- int *ctypes;
- int i, ctypes_len;
struct dl_handle *dlhandle;
void *handle;
const char *name, *stype;
diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c
index 8c2799a2b2..60f4ad00ed 100644
--- a/ext/dl/ptr.c
+++ b/ext/dl/ptr.c
@@ -178,7 +178,7 @@ rb_dlptr_s_allocate(VALUE klass)
static VALUE
rb_dlptr_initialize(int argc, VALUE argv[], VALUE self)
{
- VALUE ptr, sym, obj, size;
+ VALUE ptr, sym, size;
struct ptr_data *data;
void *p = NULL;
freefunc_t f = NULL;
@@ -279,7 +279,6 @@ VALUE
rb_dlptr_free_set(VALUE self, VALUE val)
{
struct ptr_data *data;
- int i;
Data_Get_Struct(self, struct ptr_data, data);
@@ -463,10 +462,9 @@ rb_dlptr_inspect(VALUE self)
{
struct ptr_data *data;
char str[1024];
- VALUE name;
Data_Get_Struct(self, struct ptr_data, data);
- snprintf(str, 1023, "#<%s:0x%x ptr=0x%x size=%ld free=0x%x>",
+ snprintf(str, 1023, "#<%s:0x%p ptr=0x%p size=%ld free=0x%p>",
rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, data->free);
return rb_str_new2(str);
}
@@ -519,9 +517,8 @@ rb_dlptr_define_data_type(int argc, VALUE argv[], VALUE self)
{
VALUE data_type, type, rest, vid;
struct ptr_data *data;
- int i, t, len, num;
+ int i, t, num;
char *ctype;
- long size;
rb_scan_args(argc, argv, "11*", &data_type, &type, &rest);
Data_Get_Struct(self, struct ptr_data, data);
@@ -731,9 +728,8 @@ cary2ary(void *ptr, char t, int len)
VALUE
rb_dlptr_aref(int argc, VALUE argv[], VALUE self)
{
- VALUE val, key = Qnil, num = Qnil;
+ VALUE key = Qnil, num = Qnil;
ID id;
- int idx;
struct ptr_data *data;
int i;
int offset;
diff --git a/ext/dl/sym.c b/ext/dl/sym.c
index b5de3b961f..95a813cc1f 100644
--- a/ext/dl/sym.c
+++ b/ext/dl/sym.c
@@ -145,7 +145,6 @@ VALUE
rb_dlsym_initialize(int argc, VALUE argv[], VALUE self)
{
VALUE addr, name, type;
- VALUE val;
struct sym_data *data;
void *saddr;
const char *sname, *stype;
@@ -266,7 +265,7 @@ rb_dlsym_inspect(VALUE self)
str_size = RSTRING(proto)->len + 100;
str = dlmalloc(str_size);
snprintf(str, str_size - 1,
- "#<DL::Symbol:0x%x func=0x%x '%s'>",
+ "#<DL::Symbol:0x%p func=0x%p '%s'>",
sym, sym->func, RSTRING(proto)->ptr);
val = rb_tainted_str_new2(str);
dlfree(str);