summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Meissner <wmeissner@gmail.com>2012-08-13 21:25:48 +1000
committerWayne Meissner <wmeissner@gmail.com>2012-08-13 21:25:48 +1000
commitd19b48bde5b1eb98571c6ee318d3dccf80318c93 (patch)
tree10b9de9d8778917e81c3a63b761d066454943a8a
parentb1ee55c88f2da3f1f60f14fca2525fbcfb651ffd (diff)
downloadffi-d19b48bde5b1eb98571c6ee318d3dccf80318c93.tar.gz
Fix some unused-var warnings
-rw-r--r--ext/ffi_c/MappedType.c1
-rw-r--r--ext/ffi_c/MemoryPointer.c7
-rw-r--r--ext/ffi_c/MethodHandle.c1
-rw-r--r--ext/ffi_c/StructLayout.c2
-rw-r--r--ext/ffi_c/Variadic.c3
5 files changed, 2 insertions, 12 deletions
diff --git a/ext/ffi_c/MappedType.c b/ext/ffi_c/MappedType.c
index 7a77842..cb091d8 100644
--- a/ext/ffi_c/MappedType.c
+++ b/ext/ffi_c/MappedType.c
@@ -60,7 +60,6 @@ static VALUE
mapped_initialize(VALUE self, VALUE rbConverter)
{
MappedType* m = NULL;
- Type* t = NULL;
if (!rb_respond_to(rbConverter, id_native_type)) {
rb_raise(rb_eNoMethodError, "native_type method not implemented");
diff --git a/ext/ffi_c/MemoryPointer.c b/ext/ffi_c/MemoryPointer.c
index 85679fa..eb8f989 100644
--- a/ext/ffi_c/MemoryPointer.c
+++ b/ext/ffi_c/MemoryPointer.c
@@ -38,7 +38,6 @@ typedef int bool;
static VALUE memptr_allocate(VALUE klass);
-static void memptr_mark(Pointer* ptr);
static void memptr_release(Pointer* ptr);
static VALUE memptr_malloc(VALUE self, long size, long count, bool clear);
static VALUE memptr_free(VALUE self);
@@ -137,12 +136,6 @@ memptr_release(Pointer* ptr)
xfree(ptr);
}
-static void
-memptr_mark(Pointer* ptr)
-{
- rb_gc_mark(ptr->rbParent);
-}
-
static VALUE
memptr_s_from_string(VALUE klass, VALUE to_str)
{
diff --git a/ext/ffi_c/MethodHandle.c b/ext/ffi_c/MethodHandle.c
index 7f33891..aad6cdd 100644
--- a/ext/ffi_c/MethodHandle.c
+++ b/ext/ffi_c/MethodHandle.c
@@ -330,7 +330,6 @@ trampoline_size(void)
void
rbffi_MethodHandle_Init(VALUE module)
{
- ffi_status ffiStatus;
defaultClosurePool = rbffi_ClosurePool_New((int) trampoline_size(), prep_trampoline, NULL);
#if defined(CUSTOM_TRAMPOLINE)
diff --git a/ext/ffi_c/StructLayout.c b/ext/ffi_c/StructLayout.c
index 9bed49d..7a431a7 100644
--- a/ext/ffi_c/StructLayout.c
+++ b/ext/ffi_c/StructLayout.c
@@ -432,7 +432,7 @@ struct_layout_union_bang(VALUE self)
return Qnil;
}
- count = (int) layout->size / t->size;
+ count = (int) layout->size / (int) t->size;
xfree(layout->ffiTypes);
layout->ffiTypes = xcalloc(count + 1, sizeof(ffi_type *));
layout->base.ffiType->elements = layout->ffiTypes;
diff --git a/ext/ffi_c/Variadic.c b/ext/ffi_c/Variadic.c
index 8b18a65..8935613 100644
--- a/ext/ffi_c/Variadic.c
+++ b/ext/ffi_c/Variadic.c
@@ -94,8 +94,7 @@ variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, VALUE
VALUE retval = Qnil;
VALUE convention = Qnil;
VALUE fixed = Qnil;
- VALUE rbConventionStr;
- int i;
+ int i;
Check_Type(options, T_HASH);
convention = rb_hash_aref(options, ID2SYM(rb_intern("convention")));