Bit set and unset

This commit is contained in:
Justin Ethier 2016-09-23 23:46:39 -04:00
parent 94d9e9a4ca
commit 33b96426d6
2 changed files with 5 additions and 5 deletions

View file

@ -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_sub(void *data, object cont, int argc, object n, ...);
object Cyc_mul(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_div(void *data, object cont, int argc, object n, ...);
object Cyc_bit_and(void *data, object n1, object n2); object Cyc_bit_unset(void *data, object n1, object n2);
object Cyc_bit_or(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 Cyc_num_op_va_list(void *data, int argc,
object(fn_op(void *, common_type *, object)), object(fn_op(void *, common_type *, object)),
int default_no_args, int default_one_arg, object n, int default_no_args, int default_one_arg, object n,

View file

@ -4500,15 +4500,15 @@ void vpbuffer_free(void **buf)
free(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, n1);
Cyc_check_int(data, n2); Cyc_check_int(data, n2);
return (obj_int2obj( 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, n1);
Cyc_check_int(data, n2); Cyc_check_int(data, n2);