From d19b48bde5b1eb98571c6ee318d3dccf80318c93 Mon Sep 17 00:00:00 2001 From: Wayne Meissner Date: Mon, 13 Aug 2012 21:25:48 +1000 Subject: Fix some unused-var warnings --- ext/ffi_c/MappedType.c | 1 - ext/ffi_c/MemoryPointer.c | 7 ------- ext/ffi_c/MethodHandle.c | 1 - ext/ffi_c/StructLayout.c | 2 +- ext/ffi_c/Variadic.c | 3 +-- 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"))); -- cgit v1.2.1