guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 05/86: Inline definition of SIZEOF_SCM_T_BITS


From: Andy Wingo
Subject: [Guile-commits] 05/86: Inline definition of SIZEOF_SCM_T_BITS
Date: Wed, 20 Jun 2018 14:09:27 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 7b4ab0895b51f21d9f15581d2407861bac986231
Author: Andy Wingo <address@hidden>
Date:   Sun Jun 17 19:21:42 2018 +0200

    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.
---
 libguile/_scm.h            | 3 ---
 libguile/conv-integer.i.c  | 4 ++--
 libguile/conv-uinteger.i.c | 2 +-
 libguile/gc.c              | 2 +-
 libguile/hashtab.c         | 2 +-
 libguile/loader.c          | 4 ++--
 libguile/socket.c          | 4 ++--
 libguile/vm-engine.c       | 2 +-
 8 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/libguile/_scm.h b/libguile/_scm.h
index 87ae34b..ce43502 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -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>
diff --git a/libguile/conv-integer.i.c b/libguile/conv-integer.i.c
index 0aa81dc..2a020b3 100644
--- a/libguile/conv-integer.i.c
+++ b/libguile/conv-integer.i.c
@@ -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))
diff --git a/libguile/conv-uinteger.i.c b/libguile/conv-uinteger.i.c
index f62dc41..2414b74 100644
--- a/libguile/conv-uinteger.i.c
+++ b/libguile/conv-uinteger.i.c
@@ -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))
diff --git a/libguile/gc.c b/libguile/gc.c
index cf81b3c..0551e9c 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -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:
  */
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index 095ebca..e675d6a 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -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. */
diff --git a/libguile/loader.c b/libguile/loader.c
index 0d427b5..df90648 100644
--- a/libguile/loader.c
+++ b/libguile/loader.c
@@ -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
diff --git a/libguile/socket.c b/libguile/socket.c
index 7f21a59..52f4ca1 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -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
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 71dad53..64deb96 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -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];



reply via email to

[Prev in Thread] Current Thread [Next in Thread]