mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. * boolean.h (scm_is_bool): Fix bug in prototype. (scm_from_bool): The argument is "x" not "f", stupid.
This commit is contained in:
parent
0954f871cd
commit
ede310d888
2 changed files with 24 additions and 18 deletions
|
@ -29,29 +29,13 @@
|
||||||
/* Boolean Values
|
/* Boolean Values
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define SCM_FALSEP(x) (SCM_EQ_P ((x), SCM_BOOL_F))
|
|
||||||
#define SCM_NFALSEP(x) (!SCM_FALSEP (x))
|
|
||||||
|
|
||||||
#define SCM_BOOLP(x) (SCM_EQ_P ((x), SCM_BOOL_F) || SCM_EQ_P ((x), SCM_BOOL_T))
|
|
||||||
|
|
||||||
/* Convert from a C boolean to a SCM boolean value */
|
|
||||||
#define SCM_BOOL(f) ((f) ? SCM_BOOL_T : SCM_BOOL_F)
|
|
||||||
|
|
||||||
/* Convert from a C boolean to a SCM boolean value and negate it */
|
|
||||||
#define SCM_NEGATE_BOOL(f) ((f) ? SCM_BOOL_F : SCM_BOOL_T)
|
|
||||||
|
|
||||||
/* SCM_BOOL_NOT returns the other boolean.
|
|
||||||
* The order of ^s here is important for Borland C++ (!?!?!)
|
|
||||||
*/
|
|
||||||
#define SCM_BOOL_NOT(x) (SCM_PACK (SCM_UNPACK (x) \
|
|
||||||
^ (SCM_UNPACK (SCM_BOOL_T) \
|
|
||||||
^ SCM_UNPACK (SCM_BOOL_F))))
|
|
||||||
|
|
||||||
#define scm_is_false(x) scm_is_eq ((x), SCM_BOOL_F)
|
#define scm_is_false(x) scm_is_eq ((x), SCM_BOOL_F)
|
||||||
#define scm_is_true(x) !scm_is_false (x)
|
#define scm_is_true(x) !scm_is_false (x)
|
||||||
|
|
||||||
SCM_API int scm_is_bool(x);
|
SCM_API int scm_is_bool (SCM x);
|
||||||
#define scm_from_bool(x) ((f) ? SCM_BOOL_T : SCM_BOOL_F)
|
#define scm_from_bool(x) ((x) ? SCM_BOOL_T : SCM_BOOL_F)
|
||||||
SCM_API int scm_to_bool (SCM x);
|
SCM_API int scm_to_bool (SCM x);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -305,6 +305,28 @@ SCM_API SCM scm_gentemp (SCM prefix, SCM obarray);
|
||||||
|
|
||||||
#define SCM_CELL_WORD_LOC(x, n) ((scm_t_bits*)SCM_CELL_OBJECT_LOC((x),(n)))
|
#define SCM_CELL_WORD_LOC(x, n) ((scm_t_bits*)SCM_CELL_OBJECT_LOC((x),(n)))
|
||||||
|
|
||||||
|
#define SCM_FALSEP(x) (SCM_EQ_P ((x), SCM_BOOL_F))
|
||||||
|
#define SCM_NFALSEP(x) (!SCM_FALSEP (x))
|
||||||
|
|
||||||
|
#define SCM_BOOLP(x) (SCM_EQ_P ((x), SCM_BOOL_F) || SCM_EQ_P ((x), SCM_BOOL_T))
|
||||||
|
|
||||||
|
/* Convert from a C boolean to a SCM boolean value */
|
||||||
|
#define SCM_BOOL(f) ((f) ? SCM_BOOL_T : SCM_BOOL_F)
|
||||||
|
|
||||||
|
/* Convert from a C boolean to a SCM boolean value and negate it */
|
||||||
|
#define SCM_NEGATE_BOOL(f) ((f) ? SCM_BOOL_F : SCM_BOOL_T)
|
||||||
|
|
||||||
|
/* SCM_BOOL_NOT returns the other boolean.
|
||||||
|
* The order of ^s here is important for Borland C++ (!?!?!)
|
||||||
|
*/
|
||||||
|
#define SCM_BOOL_NOT(x) (SCM_PACK (SCM_UNPACK (x) \
|
||||||
|
^ (SCM_UNPACK (SCM_BOOL_T) \
|
||||||
|
^ SCM_UNPACK (SCM_BOOL_F))))
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
SCM_API SCM SCM_MAKINUM (scm_t_signed_bits val);
|
||||||
|
#endif
|
||||||
|
|
||||||
void scm_i_init_deprecated (void);
|
void scm_i_init_deprecated (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue