summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-12-17 14:35:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-12-17 14:35:21 -0800
commitf9ea3b7c156391758aa0356c7636983393184a39 (patch)
treea456bb87ad8b1f3e06374259b8f61578b03eaddd /lib.h
parentcd5959194340d95f08abf8230d7f5e5a72728eb9 (diff)
downloadtxr-f9ea3b7c156391758aa0356c7636983393184a39.tar.gz
txr-f9ea3b7c156391758aa0356c7636983393184a39.tar.bz2
txr-f9ea3b7c156391758aa0356c7636983393184a39.zip
* lib.c (make_package, find_package): Eliminate declaration
in the middle of statement block. * lib.h (TAG_MASK): Becomes type cnum rather than long. (nao): Based off 1 rather than -1 to avoid left shift of negative number.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib.h b/lib.h
index 6188fc83..a3f43a31 100644
--- a/lib.h
+++ b/lib.h
@@ -24,8 +24,10 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+typedef int_ptr_t cnum;
+
#define TAG_SHIFT 2
-#define TAG_MASK ((1L << TAG_SHIFT) - 1)
+#define TAG_MASK (((cnum) 1 << TAG_SHIFT) - 1)
#define TAG_PTR 0
#define TAG_NUM 1
#define TAG_CHR 2
@@ -33,8 +35,6 @@
#define NUM_MAX (INT_PTR_MAX/4)
#define NUM_MIN (INT_PTR_MIN/4)
-typedef int_ptr_t cnum;
-
typedef enum type {
NUM = TAG_NUM, CHR = TAG_CHR, LIT = TAG_LIT, CONS,
STR, SYM, PKG, FUN, VEC, LCONS, LSTR, COBJ
@@ -379,7 +379,7 @@ val match(val spec, val data);
#define nil ((obj_t *) 0)
-#define nao ((obj_t *) (-1 << TAG_SHIFT)) /* "not an object" sentinel value. */
+#define nao ((obj_t *) (1 << TAG_SHIFT)) /* "not an object" sentinel value. */
#define eq(a, b) ((a) == (b) ? t : nil)