@@ -83,7 +83,7 @@ if ISAL_DEF_MAX_HIST_BITS > zlib.MAX_WBITS:
83
83
" Please contact the developers." )
84
84
85
85
86
- cpdef adler32(data, unsigned long value = 1 ):
86
+ cpdef adler32(data, unsigned int value = 1 ):
87
87
cdef Py_buffer buffer_data
88
88
cdef Py_buffer* buffer = & buffer_data
89
89
if PyObject_GetBuffer(data, buffer , PyBUF_READ & PyBUF_C_CONTIGUOUS) != 0 :
@@ -95,7 +95,7 @@ cpdef adler32(data, unsigned long value = 1):
95
95
finally :
96
96
PyBuffer_Release(buffer )
97
97
98
- cpdef crc32(data, unsigned long value = 0 ):
98
+ cpdef crc32(data, unsigned int value = 0 ):
99
99
cdef Py_buffer buffer_data
100
100
cdef Py_buffer* buffer = & buffer_data
101
101
if PyObject_GetBuffer(data, buffer , PyBUF_READ & PyBUF_C_CONTIGUOUS) != 0 :
@@ -117,14 +117,14 @@ ctypedef fused stream_or_state:
117
117
isal_zstream
118
118
inflate_state
119
119
120
- cdef unsigned long unsigned_long_min (unsigned long a, unsigned long b):
120
+ cdef unsigned int unsigned_int_min (unsigned int a, unsigned int b):
121
121
if a <= b:
122
122
return a
123
123
else :
124
124
return b
125
125
126
126
cdef void arrange_input_buffer(stream_or_state * stream, Py_ssize_t * remains):
127
- stream.avail_in = unsigned_long_min (< unsigned long > remains[0 ], UINT32_MAX)
127
+ stream.avail_in = unsigned_int_min (< unsigned int > remains[0 ], UINT32_MAX)
128
128
remains[0 ] -= stream.avail_in
129
129
130
130
def compress (data ,
@@ -135,7 +135,7 @@ def compress(data,
135
135
136
136
# Initialise stream
137
137
cdef isal_zstream stream
138
- cdef unsigned long level_buf_size = zlib_mem_level_to_isal(level, DEF_MEM_LEVEL)
138
+ cdef unsigned int level_buf_size = zlib_mem_level_to_isal(level, DEF_MEM_LEVEL)
139
139
cdef unsigned char * level_buf = < unsigned char * > PyMem_Malloc(level_buf_size * sizeof(char ))
140
140
isal_deflate_init(& stream)
141
141
stream.level = level
@@ -146,7 +146,7 @@ def compress(data,
146
146
& stream.gzip_flag)
147
147
148
148
# Initialise output buffer
149
- cdef unsigned long obuflen = DEF_BUF_SIZE
149
+ cdef unsigned int obuflen = DEF_BUF_SIZE
150
150
cdef unsigned char * obuf = < unsigned char * > PyMem_Malloc(obuflen * sizeof(char ))
151
151
out = []
152
152
@@ -223,7 +223,7 @@ cpdef decompress(data,
223
223
stream.next_in = ibuf
224
224
225
225
# Initialise output buffer
226
- cdef unsigned long obuflen = bufsize
226
+ cdef unsigned int obuflen = bufsize
227
227
cdef unsigned char * obuf = < unsigned char * > PyMem_Malloc(obuflen * sizeof(char ))
228
228
out = []
229
229
cdef int err
@@ -281,7 +281,7 @@ cdef class Compress:
281
281
cdef isal_zstream stream
282
282
cdef unsigned char * level_buf
283
283
cdef unsigned char * obuf
284
- cdef unsigned long obuflen
284
+ cdef unsigned int obuflen
285
285
286
286
def __cinit__ (self ,
287
287
int level = ISAL_DEFAULT_COMPRESSION,
@@ -394,7 +394,7 @@ cdef class Decompress:
394
394
cdef bint is_initialised
395
395
cdef inflate_state stream
396
396
cdef unsigned char * obuf
397
- cdef unsigned long obuflen
397
+ cdef unsigned int obuflen
398
398
399
399
def __cinit__ (self , wbits = ISAL_DEF_MAX_HIST_BITS, zdict = None ):
400
400
isal_inflate_init(& self .stream)
@@ -451,8 +451,8 @@ cdef class Decompress:
451
451
cdef unsigned char * ibuf = < unsigned char * > buffer .buf
452
452
self .stream.next_in = ibuf
453
453
self .stream.avail_out = 0
454
- cdef unsigned long prev_avail_out
455
- cdef unsigned long bytes_written
454
+ cdef unsigned int prev_avail_out
455
+ cdef unsigned int bytes_written
456
456
cdef Py_ssize_t unused_bytes
457
457
cdef int err
458
458
@@ -510,10 +510,10 @@ cdef class Decompress:
510
510
cdef unsigned char * ibuf = < unsigned char * > buffer .buf
511
511
self .stream.next_in = ibuf
512
512
513
- cdef unsigned long total_bytes = 0
514
- cdef unsigned long bytes_written
513
+ cdef unsigned int total_bytes = 0
514
+ cdef unsigned int bytes_written
515
515
out = []
516
- cdef unsigned long obuflen = length
516
+ cdef unsigned int obuflen = length
517
517
cdef unsigned char * obuf = < unsigned char * > PyMem_Malloc(obuflen * sizeof(char ))
518
518
cdef Py_ssize_t unused_bytes
519
519
@@ -557,8 +557,8 @@ cdef wbits_to_flag_and_hist_bits_deflate(int wbits,
557
557
558
558
559
559
cdef wbits_to_flag_and_hist_bits_inflate(int wbits,
560
- unsigned long * hist_bits,
561
- unsigned long * crc_flag):
560
+ unsigned int * hist_bits,
561
+ unsigned int * crc_flag):
562
562
if wbits == 0 :
563
563
hist_bits[0 ] = 0
564
564
crc_flag[0 ] = ISAL_ZLIB
0 commit comments