From 454e1e68bed843167127b47e03b8d94de420e88c Mon Sep 17 00:00:00 2001 From: Joel Kaasinen Date: Sun, 9 Dec 2018 18:07:19 +0200 Subject: [PATCH] core: fix Long_copy --- core/carp_long.h | 3 +-- test/long_math.carp | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/carp_long.h b/core/carp_long.h index b2015080..1dc49faa 100644 --- a/core/carp_long.h +++ b/core/carp_long.h @@ -25,7 +25,7 @@ long Long_bit_MINUS_or(long x, long y) { return x | y; } long Long_bit_MINUS_xor(long x, long y) { return x ^ y; } long Long_bit_MINUS_not(long x) { return ~x; } -int Long_copy(long *x) { return *x; } +long Long_copy(long *x) { return *x; } long Long_mod(long x, long divider) { return x % divider; @@ -46,4 +46,3 @@ int Long_to_MINUS_int(long a) { long Long_from_MINUS_int(int a) { return (long) a; } - diff --git a/test/long_math.carp b/test/long_math.carp index 278184a6..83bff650 100644 --- a/test/long_math.carp +++ b/test/long_math.carp @@ -3,6 +3,10 @@ (use-all Long Test) (deftest test + (assert-equal test + 21474836470l + @&21474836470l + "copy works as expected") (assert-equal test 1l (min 1l 2l)