1818/* On success, return value >= 0
1919 On failure, return -1 */
2020static inline Py_ssize_t
21- Buffer_InitAndGrow (_BlocksOutputBuffer * buffer , Py_ssize_t max_length ,
22- char * * next_out , uint32_t * avail_out )
21+ OutputBuffer_InitAndGrow (_BlocksOutputBuffer * buffer , Py_ssize_t max_length ,
22+ char * * next_out , uint32_t * avail_out )
2323{
2424 Py_ssize_t allocated ;
2525
@@ -32,8 +32,8 @@ Buffer_InitAndGrow(_BlocksOutputBuffer *buffer, Py_ssize_t max_length,
3232/* On success, return value >= 0
3333 On failure, return -1 */
3434static inline Py_ssize_t
35- Buffer_Grow (_BlocksOutputBuffer * buffer ,
36- char * * next_out , uint32_t * avail_out )
35+ OutputBuffer_Grow (_BlocksOutputBuffer * buffer ,
36+ char * * next_out , uint32_t * avail_out )
3737{
3838 Py_ssize_t allocated ;
3939
@@ -44,19 +44,19 @@ Buffer_Grow(_BlocksOutputBuffer *buffer,
4444}
4545
4646static inline Py_ssize_t
47- Buffer_GetDataSize (_BlocksOutputBuffer * buffer , uint32_t avail_out )
47+ OutputBuffer_GetDataSize (_BlocksOutputBuffer * buffer , uint32_t avail_out )
4848{
4949 return _BlocksOutputBuffer_GetDataSize (buffer , (Py_ssize_t ) avail_out );
5050}
5151
5252static inline PyObject *
53- Buffer_Finish (_BlocksOutputBuffer * buffer , uint32_t avail_out )
53+ OutputBuffer_Finish (_BlocksOutputBuffer * buffer , uint32_t avail_out )
5454{
5555 return _BlocksOutputBuffer_Finish (buffer , (Py_ssize_t ) avail_out );
5656}
5757
5858static inline void
59- Buffer_OnError (_BlocksOutputBuffer * buffer )
59+ OutputBuffer_OnError (_BlocksOutputBuffer * buffer )
6060{
6161 _BlocksOutputBuffer_OnError (buffer );
6262}
@@ -177,7 +177,7 @@ compress(BZ2Compressor *c, char *data, size_t len, int action)
177177 PyObject * result ;
178178 _BlocksOutputBuffer buffer = {.list = NULL };
179179
180- if (Buffer_InitAndGrow (& buffer , -1 , & c -> bzs .next_out , & c -> bzs .avail_out ) < 0 ) {
180+ if (OutputBuffer_InitAndGrow (& buffer , -1 , & c -> bzs .next_out , & c -> bzs .avail_out ) < 0 ) {
181181 goto error ;
182182 }
183183 c -> bzs .next_in = data ;
@@ -198,7 +198,7 @@ compress(BZ2Compressor *c, char *data, size_t len, int action)
198198 break ;
199199
200200 if (c -> bzs .avail_out == 0 ) {
201- if (Buffer_Grow (& buffer , & c -> bzs .next_out , & c -> bzs .avail_out ) < 0 ) {
201+ if (OutputBuffer_Grow (& buffer , & c -> bzs .next_out , & c -> bzs .avail_out ) < 0 ) {
202202 goto error ;
203203 }
204204 }
@@ -215,13 +215,13 @@ compress(BZ2Compressor *c, char *data, size_t len, int action)
215215 break ;
216216 }
217217
218- result = Buffer_Finish (& buffer , c -> bzs .avail_out );
218+ result = OutputBuffer_Finish (& buffer , c -> bzs .avail_out );
219219 if (result != NULL ) {
220220 return result ;
221221 }
222222
223223error :
224- Buffer_OnError (& buffer );
224+ OutputBuffer_OnError (& buffer );
225225 return NULL ;
226226}
227227
@@ -442,7 +442,7 @@ decompress_buf(BZ2Decompressor *d, Py_ssize_t max_length)
442442 _BlocksOutputBuffer buffer = {.list = NULL };
443443 bz_stream * bzs = & d -> bzs ;
444444
445- if (Buffer_InitAndGrow (& buffer , max_length , & bzs -> next_out , & bzs -> avail_out ) < 0 ) {
445+ if (OutputBuffer_InitAndGrow (& buffer , max_length , & bzs -> next_out , & bzs -> avail_out ) < 0 ) {
446446 goto error ;
447447 }
448448
@@ -469,21 +469,22 @@ decompress_buf(BZ2Decompressor *d, Py_ssize_t max_length)
469469 } else if (d -> bzs_avail_in_real == 0 ) {
470470 break ;
471471 } else if (bzs -> avail_out == 0 ) {
472- if (Buffer_GetDataSize (& buffer , bzs -> avail_out ) == max_length )
472+ if (OutputBuffer_GetDataSize (& buffer , bzs -> avail_out ) == max_length ) {
473473 break ;
474- if (Buffer_Grow (& buffer , & bzs -> next_out , & bzs -> avail_out ) < 0 ) {
474+ }
475+ if (OutputBuffer_Grow (& buffer , & bzs -> next_out , & bzs -> avail_out ) < 0 ) {
475476 goto error ;
476477 }
477478 }
478479 }
479480
480- result = Buffer_Finish (& buffer , bzs -> avail_out );
481+ result = OutputBuffer_Finish (& buffer , bzs -> avail_out );
481482 if (result != NULL ) {
482483 return result ;
483484 }
484485
485486error :
486- Buffer_OnError (& buffer );
487+ OutputBuffer_OnError (& buffer );
487488 return NULL ;
488489}
489490
0 commit comments