[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)
- [Guile-commits] branch master updated (f84ce54 -> 1234bb1), Andy Wingo, 2018/06/20
- [Guile-commits] 02/86: More _scm.h refactoring,
Andy Wingo <=
- [Guile-commits] 06/86: Remove _scm.h inclusion of config.h, Andy Wingo, 2018/06/20
- [Guile-commits] 09/86: Remove alignof.h inclusion from _scm.h, Andy Wingo, 2018/06/20
- [Guile-commits] 03/86: Remove _scm hack to undefine HAVE_STRUCT_TIMESPEC, Andy Wingo, 2018/06/20
- [Guile-commits] 04/86: Refactor regarding internal detection of ia64, Andy Wingo, 2018/06/20
- [Guile-commits] 08/86: Remove _scm.h verify.h inclusion, Andy Wingo, 2018/06/20
- [Guile-commits] 07/86: Remove errno.h include from _scm.h., Andy Wingo, 2018/06/20
- [Guile-commits] 11/86: Require C99 to build Guile, Andy Wingo, 2018/06/20
- [Guile-commits] 01/86: Move syscall-related private defines to their own header, Andy Wingo, 2018/06/20
- [Guile-commits] 19/86: Remove public SCM_VALIDATE_NIM, Andy Wingo, 2018/06/20
- [Guile-commits] 17/86: Remove unused macros, Andy Wingo, 2018/06/20