mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-01 18:00:40 -08:00
Use mpz_import in mpz_set_uintmax_slow
* src/alloc.c (mpz_set_uintmax_slow): Use mpz_import.
This commit is contained in:
parent
fb26c9fd69
commit
d3549c1901
1 changed files with 5 additions and 5 deletions
10
src/alloc.c
10
src/alloc.c
|
|
@ -3874,12 +3874,12 @@ mpz_set_uintmax_slow (mpz_t result, uintmax_t v)
|
|||
{
|
||||
/* If long is larger then a faster path is taken. */
|
||||
eassert (sizeof (uintmax_t) > sizeof (unsigned long));
|
||||
/* This restriction could be lifted if needed. */
|
||||
eassert (sizeof (uintmax_t) <= 2 * sizeof (unsigned long));
|
||||
|
||||
mpz_set_ui (result, v >> (CHAR_BIT * sizeof (unsigned long)));
|
||||
mpz_mul_2exp (result, result, CHAR_BIT * sizeof (unsigned long));
|
||||
mpz_add_ui (result, result, v & -1ul);
|
||||
/* COUNT = 1 means just a single word of the given size. ORDER = -1
|
||||
is arbitrary since there's only a single word. ENDIAN = 0 means
|
||||
use the native endian-ness. NAILS = 0 means use the whole
|
||||
word. */
|
||||
mpz_import (result, 1, -1, sizeof (uintmax_t), 0, 0, &v);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue