[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 18/86: Move list validators to list.h
From: |
Andy Wingo |
Subject: |
[Guile-commits] 18/86: Move list validators to list.h |
Date: |
Wed, 20 Jun 2018 14:09:30 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 82d56628878ad414af5175caf98ae62129bff254
Author: Andy Wingo <address@hidden>
Date: Sun Jun 17 22:38:18 2018 +0200
Move list validators to list.h
* libguile/validate.h:
* libguile/list.h (SCM_VALIDATE_REST_ARGUMENT, SCM_VALIDATE_LIST)
SCM_VALIDATE_NONEMPTYLIST, SCM_VALIDATE_LIST_COPYLEN)
SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Move here from validate.h.
---
libguile/list.h | 36 +++++++++++++++++++++++++++++++++++-
libguile/validate.h | 33 ---------------------------------
2 files changed, 35 insertions(+), 34 deletions(-)
diff --git a/libguile/list.h b/libguile/list.h
index 238926e..c5813e9 100644
--- a/libguile/list.h
+++ b/libguile/list.h
@@ -3,7 +3,7 @@
#ifndef SCM_LIST_H
#define SCM_LIST_H
-/* Copyright (C) 1995,1996,1997,2000,2001,2003,2004,2005,2006,2008,2009
+/* Copyright (C) 1995-1997,2000-2001,2003-2006,2008-2009,2018
* Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -71,6 +71,40 @@ SCM_API SCM scm_copy_tree (SCM obj);
+#define SCM_VALIDATE_REST_ARGUMENT(x) \
+ do { \
+ if (SCM_DEBUG_REST_ARGUMENT) { \
+ if (scm_ilength (x) < 0) { \
+ SCM_MISC_ERROR ("Rest arguments do not form a proper list.", SCM_EOL);
\
+ } \
+ } \
+ } while (0)
+
+#define SCM_VALIDATE_LIST(pos, lst) \
+ do { \
+ SCM_ASSERT (scm_ilength (lst) >= 0, lst, pos, FUNC_NAME); \
+ } while (0)
+
+#define SCM_VALIDATE_NONEMPTYLIST(pos, lst) \
+ do { \
+ SCM_ASSERT (scm_ilength (lst) > 0, lst, pos, FUNC_NAME); \
+ } while (0)
+
+#define SCM_VALIDATE_LIST_COPYLEN(pos, lst, cvar) \
+ do { \
+ cvar = scm_ilength (lst); \
+ SCM_ASSERT (cvar >= 0, lst, pos, FUNC_NAME); \
+ } while (0)
+
+#define SCM_VALIDATE_NONEMPTYLIST_COPYLEN(pos, lst, cvar) \
+ do { \
+ cvar = scm_ilength (lst); \
+ SCM_ASSERT (cvar >= 1, lst, pos, FUNC_NAME); \
+ } while (0)
+
+
+
+
/* Guile internal functions */
SCM_INTERNAL SCM scm_i_finite_list_copy (SCM /* a list known to be finite */);
diff --git a/libguile/validate.h b/libguile/validate.h
index 08fcb92..cb15622 100644
--- a/libguile/validate.h
+++ b/libguile/validate.h
@@ -31,17 +31,6 @@
-
-
-#define SCM_VALIDATE_REST_ARGUMENT(x) \
- do { \
- if (SCM_DEBUG_REST_ARGUMENT) { \
- if (scm_ilength (x) < 0) { \
- SCM_MISC_ERROR ("Rest arguments do not form a proper list.", SCM_EOL);
\
- } \
- } \
- } while (0)
-
#define SCM_VALIDATE_NIM(pos, scm) SCM_MAKE_VALIDATE_MSG (pos, scm, NIMP,
"non-immediate")
#define SCM_VALIDATE_BOOL(pos, flag) \
@@ -86,28 +75,6 @@
SCM_I_MAKE_VALIDATE_MSG2 (pos, scm, scm_is_mutable_pair, "mutable pair")
#endif /* BUILDING_LIBGUILE */
-#define SCM_VALIDATE_LIST(pos, lst) \
- do { \
- SCM_ASSERT (scm_ilength (lst) >= 0, lst, pos, FUNC_NAME); \
- } while (0)
-
-#define SCM_VALIDATE_NONEMPTYLIST(pos, lst) \
- do { \
- SCM_ASSERT (scm_ilength (lst) > 0, lst, pos, FUNC_NAME); \
- } while (0)
-
-#define SCM_VALIDATE_LIST_COPYLEN(pos, lst, cvar) \
- do { \
- cvar = scm_ilength (lst); \
- SCM_ASSERT (cvar >= 0, lst, pos, FUNC_NAME); \
- } while (0)
-
-#define SCM_VALIDATE_NONEMPTYLIST_COPYLEN(pos, lst, cvar) \
- do { \
- cvar = scm_ilength (lst); \
- SCM_ASSERT (cvar >= 1, lst, pos, FUNC_NAME); \
- } while (0)
-
#define SCM_VALIDATE_ALISTCELL(pos, alist) \
do { \
SCM_ASSERT (scm_is_pair (alist) && scm_is_pair (SCM_CAR (alist)), \
- [Guile-commits] 01/86: Move syscall-related private defines to their own header, (continued)
- [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
- [Guile-commits] 10/86: Assume that if we have GCC, we have GCC >= 3.0., Andy Wingo, 2018/06/20
- [Guile-commits] 05/86: Inline definition of SIZEOF_SCM_T_BITS, Andy Wingo, 2018/06/20
- [Guile-commits] 13/86: Remove _scm.h print.h include, Andy Wingo, 2018/06/20
- [Guile-commits] 15/86: Move number validators to numbers.h., Andy Wingo, 2018/06/20
- [Guile-commits] 16/86: Move more number validators to numbers.h., Andy Wingo, 2018/06/20
- [Guile-commits] 24/86: Deprecate libguile/validate.h, Andy Wingo, 2018/06/20
- [Guile-commits] 14/86: Move core validate macros to error.h, Andy Wingo, 2018/06/20
- [Guile-commits] 18/86: Move list validators to list.h,
Andy Wingo <=
- [Guile-commits] 31/86: Remove gc.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 32/86: Remove threads.h from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 12/86: Remove error.h include from _scm.h., Andy Wingo, 2018/06/20
- [Guile-commits] 20/86: Move pair, null, nil, and boolean validators out of validate.h, Andy Wingo, 2018/06/20
- [Guile-commits] 29/86: Move gsubr.h include to snarf.h, Andy Wingo, 2018/06/20
- [Guile-commits] 33/86: Move array-handle.h include out from inline.h, Andy Wingo, 2018/06/20
- [Guile-commits] 30/86: Devolve procs.h include from _scm.h., Andy Wingo, 2018/06/20
- [Guile-commits] 36/86: Remove threads.h include from ports.h, Andy Wingo, 2018/06/20
- [Guile-commits] 28/86: Devolve gc.h, Andy Wingo, 2018/06/20
- [Guile-commits] 35/86: Move struct.h include out of ports.h, Andy Wingo, 2018/06/20