* Replace SCM_UNPACK_CAR appropriately.
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Wed, 24 May 2000 11:22:38 +0000 (11:22 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Wed, 24 May 2000 11:22:38 +0000 (11:22 +0000)
libguile/ChangeLog
libguile/fports.c
libguile/ports.c
libguile/ports.h
libguile/procs.h
libguile/unif.h
libguile/variable.h

index 865b140..c25b4d8 100644 (file)
@@ -1,3 +1,12 @@
+2000-05-24  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * fports.c (fport_write), ports.c (scm_markstream, scm_port_mode,
+       scm_print_port_mode), ports.h (SCM_OPPORTP, SCM_OPINPORTP,
+       SCM_OPOUTPORTP, SCM_INPUT_PORT_P, SCM_OUTPUT_PORT_P, SCM_OPENP),
+       procs.h (SCM_CLOSCAR), unif.h (SCM_ARRAY_NDIM, SCM_ARRAY_CONTP),
+       variable.h (SCM_VARIABLEP):  Replace SCM_UNPACK_CAR
+       appropriately.
+
 2000-05-23  Dirk Herrmann  <D.Herrmann@tu-bs.de>
 
        * gc.c (free_list_length), hash.c (scm_hasher), macros.c
index 1ee2ce3..2294de9 100644 (file)
@@ -602,7 +602,7 @@ fport_write (SCM port, const void *data, size_t size)
        }
 
       /* handle line buffering.  */
-      if ((SCM_UNPACK_CAR (port) & SCM_BUFLINE) && memchr (data, '\n', size))
+      if ((SCM_CELL_WORD_0 (port) & SCM_BUFLINE) && memchr (data, '\n', size))
        fport_flush (port);
     }
 }
index 89a3bd3..ec640ec 100644 (file)
@@ -91,7 +91,7 @@ SCM
 scm_markstream (SCM ptr)
 {
   int openp;
-  openp = SCM_UNPACK_CAR (ptr) & SCM_OPN;
+  openp = SCM_CELL_WORD_0 (ptr) & SCM_OPN;
   if (openp)
     return SCM_PACK (SCM_STREAM (ptr));
   else
@@ -584,15 +584,15 @@ SCM_DEFINE (scm_port_mode, "port-mode", 1, 0, 0,
 
   port = SCM_COERCE_OUTPORT (port);
   SCM_VALIDATE_OPPORT (1,port);
-  if (SCM_UNPACK_CAR (port) & SCM_RDNG) {
-    if (SCM_UNPACK_CAR (port) & SCM_WRTNG)
+  if (SCM_CELL_WORD_0 (port) & SCM_RDNG) {
+    if (SCM_CELL_WORD_0 (port) & SCM_WRTNG)
       strcpy (modes, "r+");
     else
       strcpy (modes, "r");
   }
-  else if (SCM_UNPACK_CAR (port) & SCM_WRTNG)
+  else if (SCM_CELL_WORD_0 (port) & SCM_WRTNG)
     strcpy (modes, "w");
-  if (SCM_UNPACK_CAR (port) & SCM_BUF0)
+  if (SCM_CELL_WORD_0 (port) & SCM_BUF0)
     strcat (modes, "0");
   return scm_makfromstr (modes, strlen (modes), 0);
 }
@@ -1296,11 +1296,11 @@ scm_print_port_mode (SCM exp, SCM port)
 {
   scm_puts (SCM_CLOSEDP (exp)
            ? "closed: "
-           : (SCM_RDNG & SCM_UNPACK_CAR (exp)
-              ? (SCM_WRTNG & SCM_UNPACK_CAR (exp)
+           : (SCM_RDNG & SCM_CELL_WORD_0 (exp)
+              ? (SCM_WRTNG & SCM_CELL_WORD_0 (exp)
                  ? "input-output: "
                  : "input: ")
-              : (SCM_WRTNG & SCM_UNPACK_CAR (exp)
+              : (SCM_WRTNG & SCM_CELL_WORD_0 (exp)
                  ? "output: "
                  : "bogus: ")),
            port);
index 77bed60..b39c27f 100644 (file)
@@ -152,16 +152,16 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table.  */
 #define SCM_BUFLINE     (64L<<16) /* Is it line-buffered? */
 
 #define SCM_PORTP(x) (SCM_NIMP(x) && (SCM_TYP7(x)==scm_tc7_port))
-#define SCM_OPPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_OPN)))
-#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG)))
-#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG)))
+#define SCM_OPPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN)))
+#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG)))
+#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG)))
 #define SCM_INPUT_PORT_P(x) \
   (SCM_NIMP(x) \
-   && (((0x7f | SCM_RDNG) & SCM_UNPACK_CAR(x)) == (scm_tc7_port | SCM_RDNG)))
+   && (((0x7f | SCM_RDNG) & SCM_CELL_WORD_0(x)) == (scm_tc7_port | SCM_RDNG)))
 #define SCM_OUTPUT_PORT_P(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)))
+   && (((0x7f | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_WRTNG)))
+#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_CELL_WORD_0 (x)))
 #define SCM_CLOSEDP(x) (!SCM_OPENP(x))
 
 #define SCM_PTAB_ENTRY(x)         ((scm_port *) SCM_CELL_WORD_1 (x))
index ea266b7..0258664 100644 (file)
@@ -83,7 +83,7 @@ typedef struct
  */
 
 #define SCM_CLOSUREP(x) (SCM_NIMP(x) && (SCM_TYP3 (x) == scm_tc3_closure))
-#define SCM_CLOSCAR(x) SCM_PACK (SCM_UNPACK_CAR (x) - scm_tc3_closure)
+#define SCM_CLOSCAR(x) SCM_PACK (SCM_CELL_WORD_0 (x) - scm_tc3_closure)
 #define SCM_CODE(x) SCM_CAR (SCM_CLOSCAR (x))
 #define SCM_PROCPROPS(x) SCM_CDR (SCM_CLOSCAR (x))
 #define SCM_SETPROCPROPS(x, p) SCM_SETCDR (SCM_CLOSCAR (x), p)
index a26adc6..d67654a 100644 (file)
@@ -77,9 +77,9 @@ typedef struct scm_array_dim
 
 extern long scm_tc16_array;
 #define SCM_ARRAYP(a)          (SCM_NIMP(a) && (scm_tc16_array == SCM_TYP16(a)))
-#define SCM_ARRAY_NDIM(x)      ((scm_sizet)(SCM_UNPACK_CAR(x)>>17))
+#define SCM_ARRAY_NDIM(x)      ((scm_sizet) (SCM_CELL_WORD_0 (x) >> 17))
 #define SCM_ARRAY_CONTIGUOUS   0x10000
-#define SCM_ARRAY_CONTP(x)     (SCM_ARRAY_CONTIGUOUS & (int)(SCM_UNPACK_CAR(x)))
+#define SCM_ARRAY_CONTP(x)     (SCM_ARRAY_CONTIGUOUS & (SCM_CELL_WORD_0 (x)))
 
 #define SCM_ARRAY_V(a)           (((scm_array *) SCM_CELL_WORD_1 (a))->v)
 #define SCM_ARRAY_BASE(a) (((scm_array *) SCM_CELL_WORD_1 (a))->base)
index 8d4abc0..a8e9efc 100644 (file)
@@ -56,7 +56,7 @@
 extern int scm_tc16_variable;
 
 #define SCM_VARVCELL(V)        SCM_CDR(V)
-#define SCM_VARIABLEP(X)       (SCM_NIMP(X) && (scm_tc16_variable == SCM_UNPACK_CAR(X)))
+#define SCM_VARIABLEP(X)       (!SCM_IMP (X) && SCM_CELL_TYPE (X) == scm_tc16_variable)
 #define SCM_UDVARIABLEP(X)     (SCM_VARIABLEP(X) && SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (X))))
 #define SCM_DEFVARIABLEP(X)    (SCM_VARIABLEP(X) && !SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (X))))