diff options
-rw-r--r-- | libguile/continuations.c | 4 | ||||
-rw-r--r-- | libguile/control.c | 4 | ||||
-rw-r--r-- | libguile/foreign.c | 4 | ||||
-rw-r--r-- | libguile/gsubr.c | 4 | ||||
-rw-r--r-- | libguile/objcodes.c | 6 | ||||
-rw-r--r-- | libguile/objcodes.h | 21 | ||||
-rw-r--r-- | libguile/smob.c | 4 |
7 files changed, 25 insertions, 22 deletions
diff --git a/libguile/continuations.c b/libguile/continuations.c index b4789635f..dc6850e05 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1998,2000,2001,2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,2000,2001,2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -89,7 +89,7 @@ static const type sym##__unaligned[] #endif #define STATIC_OBJCODE_TAG \ - SCM_PACK (scm_tc7_objcode | (SCM_F_OBJCODE_IS_STATIC << 8)) + SCM_PACK (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_STATIC, 0)) #define SCM_STATIC_OBJCODE(sym) \ SCM_DECLARE_STATIC_ALIGNED_ARRAY (scm_t_uint8, sym##__bytecode); \ diff --git a/libguile/control.c b/libguile/control.c index 2ab4ce9ac..b6a558769 100644 --- a/libguile/control.c +++ b/libguile/control.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -99,7 +99,7 @@ static const type sym##__unaligned[] #endif #define STATIC_OBJCODE_TAG \ - SCM_PACK (scm_tc7_objcode | (SCM_F_OBJCODE_IS_STATIC << 8)) + SCM_PACK (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_STATIC, 0)) #define SCM_STATIC_OBJCODE(sym) \ SCM_DECLARE_STATIC_ALIGNED_ARRAY (scm_t_uint8, sym##__bytecode); \ diff --git a/libguile/foreign.c b/libguile/foreign.c index 082ec7f05..47579af0b 100644 --- a/libguile/foreign.c +++ b/libguile/foreign.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -734,7 +734,7 @@ static const struct (setq i (1+ i))))) */ #define STATIC_OBJCODE_TAG \ - SCM_PACK (scm_tc7_objcode | (SCM_F_OBJCODE_IS_STATIC << 8)) + SCM_PACK (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_STATIC, 0)) static const struct { diff --git a/libguile/gsubr.c b/libguile/gsubr.c index ef3ad232b..b6f261faf 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -313,7 +313,7 @@ static const struct */ #define STATIC_OBJCODE_TAG \ - SCM_PACK (scm_tc7_objcode | (SCM_F_OBJCODE_IS_STATIC << 8)) + SCM_PACK (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_STATIC, 0)) static const struct { diff --git a/libguile/objcodes.c b/libguile/objcodes.c index 68035f581..1c3c525f2 100644 --- a/libguile/objcodes.c +++ b/libguile/objcodes.c @@ -98,7 +98,7 @@ make_objcode_by_mmap (int fd) + data->metalen))); } - sret = scm_double_cell (scm_tc7_objcode | (SCM_F_OBJCODE_IS_MMAP<<8), + sret = scm_double_cell (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_MMAP, 0), (scm_t_bits)(addr + strlen (SCM_OBJCODE_COOKIE)), SCM_UNPACK (SCM_BOOL_F), (scm_t_bits)fd); @@ -139,7 +139,7 @@ scm_c_make_objcode_slice (SCM parent, const scm_t_uint8 *ptr) assert (SCM_C_OBJCODE_BASE (data) + data->len + data->metalen <= parent_base + parent_data->len + parent_data->metalen); - return scm_double_cell (scm_tc7_objcode | (SCM_F_OBJCODE_IS_SLICE<<8), + return scm_double_cell (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_SLICE, 0), (scm_t_bits)data, SCM_UNPACK (parent), 0); } #undef FUNC_NAME @@ -198,7 +198,7 @@ SCM_DEFINE (scm_bytecode_to_objcode, "bytecode->objcode", 1, 0, 0, /* foolishly, we assume that as long as bytecode is around, that c_bytecode will be of the same length; perhaps a bad assumption? */ - return scm_double_cell (scm_tc7_objcode | (SCM_F_OBJCODE_IS_BYTEVECTOR<<8), + return scm_double_cell (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_BYTEVECTOR, 0), (scm_t_bits)data, SCM_UNPACK (bytecode), 0); } #undef FUNC_NAME diff --git a/libguile/objcodes.h b/libguile/objcodes.h index 2bff9aae2..36f3ea902 100644 --- a/libguile/objcodes.h +++ b/libguile/objcodes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -35,10 +35,10 @@ struct scm_objcode #define SCM_C_OBJCODE_BASE(obj) \ ((scm_t_uint8 *)(obj) + sizeof (struct scm_objcode)) -#define SCM_F_OBJCODE_IS_MMAP (1<<0) -#define SCM_F_OBJCODE_IS_BYTEVECTOR (1<<1) -#define SCM_F_OBJCODE_IS_SLICE (1<<2) -#define SCM_F_OBJCODE_IS_STATIC (1<<3) +#define SCM_OBJCODE_TYPE_MMAP (0) +#define SCM_OBJCODE_TYPE_BYTEVECTOR (1) +#define SCM_OBJCODE_TYPE_SLICE (2) +#define SCM_OBJCODE_TYPE_STATIC (3) #define SCM_OBJCODE_P(x) (SCM_NIMP (x) && SCM_TYP7 (x) == scm_tc7_objcode) #define SCM_OBJCODE_DATA(x) ((struct scm_objcode *) SCM_CELL_WORD_1 (x)) @@ -49,10 +49,13 @@ struct scm_objcode #define SCM_OBJCODE_TOTAL_LEN(x) (SCM_OBJCODE_LEN (x) + SCM_OBJCODE_META_LEN (x)) #define SCM_OBJCODE_BASE(x) (SCM_C_OBJCODE_BASE (SCM_OBJCODE_DATA (x))) -#define SCM_OBJCODE_FLAGS(x) (SCM_CELL_WORD_0 (x) >> 8) -#define SCM_OBJCODE_IS_MMAP(x) (SCM_OBJCODE_FLAGS (x) & SCM_F_OBJCODE_IS_MMAP) -#define SCM_OBJCODE_IS_BYTEVECTOR(x) (SCM_OBJCODE_FLAGS (x) & SCM_F_OBJCODE_IS_BYTEVECTOR) -#define SCM_OBJCODE_IS_SLICE(x) (SCM_OBJCODE_FLAGS (x) & SCM_F_OBJCODE_IS_SLICE) +#define SCM_MAKE_OBJCODE_TAG(type, flags) (scm_tc7_objcode | (type << 8) | (flags << 16)) +#define SCM_OBJCODE_TYPE(x) ((SCM_CELL_WORD_0 (x) >> 8) & 0xff) +#define SCM_OBJCODE_FLAGS(x) (SCM_CELL_WORD_0 (x) >> 16) +#define SCM_OBJCODE_IS_MMAP(x) (SCM_OBJCODE_TYPE (x) == SCM_OBJCODE_TYPE_MMAP) +#define SCM_OBJCODE_IS_BYTEVECTOR(x) (SCM_OBJCODE_TYPE (x) == SCM_OBJCODE_TYPE_BYTEVECTOR) +#define SCM_OBJCODE_IS_SLICE(x) (SCM_OBJCODE_TYPE (x) == SCM_OBJCODE_TYPE_SLICE) +#define SCM_OBJCODE_IS_STATIC(x) (SCM_OBJCODE_TYPE (x) == SCM_OBJCODE_TYPE_STATIC) SCM scm_c_make_objcode_slice (SCM parent, const scm_t_uint8 *ptr); SCM_API SCM scm_load_objcode (SCM file); diff --git a/libguile/smob.c b/libguile/smob.c index 171db8d0c..adb34ba0b 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -255,7 +255,7 @@ static const struct #undef META #define STATIC_OBJCODE_TAG \ - SCM_PACK (scm_tc7_objcode | (SCM_F_OBJCODE_IS_STATIC << 8)) + SCM_PACK (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_STATIC, 0)) static const struct { |