1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Bad cherry-picks

This commit is contained in:
Michael Gran 2025-03-30 19:08:41 -07:00
parent e371906dac
commit 76efca9929
5 changed files with 6 additions and 28 deletions

View file

@ -167,15 +167,6 @@ scm_i_latin1_string_hash (const char *str, size_t len)
uintptr_t
scm_i_utf8_string_hash (const char *str, size_t len)
{
const uint8_t *end, *ustr = (const uint8_t *) str;
uintptr_t ret;
/* The length of the string in characters. This name corresponds to
Jenkins' original name. */
size_t length;
uint32_t a, b, c, u32;
if (len == (size_t) -1)
len = strlen (str);
@ -431,11 +422,7 @@ SCM_DEFINE (scm_hashv, "hashv", 2, 0, 0,
#define FUNC_NAME s_scm_hashv
{
uintptr_t sz = scm_to_unsigned_integer (size, 1, UINTPTR_MAX);
<<<<<<< HEAD
return scm_from_ulong (scm_ihashv (key, sz));
=======
return scm_from_unsigned_integer (scm_ihashv (key, sz));
>>>>>>> 64dca4d57 (Store hashes as uintptr_t)
}
#undef FUNC_NAME

View file

@ -149,10 +149,10 @@ inum_magnitude (intptr_t i)
return mag;
}
static inline scm_t_inum
static inline scm_t_bits
negative_inum (scm_t_bits mag)
{
scm_t_inum i = ~mag + 1;
scm_t_bits i = ~mag + 1;
ASSERT (i >= SCM_MOST_NEGATIVE_FIXNUM);
return i;
}
@ -2038,7 +2038,7 @@ scm_integer_gcd_zi (struct scm_bignum *x, intptr_t y)
#if SCM_I_FIXNUM_BIT > SCM_LONG_BIT
if (y > ULONG_MAX)
{
struct scm_bignum *y_bignum = inum_to_bignum (y);
struct scm_bignum *y_bignum = intptr_t_to_bignum (y);
return scm_integer_gcd_zz (x, y_bignum);
}
#endif

View file

@ -6877,16 +6877,16 @@ scm_to_mpz (SCM val, mpz_t rop)
{
if (SCM_I_INUMP (val))
{
scm_t_inum inum = SCM_I_INUM (val);
intptr_t inum = SCM_I_INUM (val);
#if SCM_LONG_BIT >= SCM_I_FIXNUM_BIT
// Cast to long and directly pass to GMP.
mpz_set_si (rop, (long)inum);
#elif (2 * SCM_INTPTR_T_BIT) > SCM_I_FIXNUM_BIT
scm_t_inum inum_abs = inum;
intptr_t inum_abs = inum;
if (inum < 0)
inum_abs *= -1;
intptr_t high = inum_abs >> (SCM_INTPTR_T_BIT - 1);
intptr_t low = (intptr_t)(inum_abs & ((((scm_t_inum)1) << (SCM_INTPTR_T_BIT - 1)) - 1));
intptr_t low = (intptr_t)(inum_abs & ((((intptr_t)1) << (SCM_INTPTR_T_BIT - 1)) - 1));
mpz_set_si (rop, high);
mpz_mul_2exp (rop, rop, SCM_INTPTR_T_BIT - 1);
mpz_add_ui (rop, rop, low);

View file

@ -35,14 +35,9 @@
#include <io.h>
#include <fcntl.h>
<<<<<<< HEAD
#include "gc.h" /* for scm_*alloc, scm_strdup */
#include "filename.h"
#include "threads.h" /* for scm_i_scm_pthread_mutex_lock */
=======
#include "gc.h" /* for scm_*alloc, scm_strdup */
#include "threads.h" /* for scm_i_scm_pthread_mutex_lock */
>>>>>>> bbd90294d (Win32: add replacement for mkdtemp)
#include "posix-w32.h"

View file

@ -95,12 +95,8 @@
;; Old MS is MinGW using deprecated MSVCRT C library.
;; MinGW with UCRT C library prefers BCP 47 and can fall back to Old MS.
(define old-ms?
<<<<<<< HEAD
(and (string-contains %host-type "-mingw32")
(not (defined? '%UCRT))))
=======
(string-contains %host-type "-mingw32"))
>>>>>>> 8a3ba5975 (In i18n test, modify locale testing to focus on UTF-8)
(define %french-locale-name
(if old-ms?