Skip to content

Commit

Permalink
Merge pull request #2386 from herwinw/compile_warnings
Browse files Browse the repository at this point in the history
Remove some unused variables
  • Loading branch information
herwinw committed Dec 14, 2024
2 parents 74363aa + 58f32b0 commit 0d1aa05
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion bin/natalie
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ class Runner
end

def run_temp_and_wait(path)
build_dir = File.expand_path('../build', __dir__)
var_name = RbConfig::CONFIG['LIBPATHENV']
env = { var_name => Natalie::Compiler::CppBackend::LIB_PATHS.join(':') }
pid = spawn(env, path, *ARGV)
Expand Down
2 changes: 1 addition & 1 deletion lib/natalie/compiler/backends/cpp_backend/transform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def add_file(name)

def value_has_side_effects?(value)
return false if value =~ /^Value\((False|Nil|True)Object::the\(\)\)$/
return false if value =~ /^Value\([\w_]*symbols\[\d+\]\/\*\:[^\*]+\*\/\)$/
return false if value =~ /^Value\(\w*symbols\[\d+\]\/\*\:[^\*]+\*\/\)$/
true
end

Expand Down
1 change: 0 additions & 1 deletion lib/natalie/compiler/bytecode/ro_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def self.load(str)
def add(value)
return @add_lookup[value] if @add_lookup.key?(value)

size = value.bytesize
position = @buffer.size
@buffer << [value.bytesize].pack('w')
@buffer << value.b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def execute(vm)
end

def serialize(_)
name_string = @name.to_s
[
instruction_number,
@exclude_end ? 1 : 0,
Expand Down
3 changes: 2 additions & 1 deletion lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def initialize
yield self if block_given?
end

attr_accessor :banner, :program_name, :version
attr_accessor :banner, :program_name
attr_writer :version

def on(*args, options: nil, &block)
short_name, short_value = args.grep(/^\-[^\-]/).first&.split(/[ =]/, 2)
Expand Down

0 comments on commit 0d1aa05

Please sign in to comment.