guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 02/86: More _scm.h refactoring


From: Andy Wingo
Subject: [Guile-commits] 02/86: More _scm.h refactoring
Date: Wed, 20 Jun 2018 14:09:27 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 5159a1530671821f785c1726e52aa9208c2e636f
Author: Andy Wingo <address@hidden>
Date:   Sun Jun 17 19:10:52 2018 +0200

    More _scm.h refactoring
    
    * libguile/foreign.c (ROUND_UP): Copy here.
    * libguile/vm.c (SCM_NOINLINE): Move here, to the only file that uses
      it.
      (ROUND_UP): Copy here.
    * libguile/_scm.h (ROUND_UP, SCM_NOINLINE): Remove.  Centralizing
      private definitions isn't bad, but _scm.h also includes a bunch of
      Guile API as well, and the include itself is poorly named.
---
 libguile/_scm.h    | 12 ------------
 libguile/foreign.c |  5 +++++
 libguile/vm.c      | 11 +++++++++++
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/libguile/_scm.h b/libguile/_scm.h
index cf89f2b..f5a07d2 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -89,18 +89,6 @@
 #include "libguile/strings.h"
 
 
-/* Return the first integer greater than or equal to LEN such that
-   LEN % ALIGN == 0.  Return LEN if ALIGN is zero.  */
-#define ROUND_UP(len, align)                                   \
-  ((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
-
-#if (defined __GNUC__)
-# define SCM_NOINLINE __attribute__ ((__noinline__))
-#else
-# define SCM_NOINLINE /* noinline */
-#endif
-
-
 #endif  /* SCM__SCM_H */
 
 /*
diff --git a/libguile/foreign.c b/libguile/foreign.c
index 67c7d41..ab7524e 100644
--- a/libguile/foreign.c
+++ b/libguile/foreign.c
@@ -44,6 +44,11 @@
 
 
 
+/* Return the first integer greater than or equal to LEN such that
+   LEN % ALIGN == 0.  Return LEN if ALIGN is zero.  */
+#define ROUND_UP(len, align)                                   \
+  ((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
+
 SCM_SYMBOL (sym_void, "void");
 SCM_SYMBOL (sym_float, "float");
 SCM_SYMBOL (sym_double, "double");
diff --git a/libguile/vm.c b/libguile/vm.c
index a5e7214..76288cd 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -59,6 +59,12 @@
 #include "libguile/vm.h"
 #include "libguile/vm-builtins.h"
 
+#if (defined __GNUC__)
+# define SCM_NOINLINE __attribute__ ((__noinline__))
+#else
+# define SCM_NOINLINE /* noinline */
+#endif
+
 static int vm_default_engine = SCM_VM_REGULAR_ENGINE;
 
 /* Unfortunately we can't snarf these: snarfed things are only loaded up from
@@ -240,6 +246,11 @@ static void vm_dispatch_pop_continuation_hook
 static void vm_dispatch_next_hook (struct scm_vm *vp) SCM_NOINLINE;
 static void vm_dispatch_abort_hook (struct scm_vm *vp) SCM_NOINLINE;
 
+/* Return the first integer greater than or equal to LEN such that
+   LEN % ALIGN == 0.  Return LEN if ALIGN is zero.  */
+#define ROUND_UP(len, align)                                   \
+  ((align) ? (((len) - 1UL) | ((align) - 1UL)) + 1UL : (len))
+
 static void
 vm_dispatch_hook (struct scm_vm *vp, int hook_num,
                   union scm_vm_stack_element *argv, int n)



reply via email to

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