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

Fix some typing issues wrt SCM/scm_bits_t.

This commit is contained in:
Dirk Herrmann 2000-03-30 09:15:15 +00:00
parent fbd485ba49
commit 843524cc20
5 changed files with 37 additions and 17 deletions

View file

@ -1,3 +1,21 @@
2000-03-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
* arbiters.c (scm_make_arbiter), async.c (scm_async), dynwind.c
(scm_internal_dynamic_wind): Smob data is always of type
scm_bits_t.
* arbiters.c (SCM_ARB_LOCKED, SCM_LOCK_ARB, SCM_UNLOCK_ARB):
Access the locking information in cell entry 0 with
SCM_{SET_}?CELL_WORD_0 instead of SCM_*CAR.
* async.c (scm_run_asyncs): Use SCM_NULLP to test for the empty
list.
* dynwind.c (scm_dowinds): Use SCM_EQ_P to compare SCM values.
* ports.h (SCM_PTAB_ENTRY, SCM_SETPTAB_ENTRY): Access the ptab
entry data using SCM_{SET_}?CELL_WORD_1 instead of SCM_{SET}?CDR.
2000-03-29 Dirk Herrmann <D.Herrmann@tu-bs.de> 2000-03-29 Dirk Herrmann <D.Herrmann@tu-bs.de>
* alist.c (scm_sloppy_assq, scm_assq), eq.c (scm_eq_p, scm_eqv_p, * alist.c (scm_sloppy_assq, scm_assq), eq.c (scm_eq_p, scm_eqv_p,

View file

@ -63,9 +63,9 @@
static long scm_tc16_arbiter; static long scm_tc16_arbiter;
#define SCM_ARB_LOCKED(arb) ((SCM_UNPACK_CAR (arb)) & (1L << 16)) #define SCM_ARB_LOCKED(arb) ((SCM_CELL_WORD_0 (arb)) & (1L << 16))
#define SCM_LOCK_ARB(arb) SCM_SETCAR (arb, (SCM) (scm_tc16_arbiter | (1L << 16))); #define SCM_LOCK_ARB(arb) (SCM_SET_CELL_WORD_0 ((arb), scm_tc16_arbiter | (1L << 16)));
#define SCM_UNLOCK_ARB(arb) SCM_SETCAR (arb, (SCM) scm_tc16_arbiter); #define SCM_UNLOCK_ARB(arb) (SCM_SET_CELL_WORD_0 ((arb), scm_tc16_arbiter));
static int static int
prinarb (SCM exp, SCM port, scm_print_state *pstate) prinarb (SCM exp, SCM port, scm_print_state *pstate)
@ -84,7 +84,7 @@ SCM_DEFINE (scm_make_arbiter, "make-arbiter", 1, 0, 0,
"Arbiters are a way to achieve process synchronization.") "Arbiters are a way to achieve process synchronization.")
#define FUNC_NAME s_scm_make_arbiter #define FUNC_NAME s_scm_make_arbiter
{ {
SCM_RETURN_NEWSMOB (scm_tc16_arbiter, name); SCM_RETURN_NEWSMOB (scm_tc16_arbiter, SCM_UNPACK (name));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -298,7 +298,7 @@ SCM_DEFINE (scm_async, "async", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_async #define FUNC_NAME s_scm_async
{ {
SCM_RETURN_NEWSMOB2 (scm_tc16_async, 0, thunk); SCM_RETURN_NEWSMOB2 (scm_tc16_async, 0, SCM_UNPACK (thunk));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -368,7 +368,7 @@ SCM_DEFINE (scm_run_asyncs, "run-asyncs", 1, 0, 0,
#else #else
scm_asyncs_pending_p = 0; scm_asyncs_pending_p = 0;
#endif #endif
while (list_of_a != SCM_EOL) while (! SCM_NULLP (list_of_a))
{ {
SCM a; SCM a;
struct scm_async * it; struct scm_async * it;

View file

@ -160,7 +160,8 @@ scm_internal_dynamic_wind (scm_guard_t before,
{ {
SCM guards, ans; SCM guards, ans;
before (guard_data); before (guard_data);
SCM_NEWSMOB3 (guards, tc16_guards, before, after, guard_data); SCM_NEWSMOB3 (guards, tc16_guards, (scm_bits_t) before,
(scm_bits_t) after, (scm_bits_t) guard_data);
scm_dynwinds = scm_acons (guards, SCM_BOOL_F, scm_dynwinds); scm_dynwinds = scm_acons (guards, SCM_BOOL_F, scm_dynwinds);
ans = inner (inner_data); ans = inner (inner_data);
scm_dynwinds = SCM_CDR (scm_dynwinds); scm_dynwinds = SCM_CDR (scm_dynwinds);
@ -198,7 +199,7 @@ void
scm_dowinds (SCM to, long delta) scm_dowinds (SCM to, long delta)
{ {
tail: tail:
if (scm_dynwinds == to); if (SCM_EQ_P (to, scm_dynwinds));
else if (0 > delta) else if (0 > delta)
{ {
SCM wind_elt; SCM wind_elt;

View file

@ -161,15 +161,16 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table. */
#define SCM_OUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_WRTNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_WRTNG))) #define SCM_OUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_WRTNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_WRTNG)))
#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_UNPACK_CAR (x))) #define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_UNPACK_CAR (x)))
#define SCM_CLOSEDP(x) (!SCM_OPENP(x)) #define SCM_CLOSEDP(x) (!SCM_OPENP(x))
#define SCM_PTAB_ENTRY(x) ((scm_port *) SCM_CDR(x))
#define SCM_SETPTAB_ENTRY(x,ent) SCM_SETCDR ((x), (SCM)(ent)) #define SCM_PTAB_ENTRY(x) ((scm_port *) SCM_CELL_WORD_1 (x))
#define SCM_STREAM(x) SCM_PTAB_ENTRY(x)->stream #define SCM_SETPTAB_ENTRY(x,ent) (SCM_SET_CELL_WORD_1 ((x), (ent)))
#define SCM_SETSTREAM(x,s) (SCM_PTAB_ENTRY(x)->stream = (SCM) s) #define SCM_STREAM(x) (SCM_PTAB_ENTRY(x)->stream)
#define SCM_FILENAME(x) SCM_PTAB_ENTRY(x)->file_name #define SCM_SETSTREAM(x,s) (SCM_PTAB_ENTRY(x)->stream = (SCM) (s))
#define SCM_LINUM(x) SCM_PTAB_ENTRY(x)->line_number #define SCM_FILENAME(x) (SCM_PTAB_ENTRY(x)->file_name)
#define SCM_COL(x) SCM_PTAB_ENTRY(x)->column_number #define SCM_LINUM(x) (SCM_PTAB_ENTRY(x)->line_number)
#define SCM_REVEALED(x) SCM_PTAB_ENTRY(x)->revealed #define SCM_COL(x) (SCM_PTAB_ENTRY(x)->column_number)
#define SCM_SETREVEALED(x,s) (SCM_PTAB_ENTRY(x)->revealed = s) #define SCM_REVEALED(x) (SCM_PTAB_ENTRY(x)->revealed)
#define SCM_SETREVEALED(x,s) (SCM_PTAB_ENTRY(x)->revealed = (s))
#define SCM_INCLINE(port) {SCM_LINUM (port) += 1; SCM_COL (port) = 0;} #define SCM_INCLINE(port) {SCM_LINUM (port) += 1; SCM_COL (port) = 0;}
#define SCM_INCCOL(port) {SCM_COL (port) += 1;} #define SCM_INCCOL(port) {SCM_COL (port) += 1;}