X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/df8bb2dc3988d24c0f64bd2cc5fa01a31825d11a..c209c88e54d08a557a297836200e16e20355df02:/libguile/ports.h diff --git a/libguile/ports.h b/libguile/ports.h index 32ccf80c1..615d472b9 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -154,12 +154,12 @@ 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_CAR(x))==(scm_tc7_port | SCM_OPN))) -#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG))) -#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG))) -#define SCM_INPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_RDNG) & SCM_CAR(x))==(scm_tc7_port | SCM_RDNG))) -#define SCM_OUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_WRTNG) & SCM_CAR(x))==(scm_tc7_port | SCM_WRTNG))) -#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_CAR(x))) +#define SCM_OPPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN) & SCM_CARW(x))==(scm_tc7_port | SCM_OPN))) +#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_CARW(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG))) +#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_CARW(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG))) +#define SCM_INPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_RDNG) & SCM_CARW(x))==(scm_tc7_port | SCM_RDNG))) +#define SCM_OUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_WRTNG) & SCM_CARW(x))==(scm_tc7_port | SCM_WRTNG))) +#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_CARW (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)) @@ -199,7 +199,7 @@ typedef struct scm_ptob_descriptor } scm_ptob_descriptor; -#define SCM_TC2PTOBNUM(x) (0x0ff & ((x) >> 8)) +#define SCM_TC2PTOBNUM(x) (0x0ff & (SCM_ASWORD(x) >> 8)) #define SCM_PTOBNUM(x) (SCM_TC2PTOBNUM (SCM_CAR (x))) /* SCM_PTOBNAME can be 0 if name is missing */ #define SCM_PTOBNAME(ptobnum) scm_ptobs[ptobnum].name