1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 23:50:47 +02:00

Avoid pointer trickery with SCM values.

This commit is contained in:
Dirk Herrmann 2000-05-08 12:29:12 +00:00
parent 665aeda3e5
commit 1a45015332
2 changed files with 24 additions and 14 deletions

View file

@ -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>
* alist.c (scm_acons): Use SCM{_SET}?_CELL_OBJECT as long as a

View file

@ -45,30 +45,30 @@
#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
#include <string.h>
#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
scm_add_feature (const char *str)
{
*scm_loc_features = scm_cons (SCM_CAR (scm_intern (str, strlen (str))),
*scm_loc_features);
SCM old = SCM_CDR (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,
@ -100,7 +100,7 @@ scm_set_program_arguments (int argc, char **argv, char *first)
void
scm_init_feature()
{
scm_loc_features = SCM_CDRLOC (scm_sysintern ("*features*", SCM_EOL));
features = scm_sysintern ("*features*", SCM_EOL);
#ifdef SCM_RECKLESS
scm_add_feature("reckless");
#endif