• Paul Eggert's avatar
    Make struct Lisp_Objfwd etc. objects read-only · 74b63d27
    Paul Eggert authored
    Initialize these objects statically, and make them constants.
    This is a bit safer and more efficient.
    * src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD):
    * src/lisp.h (XBUFFER_OBJFWD):
    Return a pointer-to-const instead of an unrestricted pointer.
    (lispfwd): fwdptr is now a pointer-to-const instead of an
    unrestricted pointer.  All uses changed.
    (SET_SYMBOL_FWD): Accept pointer-to-const instead of an
    unrestricted pointer.
    (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
    (DEFVAR_KBOARD): Initialize static structures statically
    instead of dynamically, and make them const.
    * src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
    (defvar_lisp, defvar_kboard): Accept pointer-to-const instead
    of an unrestricted pointer; it’s now the caller’s
    responsibility to initialize the pointed-to storage.  No need
    for a separate address argument any more.  All callers
    changed.
    74b63d27
data.c 116 KB