diff options
| author | Eli Zaretskii | 2018-09-08 12:20:55 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-09-08 12:20:55 +0300 |
| commit | e48968561728d6c1d9e4e8753cd7eafa08e37ac7 (patch) | |
| tree | 7956545062a40da92c5ed73469879f7c28af9279 | |
| parent | f9a72b83abc0f8de85840269b59c228b55496dd4 (diff) | |
| download | emacs-e48968561728d6c1d9e4e8753cd7eafa08e37ac7.tar.gz emacs-e48968561728d6c1d9e4e8753cd7eafa08e37ac7.zip | |
Fix documentation for conversion to bignums
* src/xselect.c (selection_data_to_lisp_data):
* src/w32fns.c (Fw32_read_registry):
* src/process.c (Fprocess_id):
* src/font.c (Ffont_variation_glyphs, Finternal_char_font):
* src/fns.c (Fsafe_length):
* src/editfns.c (Fuser_uid, Fuser_real_uid, Fgroup_gid)
(Fgroup_real_gid, Femacs_pid):
* src/dired.c (Ffile_attributes):
* src/charset.c (Fencode_char): Update commentary and doc
strings for recent changes that produce bignums where
previously cons cells of integers were produced.
| -rw-r--r-- | src/charset.c | 4 | ||||
| -rw-r--r-- | src/dired.c | 17 | ||||
| -rw-r--r-- | src/editfns.c | 15 | ||||
| -rw-r--r-- | src/fns.c | 3 | ||||
| -rw-r--r-- | src/font.c | 6 | ||||
| -rw-r--r-- | src/process.c | 1 | ||||
| -rw-r--r-- | src/w32fns.c | 17 | ||||
| -rw-r--r-- | src/xselect.c | 15 |
8 files changed, 39 insertions, 39 deletions
diff --git a/src/charset.c b/src/charset.c index 7b272a204a1..e11a8366d58 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -1870,7 +1870,9 @@ although this usage is obsolescent. */) | |||
| 1870 | 1870 | ||
| 1871 | DEFUN ("encode-char", Fencode_char, Sencode_char, 2, 2, 0, | 1871 | DEFUN ("encode-char", Fencode_char, Sencode_char, 2, 2, 0, |
| 1872 | doc: /* Encode the character CH into a code-point of CHARSET. | 1872 | doc: /* Encode the character CH into a code-point of CHARSET. |
| 1873 | Return nil if CHARSET doesn't include CH. */) | 1873 | Return the encoded code-point, a fixnum if its value is small enough, |
| 1874 | otherwise a bignum. | ||
| 1875 | Return nil if CHARSET doesn't support CH. */) | ||
| 1874 | (Lisp_Object ch, Lisp_Object charset) | 1876 | (Lisp_Object ch, Lisp_Object charset) |
| 1875 | { | 1877 | { |
| 1876 | int c, id; | 1878 | int c, id; |
diff --git a/src/dired.c b/src/dired.c index c4cda400a06..70c5bb24b4e 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -867,7 +867,8 @@ Elements of the attribute list are: | |||
| 867 | 0. t for directory, string (name linked to) for symbolic link, or nil. | 867 | 0. t for directory, string (name linked to) for symbolic link, or nil. |
| 868 | 1. Number of links to file. | 868 | 1. Number of links to file. |
| 869 | 2. File uid as a string or a number. If a string value cannot be | 869 | 2. File uid as a string or a number. If a string value cannot be |
| 870 | looked up, an integer value is returned. | 870 | looked up, an integer value is returned, which could be a fixnum, |
| 871 | if it's small enough, otherwise a bignum. | ||
| 871 | 3. File gid, likewise. | 872 | 3. File gid, likewise. |
| 872 | 4. Last access time, as a list of integers (HIGH LOW USEC PSEC) in the | 873 | 4. Last access time, as a list of integers (HIGH LOW USEC PSEC) in the |
| 873 | same style as (current-time). | 874 | same style as (current-time). |
| @@ -876,16 +877,14 @@ Elements of the attribute list are: | |||
| 876 | change to the file's contents. | 877 | change to the file's contents. |
| 877 | 6. Last status change time, likewise. This is the time of last change | 878 | 6. Last status change time, likewise. This is the time of last change |
| 878 | to the file's attributes: owner and group, access mode bits, etc. | 879 | to the file's attributes: owner and group, access mode bits, etc. |
| 879 | 7. Size in bytes. | 880 | 7. Size in bytes, which could be a fixnum, if it's small enough, |
| 881 | otherwise a bignum. | ||
| 880 | 8. File modes, as a string of ten letters or dashes as in ls -l. | 882 | 8. File modes, as a string of ten letters or dashes as in ls -l. |
| 881 | 9. An unspecified value, present only for backward compatibility. | 883 | 9. An unspecified value, present only for backward compatibility. |
| 882 | 10. inode number. If it is larger than what an Emacs integer can hold, | 884 | 10. inode number, which could be a fixnum, if it's small enough, |
| 883 | this is of the form (HIGH . LOW): first the high bits, then the low 16 bits. | 885 | otherwise a bignum. |
| 884 | If even HIGH is too large for an Emacs integer, this is instead of the form | 886 | 11. Filesystem device number. If it is larger than what a fixnum |
| 885 | (HIGH MIDDLE . LOW): first the high bits, then the middle 24 bits, | 887 | can hold, it is a bignum. |
| 886 | and finally the low 16 bits. | ||
| 887 | 11. Filesystem device number. If it is larger than what the Emacs | ||
| 888 | integer can hold, this is a cons cell, similar to the inode number. | ||
| 889 | 888 | ||
| 890 | On most filesystems, the combination of the inode and the device | 889 | On most filesystems, the combination of the inode and the device |
| 891 | number uniquely identifies the file. | 890 | number uniquely identifies the file. |
diff --git a/src/editfns.c b/src/editfns.c index 191a9ab8f8a..f19c3f1dca9 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1377,7 +1377,8 @@ This ignores the environment variables LOGNAME and USER, so it differs from | |||
| 1377 | } | 1377 | } |
| 1378 | 1378 | ||
| 1379 | DEFUN ("user-uid", Fuser_uid, Suser_uid, 0, 0, 0, | 1379 | DEFUN ("user-uid", Fuser_uid, Suser_uid, 0, 0, 0, |
| 1380 | doc: /* Return the effective uid of Emacs. */) | 1380 | doc: /* Return the effective uid of Emacs. |
| 1381 | Value is a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 1381 | (void) | 1382 | (void) |
| 1382 | { | 1383 | { |
| 1383 | uid_t euid = geteuid (); | 1384 | uid_t euid = geteuid (); |
| @@ -1385,7 +1386,8 @@ DEFUN ("user-uid", Fuser_uid, Suser_uid, 0, 0, 0, | |||
| 1385 | } | 1386 | } |
| 1386 | 1387 | ||
| 1387 | DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0, | 1388 | DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0, |
| 1388 | doc: /* Return the real uid of Emacs. */) | 1389 | doc: /* Return the real uid of Emacs. |
| 1390 | Value is a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 1389 | (void) | 1391 | (void) |
| 1390 | { | 1392 | { |
| 1391 | uid_t uid = getuid (); | 1393 | uid_t uid = getuid (); |
| @@ -1393,7 +1395,8 @@ DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0, | |||
| 1393 | } | 1395 | } |
| 1394 | 1396 | ||
| 1395 | DEFUN ("group-gid", Fgroup_gid, Sgroup_gid, 0, 0, 0, | 1397 | DEFUN ("group-gid", Fgroup_gid, Sgroup_gid, 0, 0, 0, |
| 1396 | doc: /* Return the effective gid of Emacs. */) | 1398 | doc: /* Return the effective gid of Emacs. |
| 1399 | Value is a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 1397 | (void) | 1400 | (void) |
| 1398 | { | 1401 | { |
| 1399 | gid_t egid = getegid (); | 1402 | gid_t egid = getegid (); |
| @@ -1401,7 +1404,8 @@ DEFUN ("group-gid", Fgroup_gid, Sgroup_gid, 0, 0, 0, | |||
| 1401 | } | 1404 | } |
| 1402 | 1405 | ||
| 1403 | DEFUN ("group-real-gid", Fgroup_real_gid, Sgroup_real_gid, 0, 0, 0, | 1406 | DEFUN ("group-real-gid", Fgroup_real_gid, Sgroup_real_gid, 0, 0, 0, |
| 1404 | doc: /* Return the real gid of Emacs. */) | 1407 | doc: /* Return the real gid of Emacs. |
| 1408 | Value is a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 1405 | (void) | 1409 | (void) |
| 1406 | { | 1410 | { |
| 1407 | gid_t gid = getgid (); | 1411 | gid_t gid = getgid (); |
| @@ -1481,7 +1485,8 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, | |||
| 1481 | } | 1485 | } |
| 1482 | 1486 | ||
| 1483 | DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, | 1487 | DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, |
| 1484 | doc: /* Return the process ID of Emacs, as a number. */) | 1488 | doc: /* Return the process ID of Emacs, as a number. |
| 1489 | Value is a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 1485 | (void) | 1490 | (void) |
| 1486 | { | 1491 | { |
| 1487 | pid_t pid = getpid (); | 1492 | pid_t pid = getpid (); |
| @@ -133,7 +133,8 @@ DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0, | |||
| 133 | doc: /* Return the length of a list, but avoid error or infinite loop. | 133 | doc: /* Return the length of a list, but avoid error or infinite loop. |
| 134 | This function never gets an error. If LIST is not really a list, | 134 | This function never gets an error. If LIST is not really a list, |
| 135 | it returns 0. If LIST is circular, it returns an integer that is at | 135 | it returns 0. If LIST is circular, it returns an integer that is at |
| 136 | least the number of distinct elements. */) | 136 | least the number of distinct elements. |
| 137 | Value is a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 137 | (Lisp_Object list) | 138 | (Lisp_Object list) |
| 138 | { | 139 | { |
| 139 | intptr_t len = 0; | 140 | intptr_t len = 0; |
diff --git a/src/font.c b/src/font.c index 50ec39a9a49..799d5db205c 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4485,7 +4485,8 @@ Each element of the value is a cons (VARIATION-SELECTOR . GLYPH-ID), | |||
| 4485 | where | 4485 | where |
| 4486 | VARIATION-SELECTOR is a character code of variation selection | 4486 | VARIATION-SELECTOR is a character code of variation selection |
| 4487 | (#xFE00..#xFE0F or #xE0100..#xE01EF) | 4487 | (#xFE00..#xFE0F or #xE0100..#xE01EF) |
| 4488 | GLYPH-ID is a glyph code of the corresponding variation glyph. */) | 4488 | GLYPH-ID is a glyph code of the corresponding variation glyph, |
| 4489 | a fixnum, if it's small enough, otherwise a bignum. */) | ||
| 4489 | (Lisp_Object font_object, Lisp_Object character) | 4490 | (Lisp_Object font_object, Lisp_Object character) |
| 4490 | { | 4491 | { |
| 4491 | unsigned variations[256]; | 4492 | unsigned variations[256]; |
| @@ -4522,7 +4523,8 @@ where | |||
| 4522 | that apply to POSITION. POSITION may be nil, in which case, | 4523 | that apply to POSITION. POSITION may be nil, in which case, |
| 4523 | FONT-SPEC is the font for displaying the character CH with the | 4524 | FONT-SPEC is the font for displaying the character CH with the |
| 4524 | default face. GLYPH-CODE is the glyph code in the font to use for | 4525 | default face. GLYPH-CODE is the glyph code in the font to use for |
| 4525 | the character. | 4526 | the character, it is a fixnum, if it is small enough, otherwise a |
| 4527 | bignum. | ||
| 4526 | 4528 | ||
| 4527 | For a text terminal, return a nonnegative integer glyph code for | 4529 | For a text terminal, return a nonnegative integer glyph code for |
| 4528 | the character, or a negative integer if the character is not | 4530 | the character, or a negative integer if the character is not |
diff --git a/src/process.c b/src/process.c index 454278a5a27..ebaaf33e57f 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1157,6 +1157,7 @@ If PROCESS has not yet exited or died, return 0. */) | |||
| 1157 | DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0, | 1157 | DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0, |
| 1158 | doc: /* Return the process id of PROCESS. | 1158 | doc: /* Return the process id of PROCESS. |
| 1159 | This is the pid of the external process which PROCESS uses or talks to. | 1159 | This is the pid of the external process which PROCESS uses or talks to. |
| 1160 | It is a fixnum if the value is small enough, otherwise a bignum. | ||
| 1160 | For a network, serial, and pipe connections, this value is nil. */) | 1161 | For a network, serial, and pipe connections, this value is nil. */) |
| 1161 | (register Lisp_Object process) | 1162 | (register Lisp_Object process) |
| 1162 | { | 1163 | { |
diff --git a/src/w32fns.c b/src/w32fns.c index 153cba9f755..9a9789d8af3 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -10100,19 +10100,16 @@ the return value depends on the type of the data stored in Registry: | |||
| 10100 | 10100 | ||
| 10101 | If the data type is REG_NONE, the function returns t. | 10101 | If the data type is REG_NONE, the function returns t. |
| 10102 | If the data type is REG_DWORD or REG_QWORD, the function returns | 10102 | If the data type is REG_DWORD or REG_QWORD, the function returns |
| 10103 | its integer value. If the value is too large for a Lisp integer, | 10103 | its integer value. If the value is too large for a fixnum, |
| 10104 | the function returns a cons (HIGH . LOW) of 2 integers, with LOW | 10104 | the function returns a bignum. |
| 10105 | the low 16 bits and HIGH the high bits. If HIGH is too large for | ||
| 10106 | a Lisp integer, the function returns (HIGH MIDDLE . LOW), first | ||
| 10107 | the high bits, then the middle 24 bits, and finally the low 16 bits. | ||
| 10108 | If the data type is REG_BINARY, the function returns a vector whose | 10105 | If the data type is REG_BINARY, the function returns a vector whose |
| 10109 | elements are individual bytes of the value. | 10106 | elements are individual bytes of the value. |
| 10110 | If the data type is REG_SZ, the function returns a string. | 10107 | If the data type is REG_SZ, the function returns a string. |
| 10111 | If the data type REG_EXPAND_SZ, the function returns a string with | 10108 | If the data type is REG_EXPAND_SZ, the function returns a string |
| 10112 | all the %..% references to environment variables replaced by the | 10109 | with all the %..% references to environment variables replaced |
| 10113 | values of those variables. If the expansion fails, or some | 10110 | by the values of those variables. If the expansion fails, or |
| 10114 | variables are not defined in the environment, some or all of | 10111 | some variables are not defined in the environment, some or all |
| 10115 | the environment variables will remain unexpanded. | 10112 | of the environment variables will remain unexpanded. |
| 10116 | If the data type is REG_MULTI_SZ, the function returns a list whose | 10113 | If the data type is REG_MULTI_SZ, the function returns a list whose |
| 10117 | elements are the individual strings. | 10114 | elements are the individual strings. |
| 10118 | 10115 | ||
diff --git a/src/xselect.c b/src/xselect.c index 53e788523cc..a87784fb4b1 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1536,17 +1536,10 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo, | |||
| 1536 | ATOM 32 > 1 Vector of Symbols | 1536 | ATOM 32 > 1 Vector of Symbols |
| 1537 | * 16 1 Integer | 1537 | * 16 1 Integer |
| 1538 | * 16 > 1 Vector of Integers | 1538 | * 16 > 1 Vector of Integers |
| 1539 | * 32 1 if <=16 bits: Integer | 1539 | * 32 1 if small enough: fixnum |
| 1540 | if > 16 bits: Cons of top16, bot16 | 1540 | otherwise: bignum |
| 1541 | * 32 > 1 Vector of the above | 1541 | * 32 > 1 Vector of the above |
| 1542 | 1542 | ||
| 1543 | When converting a Lisp number to C, it is assumed to be of format 16 if | ||
| 1544 | it is an integer, and of format 32 if it is a cons of two integers. | ||
| 1545 | |||
| 1546 | When converting a vector of numbers from Lisp to C, it is assumed to be | ||
| 1547 | of format 16 if every element in the vector is an integer, and is assumed | ||
| 1548 | to be of format 32 if any element is a cons of two integers. | ||
| 1549 | |||
| 1550 | When converting an object to C, it may be of the form (SYMBOL . <data>) | 1543 | When converting an object to C, it may be of the form (SYMBOL . <data>) |
| 1551 | where SYMBOL is what we should claim that the type is. Format and | 1544 | where SYMBOL is what we should claim that the type is. Format and |
| 1552 | representation are as above. | 1545 | representation are as above. |
| @@ -1611,8 +1604,8 @@ selection_data_to_lisp_data (struct x_display_info *dpyinfo, | |||
| 1611 | } | 1604 | } |
| 1612 | 1605 | ||
| 1613 | /* Convert a single 16-bit number or a small 32-bit number to a Lisp_Int. | 1606 | /* Convert a single 16-bit number or a small 32-bit number to a Lisp_Int. |
| 1614 | If the number is 32 bits and won't fit in a Lisp_Int, | 1607 | If the number is 32 bits and won't fit in a Lisp_Int, convert it |
| 1615 | convert it to a cons of integers, 16 bits in each half. | 1608 | to a bignum. |
| 1616 | 1609 | ||
| 1617 | INTEGER is a signed type, CARDINAL is unsigned. | 1610 | INTEGER is a signed type, CARDINAL is unsigned. |
| 1618 | Assume any other types are unsigned as well. | 1611 | Assume any other types are unsigned as well. |