powered by nequal
Home » IO_Bit » Timeline » 2333

Changeset 2333 -- 2011-01-27 22:43:07

Author
よや
Comment
incrementOffset で負の値を指定できるようにした

Diffs

IO_Bit/trunk/IO/Bit.php

@@ -42,6 +42,14 @@
function incrementOffset($byte_offset, $bit_offset) {
$this->_byte_offset += $byte_offset;
$this->_bit_offset  += $bit_offset;
+	while ($this->_bit_offset >= 8) {
+	        $this->_byte_offset += 1;
+		$this->_bit_offset  -= 8;
+	}
+	while ($this->_bit_offset < 0) {
+	        $this->_byte_offset -= 1;
+		$this->_bit_offset  += 8;
+	}
return true;
}
function getOffset() {