From 33b96426d68f3f0fc7ab7982011fe84c2cfa8762 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 23 Sep 2016 23:46:39 -0400 Subject: [PATCH] Bit set and unset --- include/cyclone/runtime.h | 4 ++-- runtime.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 4bc02445..2d82c322 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -258,8 +258,8 @@ object Cyc_sum(void *data, object cont, int argc, object n, ...); object Cyc_sub(void *data, object cont, int argc, object n, ...); object Cyc_mul(void *data, object cont, int argc, object n, ...); object Cyc_div(void *data, object cont, int argc, object n, ...); -object Cyc_bit_and(void *data, object n1, object n2); -object Cyc_bit_or(void *data, object n1, object n2); +object Cyc_bit_unset(void *data, object n1, object n2); +object Cyc_bit_set(void *data, object n1, object n2); object Cyc_num_op_va_list(void *data, int argc, object(fn_op(void *, common_type *, object)), int default_no_args, int default_one_arg, object n, diff --git a/runtime.c b/runtime.c index cb07f8ad..8316b528 100644 --- a/runtime.c +++ b/runtime.c @@ -4500,15 +4500,15 @@ void vpbuffer_free(void **buf) free(buf); } -object Cyc_bit_and(void *data, object n1, object n2) +object Cyc_bit_unset(void *data, object n1, object n2) { Cyc_check_int(data, n1); Cyc_check_int(data, n2); return (obj_int2obj( - obj_obj2int(n1) & obj_obj2int(n2))); + obj_obj2int(n1) & ~(obj_obj2int(n2)))); } -object Cyc_bit_or(void *data, object n1, object n2) +object Cyc_bit_set(void *data, object n1, object n2) { Cyc_check_int(data, n1); Cyc_check_int(data, n2);