guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-3-55-gb25


From: Neil Jerram
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-3-55-gb25aa0b
Date: Fri, 02 Oct 2009 21:21:07 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b25aa0b9373d2798469e0fe999cd915e8beedc4f

The branch, master has been updated
       via  b25aa0b9373d2798469e0fe999cd915e8beedc4f (commit)
      from  0eb934f1f0e4d607a13cb918f062054556e9694b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b25aa0b9373d2798469e0fe999cd915e8beedc4f
Author: Neil Jerram <address@hidden>
Date:   Fri Oct 2 22:18:52 2009 +0100

    Change dynwind flag enums to #defines, for greater portability
    
    Thanks to Inge Gutheil for raising this problem.
    
    * doc/ref/api-control.texi (Dynamic Wind): Remove doc for
      scm_t_dynwind_flags, and change uses of scm_t_dynwind_flags to int.
      Mention possible flags inside doc for scm_dynwind_begin instead.
      Similarly for scm_t_wind_flags.  In this case the doc on possible
      flags is moved to after the four functions that can use them.
    
    * libguile/dynwind.c (scm_dynwind_begin): Change scm_t_dynwind_flags
      to int.
      (scm_dynwind_unwind_handler): Change scm_t_wind_flags to int.
      (scm_dynwind_rewind_handler): Ditto.
      (scm_dynwind_unwind_handler_with_scm): Ditto.
      (scm_dynwind_rewind_handler_with_scm): Ditto.
    
    * libguile/dynwind.h (SCM_F_DYNWIND_REWINDABLE): Use #define instead
      of typedef enum.
      (SCM_F_WIND_EXPLICITLY): Ditto.
      (function declarations): Change scm_t_dynwind_flags and
      scm_t_wind_flags to int.
    
    * test-suite/standalone/test-unwind.c (check_cont_body): Change
      scm_t_dynwind_flags to int.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/api-control.texi            |   55 ++++++++++++++---------------------
 libguile/dynwind.c                  |   14 +++------
 libguile/dynwind.h                  |   25 ++++++---------
 test-suite/standalone/test-unwind.c |    2 +-
 4 files changed, 38 insertions(+), 58 deletions(-)

diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi
index 66fb99e..429dcaa 100644
--- a/doc/ref/api-control.texi
+++ b/doc/ref/api-control.texi
@@ -1276,21 +1276,7 @@ a-cont
 @end lisp
 @end deffn
 
address@hidden {C Type} scm_t_dynwind_flags
-This is an enumeration of several flags that modify the behavior of
address@hidden  The flags are listed in the following
-table.
-
address@hidden @code
address@hidden SCM_F_DYNWIND_REWINDABLE
-The dynamic context is @dfn{rewindable}.  This means that it can be
-reentered non-locally (via the invokation of a continuation).  The
-default is that a dynwind context can not be reentered non-locally.
address@hidden table
-
address@hidden deftp
-
address@hidden {C Function} void scm_dynwind_begin (scm_t_dynwind_flags flags)
address@hidden {C Function} void scm_dynwind_begin (int flags)
 The function @code{scm_dynwind_begin} starts a new dynamic context and
 makes it the `current' one.
 
@@ -1315,6 +1301,14 @@ or explicitly with @code{scm_dynwind_end}.  You must 
make sure that a
 dynwind context is indeed ended properly.  If you fail to call
 @code{scm_dynwind_end} for each @code{scm_dynwind_begin}, the behavior
 is undefined.
+
+Possible flags are:
address@hidden @code
address@hidden SCM_F_DYNWIND_REWINDABLE
+The dynamic context is @dfn{rewindable}.  This means that it can be
+reentered non-locally (via the invokation of a continuation).  The
+default is that a dynwind context can not be reentered non-locally.
address@hidden table
 @end deftypefn
 
 @deftypefn {C Function} void scm_dynwind_end ()
@@ -1322,22 +1316,8 @@ End the current dynamic context explicitly and make the 
previous one
 current.
 @end deftypefn
 
address@hidden {C Type} scm_t_wind_flags
-This is an enumeration of several flags that modify the behavior of
address@hidden and
address@hidden  The flags are listed in the
-following table.
-
address@hidden @code
address@hidden SCM_F_WIND_EXPLICITLY
address@hidden SCM_F_WIND_EXPLICITLY
-The registered action is also carried out when the dynwind context is
-entered or left locally.
address@hidden table
address@hidden deftp
-
address@hidden {C Function} void scm_dynwind_unwind_handler (void (*func)(void 
*), void *data, scm_t_wind_flags flags)
address@hidden {C Function} void scm_dynwind_unwind_handler_with_scm (void 
(*func)(SCM), SCM data, scm_t_wind_flags flags)
address@hidden {C Function} void scm_dynwind_unwind_handler (void (*func)(void 
*), void *data, int flags)
address@hidden {C Function} void scm_dynwind_unwind_handler_with_scm (void 
(*func)(SCM), SCM data, int flags)
 Arranges for @var{func} to be called with @var{data} as its arguments
 when the current context ends implicitly.  If @var{flags} contains
 @code{SCM_F_WIND_EXPLICITLY}, @var{func} is also called when the
@@ -1347,8 +1327,8 @@ The function @code{scm_dynwind_unwind_handler_with_scm} 
takes care that
 @var{data} is protected from garbage collection.
 @end deftypefn
 
address@hidden {C Function} void scm_dynwind_rewind_handler (void (*func)(void 
*), void *data, scm_t_wind_flags flags)
address@hidden {C Function} void scm_dynwind_rewind_handler_with_scm (void 
(*func)(SCM), SCM data, scm_t_wind_flags flags)
address@hidden {C Function} void scm_dynwind_rewind_handler (void (*func)(void 
*), void *data, int flags)
address@hidden {C Function} void scm_dynwind_rewind_handler_with_scm (void 
(*func)(SCM), SCM data, int flags)
 Arrange for @var{func} to be called with @var{data} as its argument when
 the current context is restarted by rewinding the stack.  When @var{flags}
 contains @code{SCM_F_WIND_EXPLICITLY}, @var{func} is called immediately
@@ -1358,6 +1338,15 @@ The function @code{scm_dynwind_rewind_handler_with_scm} 
takes care that
 @var{data} is protected from garbage collection.
 @end deftypefn
 
+The possible flags for the preceding four functions are as follows.
+
address@hidden @code
address@hidden SCM_F_WIND_EXPLICITLY
address@hidden SCM_F_WIND_EXPLICITLY
+The registered action is also carried out when the dynwind context is
+entered or left locally.
address@hidden table
+
 @deftypefn {C Function} void scm_dynwind_free (void *mem)
 Arrange for @var{mem} to be freed automatically whenever the current
 context is exited, whether normally or non-locally.
diff --git a/libguile/dynwind.c b/libguile/dynwind.c
index b34f9be..8e87f60 100644
--- a/libguile/dynwind.c
+++ b/libguile/dynwind.c
@@ -154,7 +154,7 @@ static scm_t_bits tc16_winder;
 #define WINDER_MARK_P(w)     (SCM_SMOB_FLAGS(w) & WINDER_F_MARK)
 
 void
-scm_dynwind_begin (scm_t_dynwind_flags flags)
+scm_dynwind_begin (int flags)
 {
   SCM f;
   SCM_NEWSMOB (f, tc16_frame, 0);
@@ -192,8 +192,7 @@ scm_dynwind_end (void)
 }
 
 void
-scm_dynwind_unwind_handler (void (*proc) (void *), void *data,
-                           scm_t_wind_flags flags)
+scm_dynwind_unwind_handler (void (*proc) (void *), void *data, int flags)
 {
   SCM w;
   SCM_NEWSMOB2 (w, tc16_winder,        (scm_t_bits) proc, (scm_t_bits) data);
@@ -203,8 +202,7 @@ scm_dynwind_unwind_handler (void (*proc) (void *), void 
*data,
 }
 
 void
-scm_dynwind_rewind_handler (void (*proc) (void *), void *data,
-                           scm_t_wind_flags flags)
+scm_dynwind_rewind_handler (void (*proc) (void *), void *data, int flags)
 {
   SCM w;
   SCM_NEWSMOB2 (w, tc16_winder,        (scm_t_bits) proc, (scm_t_bits) data);
@@ -215,8 +213,7 @@ scm_dynwind_rewind_handler (void (*proc) (void *), void 
*data,
 }
 
 void
-scm_dynwind_unwind_handler_with_scm (void (*proc) (SCM), SCM data,
-                                    scm_t_wind_flags flags)
+scm_dynwind_unwind_handler_with_scm (void (*proc) (SCM), SCM data, int flags)
 {
   SCM w;
   scm_t_bits fl = ((flags&SCM_F_WIND_EXPLICITLY)? WINDER_F_EXPLICIT : 0);
@@ -226,8 +223,7 @@ scm_dynwind_unwind_handler_with_scm (void (*proc) (SCM), 
SCM data,
 }
 
 void
-scm_dynwind_rewind_handler_with_scm (void (*proc) (SCM), SCM data,
-                                    scm_t_wind_flags flags)
+scm_dynwind_rewind_handler_with_scm (void (*proc) (SCM), SCM data, int flags)
 {
   SCM w;
   SCM_NEWSMOB2 (w, tc16_winder, (scm_t_bits) proc, SCM_UNPACK (data));
diff --git a/libguile/dynwind.h b/libguile/dynwind.h
index b178bc4..a820990 100644
--- a/libguile/dynwind.h
+++ b/libguile/dynwind.h
@@ -43,26 +43,21 @@ SCM_INTERNAL void scm_init_dynwind (void);
 
 SCM_API void scm_swap_bindings (SCM vars, SCM vals);
 
-typedef enum {
-  SCM_F_DYNWIND_REWINDABLE = (1 << 0)
-} scm_t_dynwind_flags;
+/* Flags for scm_dynwind_begin. */
+#define SCM_F_DYNWIND_REWINDABLE 1
 
-typedef enum {
-  SCM_F_WIND_EXPLICITLY = (1 << 0)
-} scm_t_wind_flags;
+/* Flags for scm_dynwind_unwind_handler(_with_scm) and
+   scm_dynwind_rewind_handler(_with_scm). */
+#define SCM_F_WIND_EXPLICITLY 1
 
-SCM_API void scm_dynwind_begin (scm_t_dynwind_flags);
+SCM_API void scm_dynwind_begin (int);
 SCM_API void scm_dynwind_end (void);
 
-SCM_API void scm_dynwind_unwind_handler (void (*func) (void *), void *data,
-                                        scm_t_wind_flags);
-SCM_API void scm_dynwind_rewind_handler (void (*func) (void *), void *data,
-                                        scm_t_wind_flags);
+SCM_API void scm_dynwind_unwind_handler (void (*) (void *), void *, int);
+SCM_API void scm_dynwind_rewind_handler (void (*) (void *), void *, int);
 
-SCM_API void scm_dynwind_unwind_handler_with_scm (void (*func) (SCM), SCM data,
-                                                 scm_t_wind_flags);
-SCM_API void scm_dynwind_rewind_handler_with_scm (void (*func) (SCM), SCM data,
-                                                 scm_t_wind_flags);
+SCM_API void scm_dynwind_unwind_handler_with_scm (void (*) (SCM), SCM, int);
+SCM_API void scm_dynwind_rewind_handler_with_scm (void (*) (SCM), SCM, int);
 
 SCM_API void scm_dynwind_free (void *mem);
 
diff --git a/test-suite/standalone/test-unwind.c 
b/test-suite/standalone/test-unwind.c
index 2b0291d..e930637 100644
--- a/test-suite/standalone/test-unwind.c
+++ b/test-suite/standalone/test-unwind.c
@@ -136,7 +136,7 @@ check_flag1 (const char *tag, void (*func)(void), int val)
 SCM
 check_cont_body (void *data)
 {
-  scm_t_dynwind_flags flags = (data? SCM_F_DYNWIND_REWINDABLE : 0);
+  int flags = (data? SCM_F_DYNWIND_REWINDABLE : 0);
   int first;
   SCM val;
 


hooks/post-receive
-- 
GNU Guile




reply via email to

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