Remove struct Lisp_Boolfwd

* src/lisp.h (struct Lisp Boolfwd): Deleted
(struct Lisp_Fwd): Replaced it with a boolvar field.
(DEFVAR_BOOL): Update.
* src/data.c (XBOOLVAR): Renamed from XBOOLFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/pdumper.c (dump_field_fwd): Use boolvar field.
This commit is contained in:
Helmut Eller 2024-06-23 11:37:58 +02:00
parent 6d9ba8e7bf
commit 9d9189f74c
3 changed files with 9 additions and 18 deletions

View file

@ -53,11 +53,11 @@ OBJFWDP (lispfwd a)
return XFWDTYPE (a) == Lisp_Fwd_Obj;
}
static struct Lisp_Boolfwd const *
XBOOLFWD (lispfwd a)
static bool *
XBOOLVAR (lispfwd a)
{
eassert (BOOLFWDP (a));
return &a->u.boolfwd;
return a->u.boolvar;
}
static struct Lisp_Kboard_Objfwd const *
XKBOARD_OBJFWD (lispfwd a)
@ -1335,7 +1335,7 @@ do_symval_forwarding (lispfwd valcontents)
return make_int (*XINTVAR (valcontents));
case Lisp_Fwd_Bool:
return (*XBOOLFWD (valcontents)->boolvar ? Qt : Qnil);
return (*XBOOLVAR (valcontents) ? Qt : Qnil);
case Lisp_Fwd_Obj:
return *XOBJFWD (valcontents)->objvar;
@ -1423,7 +1423,7 @@ store_symval_forwarding (lispfwd valcontents, Lisp_Object newval,
break;
case Lisp_Fwd_Bool:
*XBOOLFWD (valcontents)->boolvar = !NILP (newval);
*XBOOLVAR (valcontents) = !NILP (newval);
break;
case Lisp_Fwd_Obj:

View file

@ -3053,15 +3053,6 @@ make_uint (uintmax_t n)
(EXPR_SIGNED (expr) ? make_int (expr) : make_uint (expr))
/* Boolean forwarding pointer to an int variable.
This is like Lisp_Intfwd except that the ostensible
"value" of the symbol is t if the bool variable is true,
nil if it is false. */
struct Lisp_Boolfwd
{
bool *boolvar;
};
/* Forwarding pointer to a Lisp_Object variable.
This is allowed only in the value cell of a symbol,
and it means that the symbol's value really lives in the
@ -3136,7 +3127,7 @@ struct Lisp_Fwd
union
{
intmax_t *intvar;
struct Lisp_Boolfwd boolfwd;
bool *boolvar;
struct Lisp_Objfwd objfwd;
struct Lisp_Buffer_Objfwd bufobjfwd;
struct Lisp_Kboard_Objfwd kboardobjfwd;
@ -3518,7 +3509,7 @@ extern void defvar_kboard (struct Lisp_Fwd const *, char const *);
#define DEFVAR_BOOL(lname, vname, doc) \
do { \
static struct Lisp_Fwd const b_fwd \
= {Lisp_Fwd_Bool, .u.boolfwd = {&globals.f_##vname}}; \
= {Lisp_Fwd_Bool, .u.boolvar = &globals.f_##vname}; \
defvar_bool (&b_fwd, lname); \
} while (false)
#define DEFVAR_INT(lname, vname, doc) \

View file

@ -2315,8 +2315,8 @@ dump_field_fwd (struct dump_context *ctx, void *out, const void *in_start,
return;
case Lisp_Fwd_Bool:
{
const struct Lisp_Boolfwd *fwd = &(*in_field)->u.boolfwd;
dump_emacs_reloc_immediate_bool (ctx, fwd->boolvar, *fwd->boolvar);
const bool *boolvar = (*in_field)->u.boolvar;
dump_emacs_reloc_immediate_bool (ctx, boolvar, *boolvar);
}
return;
case Lisp_Fwd_Obj: