Skip to content

Commit 1487753

Browse files
committed
Minor fixes.
1 parent 0985c1d commit 1487753

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

test/test_zlib.f90

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ program test_zlib
4343
rc = zip_deflate_mem(IN, out1, Z_DEFAULT_COMPRESSION)
4444
if (rc /= Z_OK) stop 'Error: zip_deflate_mem() failed'
4545

46-
rc = zip_inflate_mem(out1, out2, len(in) * 2)
46+
rc = zip_inflate_mem(out1, out2, len(IN) * 2)
4747
if (rc /= Z_OK) stop 'Error: zip_inflate_mem() failed'
4848

4949
if (IN /= out2) stop 'Error: data mismatch'
5050

51-
print '("source size......: ", i0)', len(in)
51+
print '("source size......: ", i0)', len(IN)
5252
print '("deflate size.....: ", i0)', len(out1)
5353
print '("inflate size.....: ", i0)', len(out2)
5454
contains
@@ -87,7 +87,7 @@ integer function zip_deflate_file(source, dest, level) result(rc)
8787
do i = 1, CHUNK
8888
read (in_unit, iostat=err) byte
8989

90-
if (is_iostat_end(stat)) then
90+
if (is_iostat_end(err)) then
9191
flush = Z_FINISH
9292
exit
9393
end if
@@ -174,23 +174,23 @@ integer function zip_inflate_file(source, dest) result(rc)
174174
rc = inflate_init(strm)
175175
if (rc /= Z_OK) return
176176

177-
def_block: block
177+
inf_block: block
178178
rc = Z_ERRNO
179179

180180
open (access='stream', action='read', file=source, form='unformatted', &
181181
iostat=err, newunit=in_unit, status='old')
182-
if (err /= 0) exit def_block
182+
if (err /= 0) exit inf_block
183183

184184
open (access='stream', action='write', file=dest, form='unformatted', &
185185
iostat=err, newunit=out_unit, status='replace')
186-
if (err /= 0) exit def_block
186+
if (err /= 0) exit inf_block
187187

188188
do
189189
n = 0
190190

191191
do i = 1, CHUNK
192192
read (in_unit, iostat=err) byte
193-
if (is_iostat_end(stat)) exit
193+
if (is_iostat_end(err)) exit
194194

195195
in(i:i) = byte
196196
n = n + 1
@@ -203,21 +203,21 @@ integer function zip_inflate_file(source, dest) result(rc)
203203
strm%avail_out = CHUNK
204204
strm%next_out = c_loc(out)
205205
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
210210
have = CHUNK - strm%avail_out
211211
write (out_unit, iostat=err) out(1:have)
212-
if (err /= 0) exit def_block
212+
if (err /= 0) exit inf_block
213213
if (strm%avail_out /= 0) exit
214214
end do
215215

216216
if (rc == Z_STREAM_END) exit
217217
end do
218218

219219
rc = Z_OK
220-
end block def_block
220+
end block inf_block
221221

222222
err = inflate_end(strm)
223223
close (out_unit)
@@ -238,7 +238,7 @@ integer function zip_inflate_mem(source, dest, buffer_size) result(rc)
238238
rc = inflate_init(strm)
239239
if (rc /= Z_OK) return
240240

241-
def_block: block
241+
inf_block: block
242242
strm%total_in = len(source)
243243
strm%avail_in = len(source)
244244
strm%next_in = c_loc(source)
@@ -248,13 +248,13 @@ integer function zip_inflate_mem(source, dest, buffer_size) result(rc)
248248
strm%next_out = c_loc(buffer)
249249

250250
rc = inflate(strm, Z_FINISH)
251-
if (rc == Z_STREAM_ERROR) exit def_block
251+
if (rc == Z_STREAM_ERROR) exit inf_block
252252
have = len(buffer) - strm%avail_out
253253
dest = buffer(1:have)
254254

255-
if (rc /= Z_STREAM_END) exit def_block
255+
if (rc /= Z_STREAM_END) exit inf_block
256256
rc = Z_OK
257-
end block def_block
257+
end block inf_block
258258

259259
err = inflate_end(strm)
260260
end function zip_inflate_mem

0 commit comments

Comments
 (0)