aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2023-05-01 08:23:38 -0700
committerRose Hogenson <rhogenson@posteo.net>2023-05-01 08:23:38 -0700
commit1c5678f77a61cf84f458376cccbd86a6d6942457 (patch)
tree050cb6209cc15dc30940a459d8bad40f249d9e36 /lib
parenta89d6c82e981fec7d6e4c975e083d2b9e04467ad (diff)
downloadchromatopelma-1c5678f77a61cf84f458376cccbd86a6d6942457.tar.zst
Fix an encoding issue for negative numbers.
Diffstat (limited to 'lib')
-rw-r--r--lib/csc/encoding.scheme4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/csc/encoding.scheme b/lib/csc/encoding.scheme
index dfe6fb7..04f4dee 100644
--- a/lib/csc/encoding.scheme
+++ b/lib/csc/encoding.scheme
@@ -1,5 +1,5 @@
(define-library (csc encoding)
- (export encode translate-labels)
+ (export encode int->le-bytes)
(import (scheme base)
(prefix (csc list) list.)
(prefix (csc map) map.))
@@ -96,7 +96,7 @@
(< n #x-4000000000000000))
(error "int constant too large" n))
(when (negative? n)
- (set! n (- #x10000000000000000 n)))
+ (set! n (+ #x10000000000000000 n)))
(64->le-bytes w (+ 1 (* 2 n))))