1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00

* objects.h (SCM_CLASS_FLAGS, SCM_OBJ_CLASS_FLAGS,

SCM_SET_CLASS_INSTANCE_SIZE), struct.h (SCM_STRUCT_VTABLE_DATA),
proc.h (SCM_CLOSCAR): SCM_ASSCM/WORD fixes.
This commit is contained in:
Mikael Djurfeldt 2000-03-11 15:10:16 +00:00
parent 9374451b7e
commit a54367e2da
3 changed files with 17 additions and 13 deletions

View file

@ -3,7 +3,7 @@
#ifndef OBJECTSH #ifndef OBJECTSH
#define OBJECTSH #define OBJECTSH
/* Copyright (C) 1996, 1999 Free Software Foundation, Inc. /* Copyright (C) 1996, 1999, 2000 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -67,9 +67,10 @@
* certain class or its subclasses when traversal of the inheritance * certain class or its subclasses when traversal of the inheritance
* graph would be too costly. * graph would be too costly.
*/ */
#define SCM_CLASS_FLAGS(class) SCM_ASWORD(SCM_STRUCT_DATA (class)[scm_struct_i_flags]) #define SCM_CLASS_FLAGS(class)\
SCM_ASWORD (SCM_STRUCT_DATA (class)[scm_struct_i_flags])
#define SCM_OBJ_CLASS_FLAGS(obj)\ #define SCM_OBJ_CLASS_FLAGS(obj)\
SCM_ASWORD(SCM_STRUCT_VTABLE_DATA (obj)[scm_struct_i_flags]) SCM_ASWORD (SCM_STRUCT_VTABLE_DATA (obj)[scm_struct_i_flags])
#define SCM_SET_CLASS_FLAGS(c, f) (SCM_CLASS_FLAGS (c) |= (f)) #define SCM_SET_CLASS_FLAGS(c, f) (SCM_CLASS_FLAGS (c) |= (f))
#define SCM_CLEAR_CLASS_FLAGS(c, f) (SCM_CLASS_FLAGS (c) &= ~(f)) #define SCM_CLEAR_CLASS_FLAGS(c, f) (SCM_CLASS_FLAGS (c) &= ~(f))
#define SCM_CLASSF_MASK SCM_STRUCTF_MASK #define SCM_CLASSF_MASK SCM_STRUCTF_MASK
@ -97,7 +98,9 @@
#define SCM_SET_CLASS_DESTRUCTOR(c, d) SCM_SET_VTABLE_DESTRUCTOR (c, d) #define SCM_SET_CLASS_DESTRUCTOR(c, d) SCM_SET_VTABLE_DESTRUCTOR (c, d)
#define SCM_SET_CLASS_INSTANCE_SIZE(c, s) \ #define SCM_SET_CLASS_INSTANCE_SIZE(c, s) \
(SCM_STRUCT_DATA (c)[scm_struct_i_size] \ (SCM_STRUCT_DATA (c)[scm_struct_i_size] \
= (SCM_STRUCT_DATA (c)[scm_struct_i_size] & SCM_STRUCTF_MASK) | s) = SCM_ASSCM ((SCM_ASWORD (SCM_STRUCT_DATA (c)[scm_struct_i_size])\
& SCM_STRUCTF_MASK)\
| s))
/* {Operator classes} /* {Operator classes}
* *

View file

@ -2,7 +2,7 @@
#ifndef PROCSH #ifndef PROCSH
#define PROCSH #define PROCSH
/* Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc. /* Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -100,12 +100,13 @@ typedef struct
/* Closures /* Closures
*/ */
#define SCM_CLOSUREP(x) (SCM_NIMP(x) && (SCM_TYP3(x)==scm_tc3_closure)) #define SCM_CLOSUREP(x) (SCM_NIMP(x) && (SCM_TYP3 (x) == scm_tc3_closure))
#define SCM_CLOSCAR(x) (SCM_CAR(x)-scm_tc3_closure) #define SCM_CLOSCAR(x) SCM_ASSCM (SCM_CARW (x) - scm_tc3_closure)
#define SCM_CODE(x) SCM_CAR(SCM_CLOSCAR (x)) #define SCM_CODE(x) SCM_CAR (SCM_CLOSCAR (x))
#define SCM_PROCPROPS(x) SCM_CDR(SCM_CLOSCAR (x)) #define SCM_PROCPROPS(x) SCM_CDR (SCM_CLOSCAR (x))
#define SCM_SETPROCPROPS(x, p) SCM_SETCDR(SCM_CLOSCAR (x), p) #define SCM_SETPROCPROPS(x, p) SCM_SETCDR (SCM_CLOSCAR (x), p)
#define SCM_SETCODE(x, e) (SCM_SETCAR (x, scm_cons ((e), SCM_EOL) + scm_tc3_closure)) #define SCM_SETCODE(x, e) (SCM_SETCAR (x, scm_cons ((e), SCM_EOL)\
+ scm_tc3_closure))
#define SCM_ENV(x) SCM_CDR(x) #define SCM_ENV(x) SCM_CDR(x)
#define SCM_SETENV(x, e) SCM_SETCDR (x, e) #define SCM_SETENV(x, e) SCM_SETCDR (x, e)
#define SCM_TOP_LEVEL(SCM_ENV) (SCM_NULLP(SCM_ENV) || (SCM_BOOL_T == scm_procedure_p (SCM_CAR (SCM_ENV)))) #define SCM_TOP_LEVEL(SCM_ENV) (SCM_NULLP(SCM_ENV) || (SCM_BOOL_T == scm_procedure_p (SCM_CAR (SCM_ENV))))

View file

@ -2,7 +2,7 @@
#ifndef STRUCTH #ifndef STRUCTH
#define STRUCTH #define STRUCTH
/* Copyright (C) 1995, 1997, 1999 Free Software Foundation, Inc. /* Copyright (C) 1995, 1997, 1999, 2000 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -79,7 +79,7 @@ typedef scm_sizet (*scm_struct_free_t) (SCM *vtable, SCM *data);
#define SCM_STRUCTP(X) (SCM_NIMP(X) && (SCM_TYP3(X) == scm_tc3_cons_gloc)) #define SCM_STRUCTP(X) (SCM_NIMP(X) && (SCM_TYP3(X) == scm_tc3_cons_gloc))
#define SCM_STRUCT_DATA(X) ((SCM*)(SCM_CDR(X))) #define SCM_STRUCT_DATA(X) ((SCM*)(SCM_CDR(X)))
#define SCM_STRUCT_VTABLE_DATA(X) ((SCM *)(SCM_CAR(X) - 1)) #define SCM_STRUCT_VTABLE_DATA(X) ((SCM *)(SCM_ASWORD (SCM_CAR(X)) - 1))
#define SCM_STRUCT_LAYOUT(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_layout]) #define SCM_STRUCT_LAYOUT(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_layout])
#define SCM_STRUCT_VTABLE(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_vtable]) #define SCM_STRUCT_VTABLE(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_vtable])
#define SCM_STRUCT_PRINTER(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_printer]) #define SCM_STRUCT_PRINTER(X) (SCM_STRUCT_VTABLE_DATA(X)[scm_vtable_index_printer])