<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/bignum.h, branch scratch/org-sync</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 Gnulib libgmp module</title>
<updated>2020-07-09T23:38:45+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-07-09T23:35:48+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c8b6006d82196f9063581e988ea12d6c99c95536'/>
<id>c8b6006d82196f9063581e988ea12d6c99c95536</id>
<content type='text'>
Instead of doing GMP by hand, use the Gnulib libgmp module.
* .gitignore: Add lib/gmp.h.
* admin/merge-gnulib (GNULIB_MODULES): Add libgmp.
* configure.ac (GMP_LIB, GMP_OBJ): Remove.  Gnulib uses the name
LIB_GMP, so all uses changed.  All uses of GMP_OBJ removed.
(HAVE_GMP): Set this from Gnulib’s variables.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4:
New files, copied from Gnulib.
* src/bignum.h, test/data/emacs-module/mod-test.c:
Include gmp.h unconditionally.
* src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h:
Remove.  This moves these files from src to lib, and
updates them to the current GMP version.
* test/Makefile.in (GMP_H): New macro.
($(test_module)): Use it to decide whether to compile
mini-gmp-gnulib.c too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of doing GMP by hand, use the Gnulib libgmp module.
* .gitignore: Add lib/gmp.h.
* admin/merge-gnulib (GNULIB_MODULES): Add libgmp.
* configure.ac (GMP_LIB, GMP_OBJ): Remove.  Gnulib uses the name
LIB_GMP, so all uses changed.  All uses of GMP_OBJ removed.
(HAVE_GMP): Set this from Gnulib’s variables.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4:
New files, copied from Gnulib.
* src/bignum.h, test/data/emacs-module/mod-test.c:
Include gmp.h unconditionally.
* src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h:
Remove.  This moves these files from src to lib, and
updates them to the current GMP version.
* test/Makefile.in (GMP_H): New macro.
($(test_module)): Use it to decide whether to compile
mini-gmp-gnulib.c too.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pacify buggy old GCC with a cast</title>
<updated>2020-05-06T18:01:57+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-05-06T17:57:18+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=02f5a419fdcfb3fb6c8a3e4debe7224010b40227'/>
<id>02f5a419fdcfb3fb6c8a3e4debe7224010b40227</id>
<content type='text'>
* src/bignum.h (bignum_integer): Pacify GCC 4.8.5.
Problem reported by Andreas Schwab in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg00781.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bignum.h (bignum_integer): Pacify GCC 4.8.5.
Problem reported by Andreas Schwab in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg00781.html
</pre>
</div>
</content>
</entry>
<entry>
<title>Use ATTRIBUTE_CONST for some bignum functions</title>
<updated>2020-03-27T21:18:13+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2020-03-27T21:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=90b6ba0a1697c07a668be1776f22246470682724'/>
<id>90b6ba0a1697c07a668be1776f22246470682724</id>
<content type='text'>
* src/bignum.h (mpz_get_d_rounded):
* src/lisp.h (bignum_to_double, bignum_to_intmax)
(bignum_to_uintmax, bignum_bufsize):
Declare as ATTRIBUTE_CONST.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bignum.h (mpz_get_d_rounded):
* src/lisp.h (bignum_to_double, bignum_to_intmax)
(bignum_to_uintmax, bignum_bufsize):
Declare as ATTRIBUTE_CONST.
</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>Improve bignum_integer static checking</title>
<updated>2019-08-18T19:12:45+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2019-08-18T19:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=780509f29f0aa006a578744f7e871eb6d5ce5931'/>
<id>780509f29f0aa006a578744f7e871eb6d5ce5931</id>
<content type='text'>
* src/bignum.h (bignum_integer): Now returns pointer-to-const,
to catch trivial mistakes where the caller might try to modify
a Lisp bignum.  Lisp bignums are supposed to be immutable.
All callers changed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bignum.h (bignum_integer): Now returns pointer-to-const,
to catch trivial mistakes where the caller might try to modify
a Lisp bignum.  Lisp bignums are supposed to be immutable.
All callers changed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactoring: Factor out a function to set an mpz_t from a Lisp int.</title>
<updated>2019-05-04T21:31:40+00:00</updated>
<author>
<name>Philipp Stephani</name>
</author>
<published>2019-05-04T21:31:40+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9684296a5d3405885e44d0b422deef19329567ef'/>
<id>9684296a5d3405885e44d0b422deef19329567ef</id>
<content type='text'>
* src/bignum.h (mpz_set_integer): New function.

* src/emacs-module.c (module_make_big_integer): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bignum.h (mpz_set_integer): New function.

* src/emacs-module.c (module_make_big_integer): Use it.
</pre>
</div>
</content>
</entry>
</feed>
