Skip to content

Commit

Permalink
Merge pull request #60 from guzba/ryan
Browse files Browse the repository at this point in the history
fix issue #59 (abort on alpine + nim 1.6.8 + gcc 12.2.1)
  • Loading branch information
guzba authored Apr 11, 2023
2 parents 908e00b + d0f7e03 commit 3b863db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/zippy/internal.nim
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,19 @@ when defined(release):
{.push checks: off.}

proc read16*(src: ptr UncheckedArray[uint8], ip: int): uint16 {.inline.} =
copyMem(result.addr, src[ip].addr, 2)
copyMem(result.addr, src[ip].unsafeAddr, 2)

proc read32*(src: ptr UncheckedArray[uint8], ip: int): uint32 {.inline.} =
copyMem(result.addr, src[ip].addr, 4)
copyMem(result.addr, src[ip].unsafeAddr, 4)

proc read64*(src: ptr UncheckedArray[uint8], ip: int): uint64 {.inline.} =
copyMem(result.addr, src[ip].addr, 8)
copyMem(result.addr, src[ip].unsafeAddr, 8)

proc write64*(dst: ptr UncheckedArray[uint8], op: int, v: uint64) {.inline.} =
copyMem(dst[op].addr, v.unsafeAddr, 8)
copyMem(dst[op].unsafeAddr, v.unsafeAddr, 8)

proc copy64*(dst, src: ptr UncheckedArray[uint8], op, ip: int) {.inline.} =
copyMem(dst[op].addr, dst[ip].addr, 8)
write64(dst, op, read64(src, ip))

proc read16*(s: string, pos: int): uint16 {.inline.} =
copyMem(result.addr, s[pos].unsafeAddr, 2)
Expand Down
2 changes: 1 addition & 1 deletion zippy.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.10.7"
version = "0.10.8"
author = "Ryan Oldenburg"
description = "Pure Nim implementation of deflate, zlib, gzip and zip."
license = "MIT"
Expand Down

0 comments on commit 3b863db

Please sign in to comment.