aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2018-08-27 21:27:50 -0700
committerPaul Eggert2018-08-27 21:45:23 -0700
commitd77d01d22902acdc45c2c7059de4f1b158ab5806 (patch)
tree35f2b77594dc43e824852bb29598430945c5e6a4 /doc
parent9abaf5f3581ecb76f30e8a6e7ee0e9633c133d1c (diff)
downloademacs-d77d01d22902acdc45c2c7059de4f1b158ab5806.tar.gz
emacs-d77d01d22902acdc45c2c7059de4f1b158ab5806.zip
Improve bignum support for system types
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.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/files.texi26
-rw-r--r--doc/lispref/hash.texi4
-rw-r--r--doc/lispref/nonascii.texi12
-rw-r--r--doc/lispref/os.texi5
-rw-r--r--doc/lispref/processes.texi2
5 files changed, 16 insertions, 33 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 25fabe1ea5b..c50e358beb5 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1327,8 +1327,7 @@ other information recorded in the filesystem for the file, beyond the
1327file's contents. 1327file's contents.
1328 1328
1329@item 1329@item
1330The size of the file in bytes (@code{file-attribute-size}). This is 1330The size of the file in bytes (@code{file-attribute-size}).
1331floating point if the size is too large to fit in a Lisp integer.
1332 1331
1333@item 1332@item
1334The file's modes, as a string of ten letters or dashes, as in 1333The file's modes, as a string of ten letters or dashes, as in
@@ -1338,21 +1337,12 @@ The file's modes, as a string of ten letters or dashes, as in
1338An unspecified value, present for backward compatibility. 1337An unspecified value, present for backward compatibility.
1339 1338
1340@item 1339@item
1341The file's inode number (@code{file-attribute-inode-number}). If 1340The file's inode number (@code{file-attribute-inode-number}).
1342possible, this is an integer. If the inode number is too large to be
1343represented as an integer in Emacs Lisp but dividing it by
1344@math{2^{16}} yields a representable integer, then the value has the
1345form @code{(@var{high} . @var{low})}, where @var{low} holds the low 16
1346bits. If the inode number is too wide for even that, the value is of
1347the form @code{(@var{high} @var{middle} . @var{low})}, where
1348@code{high} holds the high bits, @var{middle} the middle 24 bits, and
1349@var{low} the low 16 bits.
1350 1341
1351@item 1342@item
1352The filesystem number of the device that the file is on 1343The filesystem number of the device that the file is on
1353@code{file-attribute-device-number}). Depending on the magnitude of 1344@code{file-attribute-device-number}).
1354the value, this can be either an integer or a cons cell, in the same 1345This element and the file's inode number
1355manner as the inode number. This element and the file's inode number
1356together give enough information to distinguish any two files on the 1346together give enough information to distinguish any two files on the
1357system---no two files can have the same values for both of these 1347system---no two files can have the same values for both of these
1358numbers. 1348numbers.
@@ -1368,8 +1358,8 @@ For example, here are the file attributes for @file{files.texi}:
1368 (20000 23 0 0) 1358 (20000 23 0 0)
1369 (20614 64555 902289 872000) 1359 (20614 64555 902289 872000)
1370 122295 "-rw-rw-rw-" 1360 122295 "-rw-rw-rw-"
1371 t (5888 2 . 43978) 1361 t 6473924464520138
1372 (15479 . 46724)) 1362 1014478468)
1373@end group 1363@end group
1374@end example 1364@end example
1375 1365
@@ -1410,10 +1400,10 @@ has a mode of read and write access for the owner, group, and world.
1410@item t 1400@item t
1411is merely a placeholder; it carries no information. 1401is merely a placeholder; it carries no information.
1412 1402
1413@item (5888 2 . 43978) 1403@item 6473924464520138
1414has an inode number of 6473924464520138. 1404has an inode number of 6473924464520138.
1415 1405
1416@item (15479 . 46724) 1406@item 1014478468
1417is on the file-system device whose number is 1014478468. 1407is on the file-system device whose number is 1014478468.
1418@end table 1408@end table
1419@end defun 1409@end defun
diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi
index f7d33eafa34..9c4b56d8dcb 100644
--- a/doc/lispref/hash.texi
+++ b/doc/lispref/hash.texi
@@ -300,8 +300,8 @@ the same integer.
300@defun sxhash-eql obj 300@defun sxhash-eql obj
301This function returns a hash code for Lisp object @var{obj} suitable 301This function returns a hash code for Lisp object @var{obj} suitable
302for @code{eql} comparison. I.e. it reflects identity of @var{obj} 302for @code{eql} comparison. I.e. it reflects identity of @var{obj}
303except for the case where the object is a float number, in which case 303except for the case where the object is a bignum or a float number,
304hash code is generated for the value. 304in which case a hash code is generated for the value.
305 305
306If two objects @var{obj1} and @var{obj2} are @code{eql}, then 306If two objects @var{obj1} and @var{obj2} are @code{eql}, then
307@code{(sxhash-eql @var{obj1})} and @code{(sxhash-eql @var{obj2})} are 307@code{(sxhash-eql @var{obj1})} and @code{(sxhash-eql @var{obj2})} are
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 4d75d6a1f14..9fb5587521d 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -829,18 +829,18 @@ two functions support these conversions.
829This function decodes a character that is assigned a @var{code-point} 829This function decodes a character that is assigned a @var{code-point}
830in @var{charset}, to the corresponding Emacs character, and returns 830in @var{charset}, to the corresponding Emacs character, and returns
831it. If @var{charset} doesn't contain a character of that code point, 831it. If @var{charset} doesn't contain a character of that code point,
832the value is @code{nil}. If @var{code-point} doesn't fit in a Lisp 832the value is @code{nil}.
833integer (@pxref{Integer Basics, most-positive-fixnum}), it can be 833
834For backward compatibility, if @var{code-point} doesn't fit in a Lisp
835fixnum (@pxref{Integer Basics, most-positive-fixnum}), it can be
834specified as a cons cell @code{(@var{high} . @var{low})}, where 836specified as a cons cell @code{(@var{high} . @var{low})}, where
835@var{low} are the lower 16 bits of the value and @var{high} are the 837@var{low} are the lower 16 bits of the value and @var{high} are the
836high 16 bits. 838high 16 bits. This usage is obsolescent.
837@end defun 839@end defun
838 840
839@defun encode-char char charset 841@defun encode-char char charset
840This function returns the code point assigned to the character 842This function returns the code point assigned to the character
841@var{char} in @var{charset}. If the result does not fit in a Lisp 843@var{char} in @var{charset}. If
842integer, it is returned as a cons cell @code{(@var{high} . @var{low})}
843that fits the second argument of @code{decode-char} above. If
844@var{charset} doesn't have a codepoint for @var{char}, the value is 844@var{charset} doesn't have a codepoint for @var{char}, the value is
845@code{nil}. 845@code{nil}.
846@end defun 846@end defun
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index c48d08490fd..0b9dd1c9cc3 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1197,24 +1197,19 @@ Titles}).
1197@cindex UID 1197@cindex UID
1198@defun user-real-uid 1198@defun user-real-uid
1199This function returns the real @acronym{UID} of the user. 1199This function returns the real @acronym{UID} of the user.
1200The value may be floating point, in the (unlikely) event that
1201the UID is too large to fit in a Lisp integer.
1202@end defun 1200@end defun
1203 1201
1204@defun user-uid 1202@defun user-uid
1205This function returns the effective @acronym{UID} of the user. 1203This function returns the effective @acronym{UID} of the user.
1206The value may be floating point.
1207@end defun 1204@end defun
1208 1205
1209@cindex GID 1206@cindex GID
1210@defun group-gid 1207@defun group-gid
1211This function returns the effective @acronym{GID} of the Emacs process. 1208This function returns the effective @acronym{GID} of the Emacs process.
1212The value may be floating point.
1213@end defun 1209@end defun
1214 1210
1215@defun group-real-gid 1211@defun group-real-gid
1216This function returns the real @acronym{GID} of the Emacs process. 1212This function returns the real @acronym{GID} of the Emacs process.
1217The value may be floating point.
1218@end defun 1213@end defun
1219 1214
1220@defun system-users 1215@defun system-users
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 447644022c5..f9ba703300b 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -2075,8 +2075,6 @@ attribute and @var{value} is the value of that attribute. The various
2075attribute @var{key}s that this function can return are listed below. 2075attribute @var{key}s that this function can return are listed below.
2076Not all platforms support all of these attributes; if an attribute is 2076Not all platforms support all of these attributes; if an attribute is
2077not supported, its association will not appear in the returned alist. 2077not supported, its association will not appear in the returned alist.
2078Values that are numbers can be either integer or floating point,
2079depending on the magnitude of the value.
2080 2078
2081@table @code 2079@table @code
2082@item euid 2080@item euid