summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-09-17 09:49:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-09-17 09:49:25 -0700
commit4a5a29a76b8e5aa139209aabe310c2179a60608d (patch)
tree498688e76d70fcf1504b02f105b750eaa4f8371d
parent01628a8244053ced7dd0f20e13e4ce3ff3e81481 (diff)
downloadtxr-4a5a29a76b8e5aa139209aabe310c2179a60608d.tar.gz
txr-4a5a29a76b8e5aa139209aabe310c2179a60608d.tar.bz2
txr-4a5a29a76b8e5aa139209aabe310c2179a60608d.zip
* arith.c (comp_trunc, logcomp): logcomp renamed to lognot,
consistent with Common Lisp. * eval.c (eval_init): logcomp to lognot. * lib.h (logcomp): Declaration updated.
-rw-r--r--ChangeLog9
-rw-r--r--arith.c12
-rw-r--r--eval.c2
-rw-r--r--lib.h2
4 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index c6c065dd..c206ba7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2012-09-17 Kaz Kylheku <kaz@kylheku.com>
+ * arith.c (comp_trunc, logcomp): logcomp renamed to lognot,
+ consistent with Common Lisp.
+
+ * eval.c (eval_init): logcomp to lognot.
+
+ * lib.h (logcomp): Declaration updated.
+
+2012-09-17 Kaz Kylheku <kaz@kylheku.com>
+
* arith.c (highest_significant_bit): New static function.
(comp_clamp): Bugfix: avoid shifting left into sign bit. Function
renamed to comp_trunc.
diff --git a/arith.c b/arith.c
index 75f4748d..1d63d1a9 100644
--- a/arith.c
+++ b/arith.c
@@ -1649,16 +1649,16 @@ static val comp_trunc(val a, val bits)
}
bad:
- uw_throwf(error_s, lit("logcomp: operation failed on ~s"), a, nao);
+ uw_throwf(error_s, lit("lognot: operation failed on ~s"), a, nao);
bad2:
- uw_throwf(error_s, lit("logcomp: bits value ~s is not a fixnum"), bits, nao);
+ uw_throwf(error_s, lit("lognot: bits value ~s is not a fixnum"), bits, nao);
bad3:
- uw_throwf(error_s, lit("logcomp: non-integral operand ~s"), a, nao);
+ uw_throwf(error_s, lit("lognot: non-integral operand ~s"), a, nao);
}
-val logcomp(val a, val bits)
+val lognot(val a, val bits)
{
val b;
@@ -1674,11 +1674,11 @@ val logcomp(val a, val bits)
goto bad;
return b;
default:
- uw_throwf(error_s, lit("logcomp: non-integral operand ~s"), a, nao);
+ uw_throwf(error_s, lit("lognot: non-integral operand ~s"), a, nao);
}
bad:
- uw_throwf(error_s, lit("logcomp: operation failed on ~s"), a, nao);
+ uw_throwf(error_s, lit("lognot: operation failed on ~s"), a, nao);
}
val logtrunc(val a, val bits)
diff --git a/eval.c b/eval.c
index ec5db76a..298e6484 100644
--- a/eval.c
+++ b/eval.c
@@ -2234,7 +2234,7 @@ void eval_init(void)
reg_fun(intern(lit("logand"), user_package), func_n2(logand));
reg_fun(intern(lit("logior"), user_package), func_n2(logior));
reg_fun(intern(lit("logxor"), user_package), func_n2(logxor));
- reg_fun(intern(lit("logcomp"), user_package), func_n2o(logcomp, 1));
+ reg_fun(intern(lit("lognot"), user_package), func_n2o(lognot, 1));
reg_fun(intern(lit("logtrunc"), user_package), func_n2(logtrunc));
reg_fun(intern(lit("ash"), user_package), func_n2(ash));
diff --git a/lib.h b/lib.h
index 2f49d347..075bb6ad 100644
--- a/lib.h
+++ b/lib.h
@@ -474,7 +474,7 @@ val expo(val);
val logand(val, val);
val logior(val, val);
val logxor(val, val);
-val logcomp(val, val);
+val lognot(val, val);
val logtrunc(val a, val bits);
val ash(val a, val bits);
val string_own(wchar_t *str);