lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Send a value on a given number of bits.
# IN assertion: length <= 16 and value fits in length bits.
Send a value on a given number of bits.
IN assertion: length <= 16 and value fits in length bits.
Send a value on a given number of bits . IN assertion : length < = 16 and value fits in length bits .
def send_bits(s,value,length)
    if (s.bi_valid > Buf_size - length)
      s.bi_buf |= (value << s.bi_valid)
      s.bi_buf &= 0xffff
      s.pending_buf[s.pending] = s.bi_buf & 0xff
      s.pending += 1
      s.pending_buf[s.pending] = s.bi_buf >> 8
      s.pending += 1
      s.bi_buf = value >> (Buf_size - s.bi_valid)
      s.bi_valid += length - Buf_size
    else
      s.bi_buf |= (value << s.bi_valid)
      s.bi_valid += length
    end
  end
def send_bits ( s , value , length ) if ( s . bi_valid > Buf_size - length ) s . bi_buf |= ( value << s . bi_valid ) s . bi_buf &= 0xffff s . pending_buf [ s . pending ] = s . bi_buf & 0xff s . pending += 1 s . pending_buf [ s . pending ] = s . bi_buf >> 8 s . pending += 1 s . bi_buf = value >> ( Buf_size - s . bi_valid ) s . bi_valid += length - Buf_size else s . bi_buf |= ( value << s . bi_valid ) s . bi_valid += length end end
Send a value on a given number of bits.
Send a value on a given number of bits .
s
<not_specific>
value
<not_specific>
length
<not_specific>