From af27abbaca18ec20e74c0850d4dc80eda150c995 Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Thu, 23 May 2024 20:17:13 +0200 Subject: [PATCH] Replace C memcmp/cpy with copyMem/cmpMem Signed-off-by: Christopher Arndt --- src/nymph/atom/util.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nymph/atom/util.nim b/src/nymph/atom/util.nim index 4e38f3e..eb1d9e6 100644 --- a/src/nymph/atom/util.nim +++ b/src/nymph/atom/util.nim @@ -10,7 +10,6 @@ ## Utilities for working with atoms. ## -from system/ansi_c import c_memcmp, c_memcpy import ../atom import ../ptrmath import ../urid @@ -40,7 +39,7 @@ proc atomIsNull*(atom: ptr Atom): bool {.inline.} = proc atomEquals*(a: ptr Atom; b: ptr Atom): bool {.inline.} = return (a == b) or ((a.`type` == b.`type`) and (a.size == b.size) and - c_memcmp(a + 1, b + 1, a.size) == 0) + cmpMem(a + 1, b + 1, a.size) == 0) ## ## Sequence Iterator @@ -126,7 +125,7 @@ proc atomSequenceAppendEvent*(seq: ptr AtomSequence; capacity: uint32; return nil var e = atomSequenceEnd(seq.body.addr, seq.atom.size) - c_memcpy(e, event, totalSize) + copyMem(e, event, totalSize) seq.atom.size += atomPadSize(totalSize) return e