mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-04 08:40:21 +02:00
Avoid pointer trickery with SCM values.
This commit is contained in:
parent
665aeda3e5
commit
1a45015332
2 changed files with 24 additions and 14 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2000-05-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* feature.c: No need to include "libguile/smob.h"
|
||||||
|
|
||||||
|
(scm_loc_features, features, scm_add_feature, scm_init_feature):
|
||||||
|
Removed variable 'scm_loc_features' as a pointer to the SCM value
|
||||||
|
holding the features list. Using variable 'features' instead,
|
||||||
|
which holds the interned pair. Thus, SCM_SETCDR can be used
|
||||||
|
instead of pointer trickery.
|
||||||
|
|
||||||
2000-05-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2000-05-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* alist.c (scm_acons): Use SCM{_SET}?_CELL_OBJECT as long as a
|
* alist.c (scm_acons): Use SCM{_SET}?_CELL_OBJECT as long as a
|
||||||
|
|
|
@ -45,30 +45,30 @@
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "libguile/_scm.h"
|
|
||||||
|
|
||||||
#include "libguile/root.h"
|
|
||||||
#include "libguile/smob.h"
|
|
||||||
#include "libguile/strings.h"
|
|
||||||
|
|
||||||
#include "libguile/validate.h"
|
|
||||||
#include "libguile/feature.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "libguile/_scm.h"
|
||||||
|
#include "libguile/root.h"
|
||||||
|
#include "libguile/strings.h"
|
||||||
|
#include "libguile/validate.h"
|
||||||
|
|
||||||
|
#include "libguile/feature.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static SCM *scm_loc_features;
|
static SCM features;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scm_add_feature (const char *str)
|
scm_add_feature (const char *str)
|
||||||
{
|
{
|
||||||
*scm_loc_features = scm_cons (SCM_CAR (scm_intern (str, strlen (str))),
|
SCM old = SCM_CDR (features);
|
||||||
*scm_loc_features);
|
SCM new = scm_cons (SCM_CAR (scm_intern (str, strlen (str))), old);
|
||||||
|
SCM_SETCDR (features, new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SCM_DEFINE (scm_program_arguments, "program-arguments", 0, 0, 0,
|
SCM_DEFINE (scm_program_arguments, "program-arguments", 0, 0, 0,
|
||||||
|
@ -100,7 +100,7 @@ scm_set_program_arguments (int argc, char **argv, char *first)
|
||||||
void
|
void
|
||||||
scm_init_feature()
|
scm_init_feature()
|
||||||
{
|
{
|
||||||
scm_loc_features = SCM_CDRLOC (scm_sysintern ("*features*", SCM_EOL));
|
features = scm_sysintern ("*features*", SCM_EOL);
|
||||||
#ifdef SCM_RECKLESS
|
#ifdef SCM_RECKLESS
|
||||||
scm_add_feature("reckless");
|
scm_add_feature("reckless");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue