Skip to content

Commit

Permalink
Merge pull request #615 from takkanm/suppress-unused-variable-warning
Browse files Browse the repository at this point in the history
suppress unused variable warning

Fixes #600
  • Loading branch information
larskanis committed Feb 13, 2018
2 parents 41f761f + 9e37602 commit 9817429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ffi/library.rb
Expand Up @@ -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}
Expand Down

0 comments on commit 9817429

Please sign in to comment.