mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
* tags.h (SCM_VOIDP_TEST): Renamed from VOIDP_TEST.
Layout cleanups.
This commit is contained in:
parent
a54367e2da
commit
d266d03a0b
1 changed files with 21 additions and 21 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
#ifndef TAGSH
|
||||
#define TAGSH
|
||||
/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995-2000 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -62,19 +62,19 @@ typedef long SCMWORD;
|
|||
But as external interface, we use void*, which will be checked more strictly for
|
||||
dubious conversions.
|
||||
*/
|
||||
#define VOIDP_TEST
|
||||
#ifndef VOIDP_TEST
|
||||
#define SCM_VOIDP_TEST
|
||||
#ifndef SCM_VOIDP_TEST
|
||||
typedef SCMWORD SCM;
|
||||
#define SCM_ASWORD(x) (x)
|
||||
#define SCM_ASSCM(x) (x)
|
||||
#else
|
||||
typedef void * SCM;
|
||||
#define SCM_ASWORD(x) ((SCMWORD)(x))
|
||||
#define SCM_ASSCM(x) ((SCM)(x))
|
||||
#define SCM_ASWORD(x) ((SCMWORD) (x))
|
||||
#define SCM_ASSCM(x) ((SCM) (x))
|
||||
#endif
|
||||
|
||||
/* SCM_CARW is a convenience for treating the CAR of X as a word */
|
||||
#define SCM_CARW(x) SCM_ASWORD (SCM_CAR(x))
|
||||
#define SCM_CARW(x) SCM_ASWORD (SCM_CAR (x))
|
||||
|
||||
|
||||
/* Cray machines have pointers that are incremented once for each word,
|
||||
|
@ -123,7 +123,7 @@ typedef void * SCM;
|
|||
* (Not always impossible but it is fair to say that many details of tags
|
||||
* are mutually dependent). */
|
||||
|
||||
#define SCM_IMP(x) (6 & SCM_ASWORD(x))
|
||||
#define SCM_IMP(x) (6 & SCM_ASWORD (x))
|
||||
#define SCM_NIMP(x) (!SCM_IMP (x))
|
||||
|
||||
/* Here is a summary of tagging in SCM values as they might occur in
|
||||
|
@ -282,10 +282,10 @@ typedef void * SCM;
|
|||
*/
|
||||
|
||||
#define SCM_SLOPPY_NCONSP(x) (1 & SCM_CARW (x))
|
||||
#define SCM_SLOPPY_CONSP(x) (!SCM_SLOPPY_NCONSP(x))
|
||||
#define SCM_SLOPPY_CONSP(x) (!SCM_SLOPPY_NCONSP (x))
|
||||
|
||||
#define SCM_NCONSP(x) (SCM_IMP (x) || SCM_SLOPPY_NCONSP(x))
|
||||
#define SCM_CONSP(x) (SCM_NIMP (x) && SCM_SLOPPY_CONSP(x))
|
||||
#define SCM_NCONSP(x) (SCM_IMP (x) || SCM_SLOPPY_NCONSP (x))
|
||||
#define SCM_CONSP(x) (SCM_NIMP (x) && SCM_SLOPPY_CONSP (x))
|
||||
|
||||
|
||||
/* SCM_ECONSP should be used instead of SCM_CONSP at places where GLOCS
|
||||
|
@ -303,12 +303,12 @@ typedef void * SCM;
|
|||
|
||||
|
||||
#define SCM_CELLP(x) (!SCM_NCELLP (x))
|
||||
#define SCM_NCELLP(x) ((sizeof (scm_cell) - 1) & (SCMWORD) SCM_ASWORD(x))
|
||||
#define SCM_NCELLP(x) ((sizeof (scm_cell) - 1) & (SCMWORD) SCM_ASWORD (x))
|
||||
|
||||
/* See numbers.h for macros relating to immediate integers.
|
||||
*/
|
||||
|
||||
#define SCM_ITAG3(x) (7 & SCM_ASWORD(x))
|
||||
#define SCM_ITAG3(x) (7 & SCM_ASWORD (x))
|
||||
#define SCM_TYP3(x) (7 & SCM_CARW (x))
|
||||
#define scm_tc3_cons 0
|
||||
#define scm_tc3_cons_gloc 1
|
||||
|
@ -454,9 +454,9 @@ enum scm_tags
|
|||
scm_tc8_iloc = 0xfc
|
||||
};
|
||||
|
||||
#define SCM_ITAG8(X) (SCM_ASWORD(X) & 0xff)
|
||||
#define SCM_MAKE_ITAG8(X, TAG) SCM_ASSCM(((X) << 8) + TAG)
|
||||
#define SCM_ITAG8_DATA(X) (SCM_ASWORD(X) >> 8)
|
||||
#define SCM_ITAG8(X) (SCM_ASWORD (X) & 0xff)
|
||||
#define SCM_MAKE_ITAG8(X, TAG) SCM_ASSCM (((X) << 8) + TAG)
|
||||
#define SCM_ITAG8_DATA(X) (SCM_ASWORD (X) >> 8)
|
||||
|
||||
|
||||
|
||||
|
@ -464,15 +464,15 @@ enum scm_tags
|
|||
*/
|
||||
|
||||
/* SCM_ISYMP tests for ISPCSYM and ISYM */
|
||||
#define SCM_ISYMP(n) ((0x187 & SCM_ASWORD(n)) == 4)
|
||||
#define SCM_ISYMP(n) ((0x187 & SCM_ASWORD (n)) == 4)
|
||||
|
||||
/* SCM_IFLAGP tests for ISPCSYM, ISYM and IFLAG */
|
||||
#define SCM_IFLAGP(n) ((0x87 & SCM_ASWORD(n)) == 4)
|
||||
#define SCM_ISYMNUM(n) (SCM_ASWORD(n) >> 9)
|
||||
#define SCM_IFLAGP(n) ((0x87 & SCM_ASWORD (n)) == 4)
|
||||
#define SCM_ISYMNUM(n) (SCM_ASWORD (n) >> 9)
|
||||
#define SCM_ISYMCHARS(n) (scm_isymnames[SCM_ISYMNUM (n)])
|
||||
#define SCM_MAKSPCSYM(n) SCM_ASSCM(((n) << 9) + ((n) << 3) + 4L)
|
||||
#define SCM_MAKISYM(n) SCM_ASSCM(((n) << 9) + 0x74L)
|
||||
#define SCM_MAKIFLAG(n) SCM_ASSCM(((n) << 9) + 0x174L)
|
||||
#define SCM_MAKSPCSYM(n) SCM_ASSCM (((n) << 9) + ((n) << 3) + 4L)
|
||||
#define SCM_MAKISYM(n) SCM_ASSCM (((n) << 9) + 0x74L)
|
||||
#define SCM_MAKIFLAG(n) SCM_ASSCM (((n) << 9) + 0x174L)
|
||||
|
||||
extern char *scm_isymnames[]; /* defined in print.c */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue