1. 05 Apr, 2020 2 commits
    • Eli Zaretskii's avatar
      Fix a recent change in bignum.c · 507f26d5
      Eli Zaretskii authored
      * src/bignum.c (check_int_nonnegative): Fix a recent change.
      Reported by Glenn Morris <rgm@gnu.org>.
      507f26d5
    • Paul Eggert's avatar
      Improve integer range checking · bec5cfee
      Paul Eggert authored
      * src/bignum.c (check_integer_range, check_uinteger_max)
      (check_int_nonnegative): New functions.
      * src/frame.c (check_frame_pixels): New function.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Use it.
      * src/lisp.h (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER):
      Remove these macros.  Unless otherwise specified, all callers
      replaced by calls to check_integer_range, check_uinteger_range,
      check_int_nonnegative.
      * src/frame.c (gui_set_right_divider_width)
      (gui_set_bottom_divider_width):
      * src/nsfns.m (ns_set_internal_border_width):
      * src/xfns.c (x_set_internal_border_width):
      Using check_int_nonnegative means these functions no longer
      incorrectly reject negative bignums; they treat them as 0,
      just like negative fixnums.
      bec5cfee
  2. 01 Jan, 2020 1 commit
  3. 13 Nov, 2019 1 commit
    • Paul Eggert's avatar
      Refactor bignum multiplication, exponentiation · 02e637ec
      Paul Eggert authored
      This doesn’t alter behavior, and simplifies the next commit.
      * src/bignum.c (GMP_NLIMBS_MAX, NLIMBS_LIMIT, emacs_mpz_size)
      (emacs_mpz_mul, emacs_mpz_mul_2exp, emacs_mpz_pow_ui): Move here ...
      * src/data.c: ... from here.
      02e637ec
  4. 21 Aug, 2019 2 commits
    • Paul Eggert's avatar
      Be more careful about pointers to bignum vals · 39fee209
      Paul Eggert authored
      This uses ‘const’ to be better at catching bugs that
      mistakenly attempt to modify a bignum value.
      Lisp bignums are supposed to be immutable.
      * src/alloc.c (make_pure_bignum):
      * src/fns.c (sxhash_bignum):
      Accept Lisp_Object instead of struct Lisp_Bignum *, as that’s
      simpler now.  Caller changed.
      * src/bignum.h (bignum_val, xbignum_val): New inline functions.
      Prefer them to &i->value and XBIGNUM (i)->value, since they
      apply ‘const’ to the result.
      * src/timefns.c (lisp_to_timespec): Use mpz_t const *
      to point to a bignum value.
      39fee209
    • Paul Eggert's avatar
      Avoid some excess precision in time arithmetic · 396ed88a
      Paul Eggert authored
      * doc/misc/emacs-mime.texi (time-date):
      Adjust example to match new behavior.
      * etc/NEWS: Mention this.
      * lisp/calendar/time-date.el (decoded-time-add)
      (decoded-time--alter-second):
      Don’t lose underestimate precision of seconds component.
      * src/bignum.c (mpz): Grow by 1.
      * src/timefns.c (trillion_factor): New function.
      (timeform_sub_ps_p): Remove.
      (time_arith): Avoid unnecessarily-large hz, by reducing the hz
      to a value no worse than the worse hz of the two arguments.
      The result is always exact unless an error is signaled.
      * test/src/timefns-tests.el (timefns-tests--decode-time):
      New function.
      (format-time-string-with-zone): Test (decode-time LOOK ZONE t)
      resolution as well as its numeric value.
      396ed88a
  5. 04 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Always allow at least double-precision bignums · 7f4558e3
      Paul Eggert authored
      Without this fix, Emacs can get into a tight loop reporting
      a range error when calculating timestamps.
      * doc/lispref/numbers.texi (Integer Basics):
      * src/alloc.c (syms_of_alloc): Document this.
      * src/bignum.c (make_bignum_bits): Always allow bignums
      of at least twice the width of (u)intmax_t.
      7f4558e3
  6. 08 Apr, 2019 1 commit
  7. 22 Mar, 2019 1 commit
    • Stefan Monnier's avatar
      Fix misuses of NULL when talking about the NUL character · 76fea1eb
      Stefan Monnier authored
      * lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias.
      
      * src/coding.c (setup_coding_system): Use new name.
      (detect_coding): Rename null_byte_found => nul_byte_found.
      (detect_coding_system): Use new name.
      Rename null_byte_found => nul_byte_found.
      (Fdefine_coding_system_internal): Use new name.
      (syms_of_coding): Rename inhibit-null-byte-detection to
      inhibit-nul-byte-detection.
      * src/w16select.c (get_clipboard_data): null_char => nul_char.
      * src/json.c (check_string_without_embedded_nuls): Rename from
      check_string_without_embedded_nulls.
      (Fjson_parse_string): Adjust accordingly.
      * src/coding.h (enum define_coding_undecided_arg_index)
      (enum coding_attr_index): ...null_byte... => ...nul_byte....
      * lisp/info.el (info-insert-file-contents, Info-insert-dir):
      * lisp/international/mule.el (define-coding-system):
      * lisp/vc/vc-git.el (vc-git--call):
      * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
      76fea1eb
  8. 01 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Update more copyright years · a04bf151
      Paul Eggert authored
      Update some other copyright years automatically, by running:
      Run 'UPDATE_COPYRIGHT_YEAR=2019 \
      UPDATE_COPYRIGHT_USE_INTERVALS=1 \
      UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 admin/update-copyright'
      followed by 'admin/merge-gnulib'.
      a04bf151
  9. 11 Oct, 2018 1 commit
    • Paul Eggert's avatar
      Fix mishandling of symbols that look like numbers · 5bd8cfc1
      Paul Eggert authored
      * src/bignum.c (make_neg_biguint): New function.
      * src/lread.c (read1): Do not mishandle an unquoted symbol
      with name equal to something like "1\0x", i.e., a string
      of numeric form followed by a NUL byte.
      Formerly these symbols were misread as numbers.
      (string_to_number): Change last argument from an integer flag
      to a pointer to the length.  This lets the caller figure out
      how much of the prefix was used.  All callers changed.
      Add a fast path if the integer (sans sign) fits in uintmax_t.
      Update comments and simplify now that bignums are present.
      * src/print.c (print_object): Fix quoting of symbols that look
      like numbers, by relying on string_to_number for the tricky
      cases rather than trying to redo its logic, incorrectly.  For
      example, (read (prin1-to-string '\1e+NaN)) formerly returned
      "1e+NaN", which was wrong: a backslash is needed in the output
      to prevent it from being read as a NaN.  Escape NO_BREAK_SPACE
      too, since lread.c treats it like SPACE.
      * test/src/print-tests.el (print-read-roundtrip):
      Add tests illustrating the abovementioned bugs.
      5bd8cfc1
  10. 07 Oct, 2018 2 commits
    • Paul Eggert's avatar
      New (TICKS . HZ) timestamp format · 93fe4209
      Paul Eggert authored
      This follows on a suggestion by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2018-08/msg00991.html
      (Bug#32902).
      * doc/lispref/buffers.texi (Modification Time):
      * doc/lispref/os.texi (Processor Run Time, Time Calculations)
      * doc/lispref/processes.texi (System Processes):
      * doc/lispref/text.texi (Undo):
      Let the "Time of Day" section cover timestamp format details.
      * doc/lispref/os.texi (Time of Day):
      Say that timestamp internal format should not be assumed.
      Document new (ticks . hz) format.  Omit mention of seconds-to-time
      since it is now just an alias for encode-time.
      (Time Conversion): Document encode-time extension.
      * etc/NEWS: Mention changes.
      * lisp/calendar/cal-dst.el (calendar-system-time-basis): Now const.
      * lisp/calendar/cal-dst.el (calendar-absolute-from-time)
      (calendar-time-from-absolute)
      (calendar-next-time-zone-transition):
      * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
      Simplify by using bignums, (TICKS . HZ), and new encode-time.
      * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
      Simplify by using bignums and new encode-time.
      * lisp/calendar/parse-time.el (parse-iso8601-time-string):
      Handle DST more accurately, by using new encode-time.
      * lisp/calendar/time-date.el (seconds-to-time):
      * lisp/calendar/timeclock.el (timeclock-seconds-to-time):
      Now just an alias for encode-time.
      * lisp/calendar/time-date.el (days-to-time):
      * lisp/emacs-lisp/timer.el (timer--time-setter):
      * lisp/net/ntlm.el (ntlm-compute-timestamp):
      * lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
      * lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
      * lisp/tar-mode (tar-octal-time):
      Don't assume timestamps default to list form.
      * lisp/tar-mode.el (tar-parse-octal-long-integer):
      Now an obsolete alias for tar-parse-octal-integer.
      * src/keyboard.c (decode_timer): Adjust to changes to
      time decoding functions elsewhere.
      * src/timefns.c: Include bignum.h, limits.h.
      (FASTER_TIMEFNS): New macro.
      (WARN_OBSOLETE_TIMESTAMPS, CURRENT_TIME_LIST)
      (timespec_hz, trillion, ztrillion):
      New constants.
      (make_timeval): Use TIME_T_MAX instead of its definiens.
      (check_time_validity, time_add, time_subtract):
      Remove.  All uses removed.
      (disassemble_lisp_time): Remove; old code now folded into
      decode_lisp_time.  All callers changed.
      (invalid_hz, s_ns_to_double, ticks_hz_list4, mpz_set_time)
      (timespec_mpz, timespec_ticks, time_hz_ticks)
      (lisp_time_hz_ticks, lisp_time_seconds)
      (time_form_stamp, lisp_time_form_stamp, decode_ticks_hz)
      (decode_lisp_time, mpz_time, list4_to_timespec):
      New functions.
      (decode_float_time, decode_time_components, lisp_to_timespec):
      Adjust to new struct lisp_time, which does not lose
      information like the old one did.
      (enum timeform): New enum.
      (decode_time_components): New arg FORM.  All callers changed.
      RESULT and DRESULT are now mutually exclusive; no callers need
      to change because of this.
      (decode_time_components, lisp_time_struct)
      (lisp_seconds_argument, time_arith, make_lisp_time, Ffloat_time)
      (Fencode_time):
      Add support for (TICKS . HZ) form.
      (DECODE_SECS_ONLY): New constant.
      (lisp_time_struct): 2nd arg is now enum timeform, not int.
      All callers changed.
      (check_tm_member): Support bignums.m
      (Fencode_time): Add new two-arg functionality.
      * src/systime.h (struct lisp_time): Now ticks+hz rather than
      hi+lo+us+ps, since ticks+hz does not lose info.
      * test/src/systime-tests.el (time-equal-p-nil-nil):
      New test.
      93fe4209
    • Paul Eggert's avatar
      Export converting mpz to [u]intmax · 84f39d33
      Paul Eggert authored
      This refactoring will help improve timestamp handling later
      (Bug#32902).
      * src/bignum.c (mpz_set_uintmax): Move to bignum.h,
      and make inline.
      (mpz_set_uintmax_slow): Now extern.
      (mpz_to_intmax, mpz_to_uintmax): New functions, with
      implementation taken from the old bignum_to_intmax
      and bignum_to_uintmax.
      (bignum_to_intmax, bignum_to_uintmax): Use them.
      84f39d33
  11. 22 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Round bignums consistently with other integers · 0b36041d
      Paul Eggert authored
      * src/bignum.c (mpz_bufsize): New function.
      (bignum_bufsize): Use it.
      (mpz_get_d_rounded): New function.
      (bignum_to_double): Use it.
      * src/bignum.c (bignum_to_double):
      * src/data.c (bignum_arith_driver):
      When converting bignums to double, round instead of
      truncating, to be consistent with what happens with fixnums.
      * test/src/floatfns-tests.el (bignum-to-float): Test rounding.
      0b36041d
  12. 11 Sep, 2018 2 commits
    • Paul Eggert's avatar
      Fix (round 1e+INF) core dump · 038a0904
      Paul Eggert authored
      * src/bignum.c (double_to_integer): Signal an error
      if D cannot be converted, instead of dumping core.
      * test/src/floatfns-tests.el (special-round): New test.
      038a0904
    • Paul Eggert's avatar
      Use overflow-error for bignum overflow · fa3785ea
      Paul Eggert authored
      This better corresponds to what emacs-26 did in the
      rare cases where it checked for integer overflow.
      * src/alloc.c (range_error): Remove.
      All uses changed to overflow_error.
      * src/eval.c (overflow_error): New function.
      fa3785ea
  13. 10 Sep, 2018 1 commit
  14. 04 Sep, 2018 2 commits
    • Paul Eggert's avatar
      Fix bignum initialization · 1d84e652
      Paul Eggert authored
      Problem reported by Andy Moreton in:
      https://lists.gnu.org/r/emacs-devel/2018-09/msg00072.html
      and crystal-ball diagnosis by Eli Zaretskii in:
      https://lists.gnu.org/r/emacs-devel/2018-09/msg00075.html
      * src/alloc.c (xrealloc_for_gmp, xfree_for_gmp): Move to bignum.c.
      (init_alloc): Move bignum initialization to init_bignum.
      * src/bignum.c (init_bignum): Rename from init_bignum_once.
      All users changed.
      * src/emacs.c (main): Call init_bignum after init_alloc,
      instead of calling init_bignum_once after init_bignum.
      1d84e652
    • Paul Eggert's avatar
      Speed up (+ 2 2) by a factor of 10 · fe042e9d
      Paul Eggert authored
      Improve arithmetic performance by avoiding bignums until needed.
      Also, simplify bignum memory management, fixing some unlikely leaks.
      This patch improved the performance of (+ 2 2) by a factor of ten
      on a simple microbenchmark computing (+ x 2), byte-compiled,
      with x a local variable initialized to 2 via means the byte
      compiler could not predict: performance improved from 135 to 13 ns.
      The platform was Fedora 28 x86-64, AMD Phenom II X4 910e.
      Performance also improved 0.6% on ‘make compile-always’.
      * src/bignum.c (init_bignum_once): New function.
      * src/emacs.c (main): Use it.
      * src/bignum.c (mpz): New global var.
      (make_integer_mpz): Rename from make_integer.  All uses changed.
      * src/bignum.c (double_to_bignum, make_bignum_bits)
      (make_bignum, make_bigint, make_biguint, make_integer_mpz):
      * src/data.c (bignum_arith_driver, Frem, Flogcount, Fash)
      (expt_integer, Fadd1, Fsub1, Flognot):
      * src/floatfns.c (Fabs, rounding_driver, rounddiv_q):
      * src/fns.c (Fnthcdr):
      Use mpz rather than mpz_initting and mpz_clearing private
      temporaries.
      * src/bignum.h (bignum_integer): New function.
      * src/data.c (Frem, Fmod, Fash, expt_integer):
      * src/floatfns.c (rounding_driver):
      Use it to simplify code.
      * src/data.c (FIXNUMS_FIT_IN_LONG, free_mpz_value):
      Remove.  All uses removed.
      (floating_point_op): New function.
      (floatop_arith_driver): New function, with much of the guts
      of the old float_arith_driver.
      (float_arith_driver): Use it.
      (floatop_arith_driver, arith_driver):
      Simplify by assuming NARGS is at least 2.
      All callers changed.
      (float_arith_driver):
      New arg, containing the partly converted value of the next arg.
      Reorder args for consistency.  All uses changed.
      (bignum_arith_driver): New function.
      (arith_driver): Use it.  Do fixnum-only integer calculations
      in intmax_t instead of mpz_t, when they fit.
      Break out mpz_t calculations into bignum_arith_driver.
      (Fquo): Use floatop_arith_driver instead of float_arith_driver,
      since the op is known to be valid.
      (Flogcount, Fash): Simplify by coalescing bignum and fixnum code.
      (Fadd1, Fsub1): Simplify by using make_int.
      fe042e9d
  15. 31 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Several fixes for formatting bignums · db2fed3b
      Paul Eggert authored
      * src/bignum.c: Include stdlib.h, for abs.
      (bignum_bufsize, bignum_to_c_string): New functions.
      * src/bignum.c (bignum_to_string):
      * src/print.c (print_vectorlike): Use them.
      * src/editfns.c (styled_format): Instead of having a separate
      buffer for sprintf (which does not work for bignums), just append
      to the main buffer.  When formatting bignums, add support for the
      standard integer flags -, #, 0, + and space.  Fix some comments.
      Capitalize properly when formatting bignums with %X.  Use
      functions like c_isdigit rather than reinventing the wheel.
      Simplify computation of excess precision.
      * src/print.c: Do not include bignum.h; no longer needed.
      (print_vectorlike): Avoid recalculating string length.
      * test/src/editfns-tests.el (format-bignum):
      Test some of the above fixes.
      db2fed3b
  16. 28 Aug, 2018 2 commits
    • Paul Eggert's avatar
      Improve bignum support for system types · d77d01d2
      Paul Eggert authored
      Use bignums when Emacs converts to and from system types like
      off_t for file sizes whose values can exceed fixnum range.
      Formerly, Emacs sometimes generted floats and sometimes ad-hoc
      conses of integers.  Emacs still accepts floats and conses for
      these system types, in case some stray Lisp code is generating
      them, though this usage is obsolescent.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/hash.texi (Defining Hash):
      * doc/lispref/nonascii.texi (Character Sets):
      * doc/lispref/os.texi (User Identification):
      * doc/lispref/processes.texi (System Processes):
      * etc/NEWS:
      Document changes.
      * src/bignum.c (mpz_set_uintmax, make_biguint)
      (mpz_set_uintmax_slow, bignum_to_intmax, bignum_to_uintmax):
      New functions.
      (mpz_set_intmax_slow): Implement via mpz_limbs_write,
      to avoid the need for an extra pass through a negative number.
      * src/charset.c (Fencode_char):
      * src/composite.h (LGLYPH_SET_CODE):
      * src/dired.c (file_attributes):
      * src/dosfns.c, src/w32.c (list_system_processes)
      (system_process_attributes):
      * src/editfns.c (init_editfns, Fuser_uid, Fuser_real_uid)
      (Fgroup_gid, Fgroup_real_gid, Femacs_pid):
      * src/emacs-module.c (check_vec_index):
      * src/fns.c (Fsafe_length):
      * src/process.c (record_deleted_pid, Fprocess_id):
      * src/sysdep.c (list_system_processes, system_process_attributes):
      * src/xselect.c (x_own_selection, selection_data_to_lisp_data):
      * src/xterm.c (set_wm_state):
      * src/inotify.c (inotifyevent_to_event, add_watch)
      (inotify_callback):
      If an integer is out of fixnum range, use a bignum
      instead of converting it to a float or a cons of integers.
      * src/coding.c (Fdefine_coding_system_internal):
      * src/frame.c (frame_windows_min_size)
      (x_set_frame_parameters):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/nsterm.m (mouseDown:):
      * src/syntax.c (find_defun_start):
      * src/w32fns.c (x_set_undecorated, w32_createwindow)
      (w32_wnd_proc, Fx_create_frame, Fx_show_tip)
      (w32_console_toggle_lock_key):
      * src/w32inevt.c (key_event):
      * src/w32proc.c (Fw32_get_locale_info):
      Do not mishandle floats by treating their addresses as their
      values.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_error_fatalp, Fgnutls_error_string):
      * src/keyboard.c (command_loop_1, make_lispy_event):
      * src/lread.c (read_filtered_event, read1)
      (substitute_object_recurse):
      * src/window.c (Fcoordinates_in_window_p, Fwindow_at)
      (window_resize_apply, Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height)
      (calc_line_height_property, on_hot_spot_p):
      * src/xfaces.c (check_lface_attrs):
      * src/xselect.c (x_get_local_selection, cons_to_x_long)
      (lisp_data_to_selection_data, clean_local_selection_data)
      (x_check_property_data, x_fill_property_data):
      (x_send_client_event):
      Do not reject bignums.
      * src/data.c (INTBIG_TO_LISP, intbig_to_lisp)
      (uintbig_to_lisp):
      Remove.  All uses removed.
      * src/data.c (cons_to_unsigned, cons_to_signed):
      * src/dbusbind.c (xd_signature, xd_extract_signed)
      (xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/dosfns.c, src/w32.c (system_process_attributes):
      * src/editfns.c (Fuser_full_name):
      * src/fileio.c (file_offset):
      * src/fileio.c (write_region):
      * src/font.c (font_unparse_xlfd, font_open_for_lface, Fopen_font):
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL, FRAME_PIXEL_X_FROM_CANON_X)
      (FRAME_PIXEL_Y_FROM_CANON_Y):
      * src/image.c (parse_image_spec, x_edge_detection)
      (compute_image_size):
      * src/json.c (json_to_lisp):
      * src/lcms.c (PARSE_LAB_LIST_FIELD, Flcms_cie_de2000)
      (PARSE_XYZ_LIST_FIELD, PARSE_JCH_LIST_FIELD)
      (PARSE_JAB_LIST_FIELD, PARSE_VIEW_CONDITION_FLOAT)
      (Flcms_temp_to_white_point):
      * src/nsimage.m (ns_load_image, setSizeFromSpec):
      * src/process.c (Fsignal_process, handle_child_signal):
      * src/sysdep.c (system_process_attributes):
      * src/xdisp.c (calc_line_height_property):
      Handle bignums.
      * src/data.c (Fnumber_to_string): Use proper predicate name in
      signal if the argument is not a number.
      * src/lisp.h (make_uint): New function.
      (INT_TO_INTEGER): New macro.
      (FIXED_OR_FLOATP, CHECK_FIXNUM_OR_FLOAT)
      (CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER, INTEGER_TO_CONS)
      (make_fixnum_or_float): Remove; no longer used.
      * src/nsfns.m, src/w32fns.c, src/xfns.c (Fx_create_frame):
      Reject floating-point min-width or min-height.
      * src/process.c (handle_child_signal): Do not worry
      about floating-point pids, as they are no longer generated.
      d77d01d2
    • Paul Eggert's avatar
      Modularize bignums better · 9abaf5f3
      Paul Eggert authored
      * src/bignum.c, src/bignum.h: New files.  Only modules that
      need to know how bignums are implemented should include
      bignum.h.  Currently these are alloc.c, bignum.c (of course),
      data.c, emacs.c, emacs-module.c, floatfns.c, fns.c, print.c.
      * src/Makefile.in (base_obj): Add bignum.o.
      * src/alloc.c (make_bignum_str): Move to bignum.c.
      (make_number): Remove; replaced by bignum.c’s make_integer.
      All callers changed.
      * src/conf_post.h (ARG_NONNULL): New macro.
      * src/json.c (json_to_lisp): Use it.
      * src/data.c (Fnatnump):
      Move NATNUMP’s implementation here from lisp.h.
      * src/data.c (Fnumber_to_string):
      * src/editfns.c (styled_format):
      Move conversion of string to bignum to bignum_to_string, and
      call it here.
      * src/emacs-module.c (module_make_integer):
      * src/floatfns.c (Fabs):
      Simplify by using make_int.
      * src/emacs.c: Include bignum.h, to expand its inline fns.
      * src/floatfns.c (Ffloat): Simplify by using XFLOATINT.
      (rounding_driver): Simplify by using double_to_bignum.
      (rounddiv_q): Clarify use of temporaries.
      * src/lisp.h: Move decls that need to know bignum internals to
      bignum.h.  Do not include gmp.h or mini-gmp.h; that is now
      bignum.h’s job.
      (GMP_NUM_BITS, struct Lisp_Bignum, XBIGNUM, mpz_set_intmax):
      Move to bignum.h.
      (make_int): New function.
      (NATNUMP): Remove; all callers changed to use Fnatnump.
      (XFLOATINT): If arg is a bignum, use bignum_to_double, so that
      bignum internals are not exposed here.
      * src/print.c (print_vectorlike): Use SAFE_ALLOCA to avoid the
      need for a record_unwind_protect_ptr.
      9abaf5f3