Changing the C source to use fixnum instead of int.
Aidan Kehoe
kehoea at parhasard.net
Sun Sep 4 05:29:22 EDT 2011
Hi,
I’ve written the below script which, when run, makes changes that give an
18k-line diff. It changes the nomenclature in the C sources such that
fixnums are called fixnums and integers (that is, fixnums union bignums) are
called integers, and such that EMACS_INT_{MAX,MIN} have better names. It’s
pretty invasive, but the source is far more internally consistent after this
change. Further changes in this direction can’t really be done mechanically;
in particular the internals manual talks about integers and fixnums
interchangeably, and some comments in src/ do the same thing.
Comments? Objections?
Best,
Aidan
---------------- change-int-to-fixnum.sh:
#!/bin/sh
GR=/Sources/ben-scripts/gr
HG=hg
for SOURCEDIR in $PWD/src $PWD/modules/*/ $PWD/man $PWD/man/*/; do
cd $SOURCEDIR;
# We need to avoid changing the following:
$GR make_integer 6BcV6rzwCQsWkaVYPV2ze1Z7Vo *
$GR CHECK_INTEGER Zy4JF5J718yigiFEOlIWUHso2sE *
$GR make_internal nVjtEVdljndsgKhFfJdJkBP4 *
$GR INTPTR qBjrplN2Z7JPfdfETWiQgdAo *
$GR CHAR_INT oCtwAmyY3Wjq26bcnYpLasklZs *
# Now, do the renaming:
$GR Lisp_Type_Int_ Lisp_Type_Fixnum_ *
$GR INT_GCBITS FIXNUM_GCBITS *
$GR INT_VALBITS FIXNUM_VALBITS *
$GR make_int make_fixnum *
$GR INTP FIXNUMP *
$GR XINT XFIXNUM *
$GR CHECK_INT CHECK_FIXNUM *
$GR XREALINT XREALFIXNUM *
$GR INT_PLUS FIXNUM_PLUS *
$GR INT_MINUS FIXNUM_MINUS *
$GR EMACS_INT_MAX MOST_POSITIVE_FIXNUM *
$GR EMACS_INT_MIN MOST_NEGATIVE_FIXNUM *
$GR NUMBER_FITS_IN_AN_EMACS_INT NUMBER_FITS_IN_A_FIXNUM *
$GR XFLOATINT XFLOATFIXNUM *
$GR XCHAR_OR_INT XCHAR_OR_FIXNUM *
$GR INT_OR_FLOAT FIXNUM_OR_FLOAT *
$GR 6BcV6rzwCQsWkaVYPV2ze1Z7Vo make_integer *
$GR Zy4JF5J718yigiFEOlIWUHso2sE CHECK_INTEGER *
$GR nVjtEVdljndsgKhFfJdJkBP4 make_internal *
$GR qBjrplN2Z7JPfdfETWiQgdAo INTPTR *
$GR oCtwAmyY3Wjq26bcnYpLasklZs CHAR_INT *
[ -f ChangeLog ] && $HG revert ChangeLog;
done
----------------
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
More information about the XEmacs-Beta
mailing list