summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-03-30 09:15:15 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-03-30 09:15:15 +0000
commit843524cc2079e6fb23554eac366a87faf0d720f3 (patch)
tree4e2ee7e4d6aa66a0a1bfae6386b8b0f60c13e9bf
parentfbd485ba49663beaf82cf4564d4e9b5d900c4c26 (diff)
downloadguile-843524cc2079e6fb23554eac366a87faf0d720f3.tar.gz
Fix some typing issues wrt SCM/scm_bits_t.
-rw-r--r--libguile/ChangeLog18
-rw-r--r--libguile/arbiters.c8
-rw-r--r--libguile/async.c4
-rw-r--r--libguile/dynwind.c5
-rw-r--r--libguile/ports.h19
5 files changed, 37 insertions, 17 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index fa5b6b56c..cde9e842c 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -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>
* alist.c (scm_sloppy_assq, scm_assq), eq.c (scm_eq_p, scm_eqv_p,
diff --git a/libguile/arbiters.c b/libguile/arbiters.c
index efab09848..85afed64d 100644
--- a/libguile/arbiters.c
+++ b/libguile/arbiters.c
@@ -63,9 +63,9 @@
static long scm_tc16_arbiter;
-#define SCM_ARB_LOCKED(arb) ((SCM_UNPACK_CAR (arb)) & (1L << 16))
-#define SCM_LOCK_ARB(arb) SCM_SETCAR (arb, (SCM) (scm_tc16_arbiter | (1L << 16)));
-#define SCM_UNLOCK_ARB(arb) SCM_SETCAR (arb, (SCM) scm_tc16_arbiter);
+#define SCM_ARB_LOCKED(arb) ((SCM_CELL_WORD_0 (arb)) & (1L << 16))
+#define SCM_LOCK_ARB(arb) (SCM_SET_CELL_WORD_0 ((arb), scm_tc16_arbiter | (1L << 16)));
+#define SCM_UNLOCK_ARB(arb) (SCM_SET_CELL_WORD_0 ((arb), scm_tc16_arbiter));
static int
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.")
#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
diff --git a/libguile/async.c b/libguile/async.c
index 571b61c4f..09cf9c73a 100644
--- a/libguile/async.c
+++ b/libguile/async.c
@@ -298,7 +298,7 @@ SCM_DEFINE (scm_async, "async", 1, 0, 0,
"")
#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
@@ -368,7 +368,7 @@ SCM_DEFINE (scm_run_asyncs, "run-asyncs", 1, 0, 0,
#else
scm_asyncs_pending_p = 0;
#endif
- while (list_of_a != SCM_EOL)
+ while (! SCM_NULLP (list_of_a))
{
SCM a;
struct scm_async * it;
diff --git a/libguile/dynwind.c b/libguile/dynwind.c
index 3108f17c6..e2f3aa351 100644
--- a/libguile/dynwind.c
+++ b/libguile/dynwind.c
@@ -160,7 +160,8 @@ scm_internal_dynamic_wind (scm_guard_t before,
{
SCM guards, ans;
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);
ans = inner (inner_data);
scm_dynwinds = SCM_CDR (scm_dynwinds);
@@ -198,7 +199,7 @@ void
scm_dowinds (SCM to, long delta)
{
tail:
- if (scm_dynwinds == to);
+ if (SCM_EQ_P (to, scm_dynwinds));
else if (0 > delta)
{
SCM wind_elt;
diff --git a/libguile/ports.h b/libguile/ports.h
index cb3426323..f8c56fa32 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -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_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_UNPACK_CAR (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_STREAM(x) SCM_PTAB_ENTRY(x)->stream
-#define SCM_SETSTREAM(x,s) (SCM_PTAB_ENTRY(x)->stream = (SCM) s)
-#define SCM_FILENAME(x) SCM_PTAB_ENTRY(x)->file_name
-#define SCM_LINUM(x) SCM_PTAB_ENTRY(x)->line_number
-#define SCM_COL(x) SCM_PTAB_ENTRY(x)->column_number
-#define SCM_REVEALED(x) SCM_PTAB_ENTRY(x)->revealed
-#define SCM_SETREVEALED(x,s) (SCM_PTAB_ENTRY(x)->revealed = s)
+
+#define SCM_PTAB_ENTRY(x) ((scm_port *) SCM_CELL_WORD_1 (x))
+#define SCM_SETPTAB_ENTRY(x,ent) (SCM_SET_CELL_WORD_1 ((x), (ent)))
+#define SCM_STREAM(x) (SCM_PTAB_ENTRY(x)->stream)
+#define SCM_SETSTREAM(x,s) (SCM_PTAB_ENTRY(x)->stream = (SCM) (s))
+#define SCM_FILENAME(x) (SCM_PTAB_ENTRY(x)->file_name)
+#define SCM_LINUM(x) (SCM_PTAB_ENTRY(x)->line_number)
+#define SCM_COL(x) (SCM_PTAB_ENTRY(x)->column_number)
+#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_INCCOL(port) {SCM_COL (port) += 1;}