• Paul Eggert's avatar
    Avoid macros in pdumper.c when it’s easy · 9117a667
    Paul Eggert authored
    Problem with DUMP_SET_REFERRER mentioned by Pip Cet at end of:
    https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00548.html
    * src/pdumper.c (DANGEROUS, EMACS_RELOC_TYPE_BITS)
    (EMACS_RELOC_LENGTH_BITS, DUMP_RELOC_TYPE_BITS)
    (DUMP_RELOC_ALIGNMENT_BITS, DUMP_RELOC_OFFSET_BITS)
    (DUMP_RELOCATION_ALIGNMENT, DUMP_ALIGNMENT)
    (WEIGHT_NONE, WEIGHT_NORMAL, WEIGHT_STRONG)
    (PDUMPER_MAX_OBJECT_SIZE):
    Now a constant, not a macro.
    (divide_round_up): Now a function, not a macro DIVIDE_ROUND_UP.
    All uses changed.
    (enum link_weight_enum, WEIGHT_NONE_VALUE)
    (WEIGHT_NORMAL_VALUE, WEIGHT_STRONG_VALUE): Remove.
    (struct link_weight): Just use an int.
    (dump_set_referrer): New function, replacing DUMP_SET_REFERRER
    macro with a different API.  All uses changed.
    (dump_clear_referrer): Rename from DUMP_CLEAR_REFERRER.
    All uses changed.
    (DEFINE_FROMLISP_FUNC, DEFINE_TOLISP_FUNC): Remove.
    (intmax_t_from_lisp, intmax_t_to_lisp, dump_off_from_lisp)
    (dump_off_to_lisp): Define without using macros,
    (dump_off_from_lisp): Add an eassert range check.
    (DUMP_FIELD_COPY): Simplify.
    9117a667
pdumper.c 174 KB