1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

SCM_CELL in throw.c

* libguile/throw.c (JBACTIVE, ACTIVATEJB, DEACTIVATEJB, JBJMPBUF)
  (SETJBJMPBUF, SCM_JBPREUNWIND, SCM_SETJBPREUNWIND)
  (pre_unwind_data_print, scm_ithrow): Fix SCM_CELL macro usage.
This commit is contained in:
Andy Wingo 2009-12-08 21:59:01 +01:00
parent 0e163c06f2
commit 0b1733c7d1

View file

@ -54,16 +54,14 @@ static scm_t_bits tc16_jmpbuffer;
#define SCM_JMPBUFP(OBJ) SCM_TYP16_PREDICATE (tc16_jmpbuffer, OBJ) #define SCM_JMPBUFP(OBJ) SCM_TYP16_PREDICATE (tc16_jmpbuffer, OBJ)
#define JBACTIVE(OBJ) (SCM_CELL_WORD_0 (OBJ) & (1L << 16L)) #define JBACTIVE(OBJ) (SCM_SMOB_FLAGS (OBJ) & 1L)
#define ACTIVATEJB(x) \ #define ACTIVATEJB(x) (SCM_SET_SMOB_FLAGS ((x), 1L))
(SCM_SET_CELL_WORD_0 ((x), (SCM_CELL_WORD_0 (x) | (1L << 16L)))) #define DEACTIVATEJB(x) (SCM_SET_SMOB_FLAGS ((x), 0L))
#define DEACTIVATEJB(x) \
(SCM_SET_CELL_WORD_0 ((x), (SCM_CELL_WORD_0 (x) & ~(1L << 16L))))
#define JBJMPBUF(OBJ) ((scm_i_jmp_buf *) SCM_CELL_WORD_1 (OBJ)) #define JBJMPBUF(OBJ) ((scm_i_jmp_buf *) SCM_SMOB_DATA_1 (OBJ))
#define SETJBJMPBUF(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_t_bits) (v))) #define SETJBJMPBUF(x, v) (SCM_SET_SMOB_DATA_1 ((x), (scm_t_bits) (v)))
#define SCM_JBPREUNWIND(x) ((struct pre_unwind_data *) SCM_CELL_WORD_3 (x)) #define SCM_JBPREUNWIND(x) ((struct pre_unwind_data *) SCM_SMOB_DATA_3 (x))
#define SCM_SETJBPREUNWIND(x, v) (SCM_SET_CELL_WORD_3 ((x), (scm_t_bits) (v))) #define SCM_SETJBPREUNWIND(x, v) (SCM_SET_SMOB_DATA_3 ((x), (scm_t_bits) (v)))
static int static int
jmpbuffer_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) jmpbuffer_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
@ -269,7 +267,7 @@ static scm_t_bits tc16_pre_unwind_data;
static int static int
pre_unwind_data_print (SCM closure, SCM port, scm_print_state *pstate SCM_UNUSED) pre_unwind_data_print (SCM closure, SCM port, scm_print_state *pstate SCM_UNUSED)
{ {
struct pre_unwind_data *c = (struct pre_unwind_data *) SCM_CELL_WORD_1 (closure); struct pre_unwind_data *c = (struct pre_unwind_data *) SCM_SMOB_DATA_1 (closure);
char buf[200]; char buf[200];
sprintf (buf, "#<pre-unwind-data 0x%lx 0x%lx>", sprintf (buf, "#<pre-unwind-data 0x%lx 0x%lx>",
@ -783,7 +781,7 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED)
else else
{ {
struct pre_unwind_data *c = struct pre_unwind_data *c =
(struct pre_unwind_data *) SCM_CELL_WORD_1 (jmpbuf); (struct pre_unwind_data *) SCM_SMOB_DATA_1 (jmpbuf);
if (!c->running) if (!c->running)
break; break;
} }
@ -816,7 +814,7 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED)
if (SCM_PRE_UNWIND_DATA_P (jmpbuf)) if (SCM_PRE_UNWIND_DATA_P (jmpbuf))
{ {
struct pre_unwind_data *c = struct pre_unwind_data *c =
(struct pre_unwind_data *) SCM_CELL_WORD_1 (jmpbuf); (struct pre_unwind_data *) SCM_SMOB_DATA_1 (jmpbuf);
SCM handle, answer; SCM handle, answer;
/* For old-style lazy-catch behaviour, we unwind the dynamic /* For old-style lazy-catch behaviour, we unwind the dynamic