1010 *
1111 * Precondition: NULL != stream
1212 */
13- simplicity_err rustsimplicity_0_5_closeBitstream (bitstream * stream ) {
13+ simplicity_err rustsimplicity_0_6_closeBitstream (bitstream * stream ) {
1414 if (1 < stream -> len ) return SIMPLICITY_ERR_BITSTREAM_TRAILING_BYTES ; /* If there is more than one byte remaining. */
1515 if (1 == stream -> len ) {
1616 if (0 == stream -> offset ) return SIMPLICITY_ERR_BITSTREAM_TRAILING_BYTES ; /* If there is one byte remaining */
@@ -30,8 +30,8 @@ simplicity_err rustsimplicity_0_5_closeBitstream(bitstream* stream) {
3030 * Precondition: 0 <= n < 32
3131 * NULL != stream
3232 */
33- int32_t rustsimplicity_0_5_readNBits (int n , bitstream * stream ) {
34- rustsimplicity_0_5_assert (0 <= n && n < 32 );
33+ int32_t rustsimplicity_0_6_readNBits (int n , bitstream * stream ) {
34+ rustsimplicity_0_6_assert (0 <= n && n < 32 );
3535
3636 uint32_t result = 0 ;
3737 while (CHAR_BIT <= stream -> offset + n ) {
@@ -109,7 +109,7 @@ static int32_t decodeUpto3Bits(int32_t* result, bitstream* stream) {
109109 } else {
110110 int32_t n = decodeUpto3 (stream );
111111 if (0 <= n ) {
112- * result = rustsimplicity_0_5_readNBits (n , stream );
112+ * result = rustsimplicity_0_6_readNBits (n , stream );
113113 if (* result < 0 ) return * result ;
114114 }
115115 return n ;
@@ -153,7 +153,7 @@ static int32_t decodeUpto15Bits(int32_t* result, bitstream* stream) {
153153 } else {
154154 int32_t n = decodeUpto15 (stream );
155155 if (0 <= n ) {
156- * result = rustsimplicity_0_5_readNBits (n , stream );
156+ * result = rustsimplicity_0_6_readNBits (n , stream );
157157 if (* result < 0 ) return * result ;
158158 }
159159 return n ;
@@ -184,7 +184,7 @@ static int32_t decodeUpto65535(bitstream* stream) {
184184 *
185185 * Precondition: NULL != stream
186186 */
187- int32_t rustsimplicity_0_5_decodeUptoMaxInt (bitstream * stream ) {
187+ int32_t rustsimplicity_0_6_decodeUptoMaxInt (bitstream * stream ) {
188188 int32_t bit = read1Bit (stream );
189189 if (bit < 0 ) return bit ;
190190 if (0 == bit ) {
@@ -194,7 +194,7 @@ int32_t rustsimplicity_0_5_decodeUptoMaxInt(bitstream* stream) {
194194 if (n < 0 ) return n ;
195195 if (30 < n ) return SIMPLICITY_ERR_DATA_OUT_OF_RANGE ;
196196 {
197- int32_t result = rustsimplicity_0_5_readNBits (n , stream );
197+ int32_t result = rustsimplicity_0_6_readNBits (n , stream );
198198 if (result < 0 ) return result ;
199199 return ((1 << n ) | result );
200200 }
@@ -211,9 +211,9 @@ int32_t rustsimplicity_0_5_decodeUptoMaxInt(bitstream* stream) {
211211 * n <= 2^31
212212 * NULL != stream
213213 */
214- simplicity_err rustsimplicity_0_5_readBitstring (bitstring * result , size_t n , bitstream * stream ) {
214+ simplicity_err rustsimplicity_0_6_readBitstring (bitstring * result , size_t n , bitstream * stream ) {
215215 static_assert (0x80000000u + 2 * (CHAR_BIT - 1 ) <= SIZE_MAX , "size_t needs to be at least 32-bits" );
216- rustsimplicity_0_5_assert (n <= 0x80000000u );
216+ rustsimplicity_0_6_assert (n <= 0x80000000u );
217217 size_t total_offset = n + stream -> offset ;
218218 /* |= stream->len * CHAR_BIT < total_offset iff stream->len < (total_offset + (CHAR_BIT - 1)) / CHAR_BIT */
219219 if (stream -> len < (total_offset + (CHAR_BIT - 1 )) / CHAR_BIT ) return SIMPLICITY_ERR_BITSTREAM_EOF ;
0 commit comments