3939 * @param pFrameData encoding buffer
4040 * @param nMaxFrameDataSize max encoding buffer size, in bytes
4141 * @param nBlockMaxCode max block size code (4-7)
42- * @param bIndependentBlocks true if the stream contains independently compressed blocks, false if blocks back-reference the previous block
42+ * @param nIsIndependentBlocks nonzero if the stream contains independently compressed blocks, 0 if blocks back-reference the previous block
4343 *
4444 * @return number of encoded bytes, or -1 for failure
4545 */
46- int lz4ultra_encode_header (unsigned char * pFrameData , const int nMaxFrameDataSize , int nBlockMaxCode , bool bIndependentBlocks ) {
46+ int lz4ultra_encode_header (unsigned char * pFrameData , const int nMaxFrameDataSize , int nBlockMaxCode , int nIsIndependentBlocks ) {
4747 if (nMaxFrameDataSize >= 7 ) {
4848 pFrameData [0 ] = 0x04 ; /* Magic number: 0x184D2204 */
4949 pFrameData [1 ] = 0x22 ;
5050 pFrameData [2 ] = 0x4D ;
5151 pFrameData [3 ] = 0x18 ;
5252
5353 pFrameData [4 ] = 0b01000000 ; /* Version.Hi Version.Lo !B.Indep B.Checksum Content.Size Content.Checksum Reserved.Hi Reserved.Lo */
54- if (bIndependentBlocks )
54+ if (nIsIndependentBlocks )
5555 pFrameData [4 ] |= 0b00100000 ; /* B.Indep */
5656 pFrameData [5 ] = nBlockMaxCode << 4 ; /* Block MaxSize */
5757
@@ -136,11 +136,11 @@ int lz4ultra_encode_footer_frame(unsigned char *pFrameData, const int nMaxFrameD
136136 * @param pFrameData data bytes
137137 * @param nFrameDataSize number of bytes to decode
138138 * @param nBlockMaxCode pointer to max block size code (4-7), updated if this function succeeds
139- * @param bIndependentBlocks returned flag that indicates if the stream contains independently compressed blocks
139+ * @param nIsIndependentBlocks returned flag that indicates if the stream contains independently compressed blocks
140140 *
141141 * @return LZ4ULTRA_DECODE_OK for success, or LZ4ULTRA_DECODE_ERR_xxx for failure
142142 */
143- int lz4ultra_decode_header (const unsigned char * pFrameData , const int nFrameDataSize , int * nBlockMaxCode , bool * bIndependentBlocks ) {
143+ int lz4ultra_decode_header (const unsigned char * pFrameData , const int nFrameDataSize , int * nBlockMaxCode , int * nIsIndependentBlocks ) {
144144 if (nFrameDataSize == 7 ) {
145145 if (pFrameData [0 ] != 0x04 ||
146146 pFrameData [1 ] != 0x22 ||
@@ -156,7 +156,7 @@ int lz4ultra_decode_header(const unsigned char *pFrameData, const int nFrameData
156156 return LZ4ULTRA_DECODE_ERR_SUM ;
157157 }
158158
159- * bIndependentBlocks = (pFrameData [4 ] & 0x20 ) != 0 ;
159+ * nIsIndependentBlocks = (pFrameData [4 ] & 0x20 ) ? 1 : 0 ;
160160 * nBlockMaxCode = (pFrameData [5 ] >> 4 );
161161
162162 return LZ4ULTRA_DECODE_OK ;
@@ -176,14 +176,14 @@ int lz4ultra_decode_header(const unsigned char *pFrameData, const int nFrameData
176176 *
177177 * @return LZ4ULTRA_DECODE_OK for success, or LZ4ULTRA_DECODE_ERR_FORMAT for failure
178178 */
179- int lz4ultra_decode_frame (const unsigned char * pFrameData , const int nFrameDataSize , unsigned int * nBlockSize , bool * bIsUncompressed ) {
179+ int lz4ultra_decode_frame (const unsigned char * pFrameData , const int nFrameDataSize , unsigned int * nBlockSize , int * nIsUncompressed ) {
180180 if (nFrameDataSize == 4 ) {
181181 * nBlockSize = ((unsigned int )pFrameData [0 ]) |
182182 (((unsigned int )pFrameData [1 ]) << 8 ) |
183183 (((unsigned int )pFrameData [2 ]) << 16 ) |
184184 (((unsigned int )pFrameData [3 ]) << 24 );
185185
186- * bIsUncompressed = ((* nBlockSize ) & 0x80000000 ) != 0 ;
186+ * nIsUncompressed = ((* nBlockSize ) & 0x80000000 ) ? 1 : 0 ;
187187 (* nBlockSize ) &= 0x7fffffff ;
188188 return 0 ;
189189 }
0 commit comments