From 9e37602884c2129d8ca5c5b669a3b91450a2933a Mon Sep 17 00:00:00 2001 From: takkanm Date: Tue, 13 Feb 2018 22:01:49 +0900 Subject: [PATCH] suppress unused variable warning --- lib/ffi/library.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ffi/library.rb b/lib/ffi/library.rb index 904faba23..adfa106ab 100644 --- a/lib/ffi/library.rb +++ b/lib/ffi/library.rb @@ -344,7 +344,7 @@ def attach_variable(mname, a1, a2 = nil) raise FFI::NotFoundError.new(cname, ffi_libraries) if address.nil? || address.null? if type.is_a?(Class) && type < FFI::Struct # If it is a global struct, just attach directly to the pointer - s = type.new(address) + s = s = type.new(address) # Assigning twice to suppress unused variable warning self.module_eval <<-code, __FILE__, __LINE__ @@ffi_gvar_#{mname} = s def self.#{mname}