brew vendor-gems: commit updates.

This commit is contained in:
BrewTestBot 2021-06-16 18:42:36 +00:00
parent 72eff9fbdf
commit 06dfe53e49
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
35 changed files with 24 additions and 22 deletions

View File

@ -12,7 +12,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-6.1.3.2
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/public_suffix-4.0.6/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/addressable-2.7.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ast-2.4.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bindata-2.4.8/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bindata-2.4.10/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/msgpack-1.4.2"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/msgpack-1.4.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/bootsnap-1.7.5"

View File

@ -47,7 +47,7 @@ module BinData
end
def readbytes(n)
n.times.inject("") do |bytes, _|
bytes << @io.readbits(8, :big).chr
bytes += @io.readbits(8, :big).chr
end
end
end

View File

@ -115,14 +115,14 @@ module BinData
end
if signed == :signed
max = (1 << (nbits - 1)) - 1
min = -(max + 1)
max = "max = (1 << (#{nbits} - 1)) - 1"
min = "min = -(max + 1)"
else
min = 0
max = (1 << nbits) - 1
min = "min = 0"
max = "max = (1 << #{nbits}) - 1"
end
clamp = "(val < #{min}) ? #{min} : (val > #{max}) ? #{max} : val"
clamp = "(#{max}; #{min}; val = (val < min) ? min : (val > max) ? max : val)"
if nbits == 1
# allow single bits to be used as booleans

View File

@ -59,14 +59,16 @@ module BinData
def create_clamp_code(nbits, signed)
if signed == :signed
max = (1 << (nbits - 1)) - 1
min = -(max + 1)
max = "max = (1 << (#{nbits} - 1)) - 1"
min = "min = -(max + 1)"
else
max = (1 << nbits) - 1
min = 0
max = "max = (1 << #{nbits}) - 1"
min = "min = 0"
end
"val = (val < #{min}) ? #{min} : (val > #{max}) ? #{max} : val"
clamp = "(#{max}; #{min}; val = (val < min) ? min : (val > max) ? max : val)"
"val = #{clamp}"
end
def create_read_code(nbits, endian, signed)
@ -107,7 +109,7 @@ module BinData
parts = (0...nwords).collect do |i|
"(ints.at(#{idx[i]}) << #{bits_per_word(nbits) * i})"
end
parts[0].sub!(/ << 0\b/, "") # Remove " << 0" for optimisation
parts[0] = parts[0].sub(/ << 0\b/, "") # Remove " << 0" for optimisation
parts.join(" + ")
end
@ -132,7 +134,7 @@ module BinData
mask = (1 << bits_per_word(nbits)) - 1
vals = (0...nwords).collect { |i| "val >> #{bits_per_word(nbits) * i}" }
vals[0].sub!(/ >> 0\b/, "") # Remove " >> 0" for optimisation
vals[0] = vals[0].sub(/ >> 0\b/, "") # Remove " >> 0" for optimisation
vals.reverse! if (endian == :big)
vals = vals.collect { |val| "#{val} & #{mask}" } # TODO: "& mask" is needed to work around jruby bug. Remove this line when fixed.
@ -160,7 +162,7 @@ module BinData
directives = { 8 => "C", 16 => "S", 32 => "L", 64 => "Q" }
d = directives[bits_per_word(nbits)]
d << ((endian == :big) ? ">" : "<") unless d == "C"
d += ((endian == :big) ? ">" : "<") unless d == "C"
if signed == :signed && directives.key?(nbits)
(d * nwords).downcase

View File

@ -169,7 +169,7 @@ module BinData
unless @read_data.empty? || @in_readahead
bytes_to_consume = [n, @read_data.length].min
data << @read_data.slice!(0, bytes_to_consume)
data += @read_data.slice!(0, bytes_to_consume)
n -= bytes_to_consume
if @read_data.empty?
@ -180,10 +180,10 @@ module BinData
end
raw_data = @raw_io.read(n)
data << raw_data if raw_data
data += raw_data if raw_data
if @in_readahead
@read_data << data
@read_data += data
end
@offset += data.size

View File

@ -54,7 +54,7 @@ module BinData
# read until zero byte or we have read in the max number of bytes
while ch != "\0" && i != max_length
ch = io.readbytes(1)
str << ch
str += ch
i += 1
end

View File

@ -0,0 +1,3 @@
module BinData
VERSION = "2.4.10"
end

View File

@ -1,3 +0,0 @@
module BinData
VERSION = "2.4.8"
end