@@ -43,12 +43,12 @@ program test_zlib
43
43
rc = zip_deflate_mem(IN , out1, Z_DEFAULT_COMPRESSION)
44
44
if (rc /= Z_OK) stop ' Error: zip_deflate_mem() failed'
45
45
46
- rc = zip_inflate_mem(out1, out2, len (in ) * 2 )
46
+ rc = zip_inflate_mem(out1, out2, len (IN ) * 2 )
47
47
if (rc /= Z_OK) stop ' Error: zip_inflate_mem() failed'
48
48
49
49
if (IN /= out2) stop ' Error: data mismatch'
50
50
51
- print ' ("source size......: ", i0)' , len (in )
51
+ print ' ("source size......: ", i0)' , len (IN )
52
52
print ' ("deflate size.....: ", i0)' , len (out1)
53
53
print ' ("inflate size.....: ", i0)' , len (out2)
54
54
contains
@@ -87,7 +87,7 @@ integer function zip_deflate_file(source, dest, level) result(rc)
87
87
do i = 1 , CHUNK
88
88
read (in_unit, iostat= err) byte
89
89
90
- if (is_iostat_end(stat )) then
90
+ if (is_iostat_end(err )) then
91
91
flush = Z_FINISH
92
92
exit
93
93
end if
@@ -174,23 +174,23 @@ integer function zip_inflate_file(source, dest) result(rc)
174
174
rc = inflate_init(strm)
175
175
if (rc /= Z_OK) return
176
176
177
- def_block : block
177
+ inf_block : block
178
178
rc = Z_ERRNO
179
179
180
180
open (access= ' stream' , action= ' read' , file= source, form= ' unformatted' , &
181
181
iostat= err, newunit= in_unit, status= ' old' )
182
- if (err /= 0 ) exit def_block
182
+ if (err /= 0 ) exit inf_block
183
183
184
184
open (access= ' stream' , action= ' write' , file= dest, form= ' unformatted' , &
185
185
iostat= err, newunit= out_unit, status= ' replace' )
186
- if (err /= 0 ) exit def_block
186
+ if (err /= 0 ) exit inf_block
187
187
188
188
do
189
189
n = 0
190
190
191
191
do i = 1 , CHUNK
192
192
read (in_unit, iostat= err) byte
193
- if (is_iostat_end(stat )) exit
193
+ if (is_iostat_end(err )) exit
194
194
195
195
in (i:i) = byte
196
196
n = n + 1
@@ -203,21 +203,21 @@ integer function zip_inflate_file(source, dest) result(rc)
203
203
strm% avail_out = CHUNK
204
204
strm% next_out = c_loc(out )
205
205
rc = inflate(strm, Z_NO_FLUSH)
206
- if (rc == Z_STREAM_ERROR) exit def_block
207
- if (rc == Z_NEED_DICT) exit def_block
208
- if (rc == Z_DATA_ERROR) exit def_block
209
- if (rc == Z_MEM_ERROR) exit def_block
206
+ if (rc == Z_STREAM_ERROR) exit inf_block
207
+ if (rc == Z_NEED_DICT) exit inf_block
208
+ if (rc == Z_DATA_ERROR) exit inf_block
209
+ if (rc == Z_MEM_ERROR) exit inf_block
210
210
have = CHUNK - strm% avail_out
211
211
write (out_unit, iostat= err) out (1 :have)
212
- if (err /= 0 ) exit def_block
212
+ if (err /= 0 ) exit inf_block
213
213
if (strm% avail_out /= 0 ) exit
214
214
end do
215
215
216
216
if (rc == Z_STREAM_END) exit
217
217
end do
218
218
219
219
rc = Z_OK
220
- end block def_block
220
+ end block inf_block
221
221
222
222
err = inflate_end(strm)
223
223
close (out_unit)
@@ -238,7 +238,7 @@ integer function zip_inflate_mem(source, dest, buffer_size) result(rc)
238
238
rc = inflate_init(strm)
239
239
if (rc /= Z_OK) return
240
240
241
- def_block : block
241
+ inf_block : block
242
242
strm% total_in = len (source)
243
243
strm% avail_in = len (source)
244
244
strm% next_in = c_loc(source)
@@ -248,13 +248,13 @@ integer function zip_inflate_mem(source, dest, buffer_size) result(rc)
248
248
strm% next_out = c_loc(buffer)
249
249
250
250
rc = inflate(strm, Z_FINISH)
251
- if (rc == Z_STREAM_ERROR) exit def_block
251
+ if (rc == Z_STREAM_ERROR) exit inf_block
252
252
have = len (buffer) - strm% avail_out
253
253
dest = buffer(1 :have)
254
254
255
- if (rc /= Z_STREAM_END) exit def_block
255
+ if (rc /= Z_STREAM_END) exit inf_block
256
256
rc = Z_OK
257
- end block def_block
257
+ end block inf_block
258
258
259
259
err = inflate_end(strm)
260
260
end function zip_inflate_mem
0 commit comments