diff options
| author | Tom Tromey | 2018-08-08 17:01:55 -0600 |
|---|---|---|
| committer | Tom Tromey | 2018-08-08 17:01:55 -0600 |
| commit | d3549c190152921dd05e694d41e02a002789d191 (patch) | |
| tree | f662e309a5b9419c14a7ef88b8b7312299dda9c6 /src/alloc.c | |
| parent | fb26c9fd69d93aaa789e71365c030083c7f3c775 (diff) | |
| download | emacs-d3549c190152921dd05e694d41e02a002789d191.tar.gz emacs-d3549c190152921dd05e694d41e02a002789d191.zip | |
Use mpz_import in mpz_set_uintmax_slow
* src/alloc.c (mpz_set_uintmax_slow): Use mpz_import.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index edfb87e5cdd..1504d7912b3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3874,12 +3874,12 @@ mpz_set_uintmax_slow (mpz_t result, uintmax_t v) | |||
| 3874 | { | 3874 | { |
| 3875 | /* If long is larger then a faster path is taken. */ | 3875 | /* If long is larger then a faster path is taken. */ |
| 3876 | eassert (sizeof (uintmax_t) > sizeof (unsigned long)); | 3876 | eassert (sizeof (uintmax_t) > sizeof (unsigned long)); |
| 3877 | /* This restriction could be lifted if needed. */ | ||
| 3878 | eassert (sizeof (uintmax_t) <= 2 * sizeof (unsigned long)); | ||
| 3879 | 3877 | ||
| 3880 | mpz_set_ui (result, v >> (CHAR_BIT * sizeof (unsigned long))); | 3878 | /* COUNT = 1 means just a single word of the given size. ORDER = -1 |
| 3881 | mpz_mul_2exp (result, result, CHAR_BIT * sizeof (unsigned long)); | 3879 | is arbitrary since there's only a single word. ENDIAN = 0 means |
| 3882 | mpz_add_ui (result, result, v & -1ul); | 3880 | use the native endian-ness. NAILS = 0 means use the whole |
| 3881 | word. */ | ||
| 3882 | mpz_import (result, 1, -1, sizeof (uintmax_t), 0, 0, &v); | ||
| 3883 | } | 3883 | } |
| 3884 | 3884 | ||
| 3885 | 3885 | ||