mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Inline definition of SIZEOF_SCM_T_BITS
* libguile/_scm.h (SIZEOF_SCM_T_BITS): Remove definition. * libguile/conv-integer.i.c (SCM_TO_TYPE_PROTO, SCM_FROM_TYPE_PROTO): * libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO): * libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): * libguile/hashtab.c: * libguile/loader.c: * libguile/socket.c: * libguile/vm-engine.c (VM_NAME): Use SIZEOF_UINTPTR_T instead of SIZEOF_SCM_T_BITS.
This commit is contained in:
parent
ea3c5cf909
commit
7b4ab0895b
8 changed files with 10 additions and 13 deletions
|
@ -36,9 +36,6 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* The size of `scm_t_bits'. */
|
||||
#define SIZEOF_SCM_T_BITS SIZEOF_VOID_P
|
||||
|
||||
#include <errno.h>
|
||||
#include <verify.h>
|
||||
#include <alignof.h>
|
||||
|
|
|
@ -29,7 +29,7 @@ SCM_TO_TYPE_PROTO (SCM val)
|
|||
if (SCM_I_INUMP (val))
|
||||
{
|
||||
scm_t_signed_bits n = SCM_I_INUM (val);
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE > SIZEOF_SCM_T_BITS
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE > SIZEOF_UINTPTR_T
|
||||
return n;
|
||||
#else
|
||||
if (n >= TYPE_MIN && n <= TYPE_MAX)
|
||||
|
@ -113,7 +113,7 @@ SCM_TO_TYPE_PROTO (SCM val)
|
|||
SCM
|
||||
SCM_FROM_TYPE_PROTO (TYPE val)
|
||||
{
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_SCM_T_BITS
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_UINTPTR_T
|
||||
return SCM_I_MAKINUM (val);
|
||||
#else
|
||||
if (SCM_FIXABLE (val))
|
||||
|
|
|
@ -95,7 +95,7 @@ SCM_TO_TYPE_PROTO (SCM val)
|
|||
SCM
|
||||
SCM_FROM_TYPE_PROTO (TYPE val)
|
||||
{
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_SCM_T_BITS
|
||||
#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_UINTPTR_T
|
||||
return SCM_I_MAKINUM (val);
|
||||
#else
|
||||
if (SCM_POSFIXABLE (val))
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
result of 'guile -c "(display (assq-ref (gc-stats)
|
||||
'heap-total-allocated))"'. */
|
||||
|
||||
#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_SCM_T_BITS)
|
||||
#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_UINTPTR_T)
|
||||
|
||||
/* Set this to != 0 if every cell that is accessed shall be checked:
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
static unsigned long hashtable_size[] = {
|
||||
31, 61, 113, 223, 443, 883, 1759, 3517, 7027, 14051, 28099, 56197, 112363,
|
||||
224717, 449419, 898823, 1797641, 3595271, 7190537, 14381041
|
||||
#if SIZEOF_SCM_T_BITS > 4
|
||||
#if SIZEOF_UINTPTR_T > 4
|
||||
/* vector lengths are stored in the first word of vectors, shifted by
|
||||
8 bits for the tc8, so for 32-bit we only get 2^24-1 = 16777215
|
||||
elements. But we allow a few more sizes for 64-bit. */
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
/* This file contains the loader for Guile's on-disk format: ELF with
|
||||
some custom tags in the dynamic segment. */
|
||||
|
||||
#if SIZEOF_SCM_T_BITS == 4
|
||||
#if SIZEOF_UINTPTR_T == 4
|
||||
#define Elf_Half Elf32_Half
|
||||
#define Elf_Word Elf32_Word
|
||||
#define Elf_Ehdr Elf32_Ehdr
|
||||
#define ELFCLASS ELFCLASS32
|
||||
#define Elf_Phdr Elf32_Phdr
|
||||
#define Elf_Dyn Elf32_Dyn
|
||||
#elif SIZEOF_SCM_T_BITS == 8
|
||||
#elif SIZEOF_UINTPTR_T == 8
|
||||
#define Elf_Half Elf64_Half
|
||||
#define Elf_Word Elf64_Word
|
||||
#define Elf_Ehdr Elf64_Ehdr
|
||||
|
|
|
@ -181,8 +181,8 @@ SCM_DEFINE (scm_inet_makeaddr, "inet-makeaddr", 2, 0, 0,
|
|||
#endif
|
||||
|
||||
|
||||
#if (SIZEOF_SCM_T_BITS * SCM_CHAR_BIT) > 128
|
||||
#error "Assumption that scm_t_bits <= 128 bits has been violated."
|
||||
#if (SIZEOF_UINTPTR_T * SCM_CHAR_BIT) > 128
|
||||
#error "Assumption that uintptr_t <= 128 bits has been violated."
|
||||
#endif
|
||||
|
||||
#if (SIZEOF_UNSIGNED_LONG * SCM_CHAR_BIT) > 128
|
||||
|
|
|
@ -1589,7 +1589,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
|
|||
scm_t_bits val;
|
||||
|
||||
UNPACK_24 (op, dst);
|
||||
#if SIZEOF_SCM_T_BITS > 4
|
||||
#if SIZEOF_UINTPTR_T > 4
|
||||
val = ip[1];
|
||||
val <<= 32;
|
||||
val |= ip[2];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue