reduce compiler warnings

This commit is contained in:
jangko 2023-01-31 13:00:53 +07:00
parent 4c5e225eeb
commit fea05cde8b
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9

View File

@ -183,11 +183,11 @@ proc compress(zs: var ZStream, data: openArray[byte]): seq[byte] =
# these casting is needed to prevent compilation # these casting is needed to prevent compilation
# error with CLANG # error with CLANG
zs.next_in = cast[ptr cuchar](data[0].unsafeAddr) zs.next_in = cast[ptr uint8](data[0].unsafeAddr)
zs.avail_in = data.len.cuint zs.avail_in = data.len.cuint
while true: while true:
zs.next_out = cast[ptr cuchar](buf[0].addr) zs.next_out = cast[ptr uint8](buf[0].addr)
zs.avail_out = buf.len.cuint zs.avail_out = buf.len.cuint
let r = zs.deflate(Z_SYNC_FLUSH) let r = zs.deflate(Z_SYNC_FLUSH)
@ -210,11 +210,11 @@ proc decompress(zs: var ZStream, limit: int, data: openArray[byte]): seq[byte] =
# these casting is needed to prevent compilation # these casting is needed to prevent compilation
# error with CLANG # error with CLANG
zs.next_in = cast[ptr cuchar](data[0].unsafeAddr) zs.next_in = cast[ptr uint8](data[0].unsafeAddr)
zs.avail_in = data.len.cuint zs.avail_in = data.len.cuint
while true: while true:
zs.next_out = cast[ptr cuchar](buf[0].addr) zs.next_out = cast[ptr uint8](buf[0].addr)
zs.avail_out = buf.len.cuint zs.avail_out = buf.len.cuint
let r = zs.inflate(Z_NO_FLUSH) let r = zs.inflate(Z_NO_FLUSH)