guile-commits
[Top][All Lists]
Advanced

[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)), \



reply via email to

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