]> git.eshelyaron.com Git - emacs.git/commit
Make struct Lisp_Objfwd etc. objects read-only
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Apr 2019 18:54:23 +0000 (11:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Apr 2019 19:02:37 +0000 (12:02 -0700)
commit74b63d27a629db96b73a83f205d8a256911abc1c
tree2c2128596c370b9c05f5e80d7805137426d35be1
parent9287813da1ae9076f29be111674d1795bee66447
Make struct Lisp_Objfwd etc. objects read-only

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.
src/data.c
src/lisp.h
src/lread.c