<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/bignum.c, branch feature/context-menu</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Update copyright year to 2021</title>
<updated>2021-01-01T09:13:56+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2021-01-01T09:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ba05d005e5a81bc123ad8da928b1bccb6b160e7a'/>
<id>ba05d005e5a81bc123ad8da928b1bccb6b160e7a</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright".
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the full name of the null byte/character, not its abbreviation</title>
<updated>2020-10-05T18:19:59+00:00</updated>
<author>
<name>Andreas Schwab</name>
</author>
<published>2020-10-05T17:59:00+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a9f147af716aa026ec7778202901c4cb4bd5487d'/>
<id>a9f147af716aa026ec7778202901c4cb4bd5487d</id>
<content type='text'>
* lisp/subr.el (inhibit-nul-byte-detection): Make it an obsolete alias.
* src/coding.c (setup_coding_system): Use original name.
(detect_coding): Rename nul_byte_found =&gt; null_byte_found.
(detect_coding_system): Use original name.
Rename nul_byte_found =&gt; null_byte_found.
(Fdefine_coding_system_internal): Use original name.
(syms_of_coding): Rename inhibit-nul-byte-detection to
inhibit-null-byte-detection.
* src/w16select.c (get_clipboard_data): Rename nul_char to null_char.
* src/json.c (check_string_without_embedded_nulls): Rename from
check_string_without_embedded_nuls.
(Fjson_parse_string): Adjust accordingly.
* src/coding.h (enum define_coding_undecided_arg_index)
(enum coding_attr_index): Rename ...nul_byte... to ...null_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 original name.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lisp/subr.el (inhibit-nul-byte-detection): Make it an obsolete alias.
* src/coding.c (setup_coding_system): Use original name.
(detect_coding): Rename nul_byte_found =&gt; null_byte_found.
(detect_coding_system): Use original name.
Rename nul_byte_found =&gt; null_byte_found.
(Fdefine_coding_system_internal): Use original name.
(syms_of_coding): Rename inhibit-nul-byte-detection to
inhibit-null-byte-detection.
* src/w16select.c (get_clipboard_data): Rename nul_char to null_char.
* src/json.c (check_string_without_embedded_nulls): Rename from
check_string_without_embedded_nuls.
(Fjson_parse_string): Adjust accordingly.
* src/coding.h (enum define_coding_undecided_arg_index)
(enum coding_attr_index): Rename ...nul_byte... to ...null_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 original name.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a recent change in bignum.c</title>
<updated>2020-04-05T16:51:09+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2020-04-05T16:51:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=507f26d532aaf9db4622c42eec1f89466fb5c724'/>
<id>507f26d532aaf9db4622c42eec1f89466fb5c724</id>
<content type='text'>
* src/bignum.c (check_int_nonnegative): Fix a recent change.
Reported by Glenn Morris &lt;rgm@gnu.org&gt;.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bignum.c (check_int_nonnegative): Fix a recent change.
Reported by Glenn Morris &lt;rgm@gnu.org&gt;.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve integer range checking</title>
<updated>2020-04-05T08:24:36+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-04-05T08:17:32+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=bec5cfee7660f6e283efbd30a693a6f8e9ea46b8'/>
<id>bec5cfee7660f6e283efbd30a693a6f8e9ea46b8</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year to 2020</title>
<updated>2020-01-01T00:59:52+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-01-01T00:19:43+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=365e01cc9f64ce6ca947ccfd8612d60763280a37'/>
<id>365e01cc9f64ce6ca947ccfd8612d60763280a37</id>
<content type='text'>
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor bignum multiplication, exponentiation</title>
<updated>2019-11-13T21:10:09+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-11-13T20:10:31+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=02e637ecca3b1419d2a6c433eca72c5728c65051'/>
<id>02e637ecca3b1419d2a6c433eca72c5728c65051</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Be more careful about pointers to bignum vals</title>
<updated>2019-08-21T07:11:45+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-08-21T07:06:00+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=39fee209942ab7c35b4789f0010264cd6a52197b'/>
<id>39fee209942ab7c35b4789f0010264cd6a52197b</id>
<content type='text'>
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 &amp;i-&gt;value and XBIGNUM (i)-&gt;value, since they
apply ‘const’ to the result.
* src/timefns.c (lisp_to_timespec): Use mpz_t const *
to point to a bignum value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &amp;i-&gt;value and XBIGNUM (i)-&gt;value, since they
apply ‘const’ to the result.
* src/timefns.c (lisp_to_timespec): Use mpz_t const *
to point to a bignum value.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid some excess precision in time arithmetic</title>
<updated>2019-08-21T00:36:46+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-08-21T00:34:03+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=396ed88a50fba95cd3b989965defef0130a42c42'/>
<id>396ed88a50fba95cd3b989965defef0130a42c42</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Always allow at least double-precision bignums</title>
<updated>2019-06-04T15:34:15+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-06-04T15:13:20+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7f4558e3d9edbdee6901e5fbcd4a4072f49ec5b9'/>
<id>7f4558e3d9edbdee6901e5fbcd4a4072f49ec5b9</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow gap before first non-Lisp pseudovec member</title>
<updated>2019-04-08T20:01:21+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-04-08T19:59:22+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a038df77de7b1aa2d73a6478493b8838b59e4982'/>
<id>a038df77de7b1aa2d73a6478493b8838b59e4982</id>
<content type='text'>
Problem reported by Keith David Bershatsky in:
https://lists.gnu.org/r/emacs-devel/2019-04/msg00259.html
Solution suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-04/msg00282.html
* src/buffer.h (BUFFER_LISP_SIZE): Simplify by using PSEUDOVECSIZE.
(BUFFER_REST_SIZE): Simplify by using VECSIZE and BUFFER_LISP_SIZE.
* src/lisp.h (PSEUDOVECSIZE): Base it on the last Lisp field,
not the first non-Lisp field.  All callers changed.  Callers
without Lisp fields changed to use ALLOCATE_PLAIN_PSEUDOVECTOR.
(ALLOCATE_PLAIN_PSEUDOVECTOR): New macro.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem reported by Keith David Bershatsky in:
https://lists.gnu.org/r/emacs-devel/2019-04/msg00259.html
Solution suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-04/msg00282.html
* src/buffer.h (BUFFER_LISP_SIZE): Simplify by using PSEUDOVECSIZE.
(BUFFER_REST_SIZE): Simplify by using VECSIZE and BUFFER_LISP_SIZE.
* src/lisp.h (PSEUDOVECSIZE): Base it on the last Lisp field,
not the first non-Lisp field.  All callers changed.  Callers
without Lisp fields changed to use ALLOCATE_PLAIN_PSEUDOVECTOR.
(ALLOCATE_PLAIN_PSEUDOVECTOR): New macro.
</pre>
</div>
</content>
</entry>
</feed>
