OSSP CVS Repository

ossp - Check-in [3101]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3101
Date: 2003-Jan-30 11:59:34 (local)
2003-Jan-30 10:59:34 (UTC)
User:rse
Branch:
Comment: Fixed the implementation of the ex_cleanup clause.

Submitted by: A Makarov <makarov@tecon.ru>

Tickets:
Inspections:
Files:
ossp-pkg/ex/ChangeLog      1.5 -> 1.6     3 inserted, 0 deleted
ossp-pkg/ex/ex.h      1.19 -> 1.20     5 inserted, 7 deleted

ossp-pkg/ex/ChangeLog 1.5 -> 1.6

--- ChangeLog    2003/01/30 10:23:12     1.5
+++ ChangeLog    2003/01/30 10:59:34     1.6
@@ -16,6 +16,9 @@
    *) Polished and enhanced the manual page ex(3).
       [Ralf S. Engelschall]
 
+   *) Fixed the implementation of the ex_cleanup clause.
+      [A Makarov <makarov@tecon.ru>]
+
   Changes between 1.0.0 and 1.0.1 (08-Mar-2002 to 06-Jan-2003)
 
    *) Adjusted copyright messages to include new year 2003.


ossp-pkg/ex/ex.h 1.19 -> 1.20

--- ex.h 2003/01/06 15:31:24     1.19
+++ ex.h 2003/01/30 10:59:34     1.20
@@ -100,13 +100,12 @@
     int           ctx_shielding;/* permanent counter of exception shielding level */
     int           ctx_shield;   /* temporary flag for exception shielding macro */
     int           ctx_caught;   /* temporary flag whether exception was caught */
-    int           ctx_cleanup;  /* temporary flag whether cleanup block was present */
     volatile ex_t ctx_ex;       /* temporary exception storage */
 } ex_ctx_t;
 
 /* the static and dynamic initializers for a context structure */
 #define EX_CTX_INITIALIZER \
-    { NULL, 0, 0, 0, 0, 0, 0, 0, { NULL, NULL, NULL, NULL, 0, NULL } }
+    { NULL, 0, 0, 0, 0, 0, 0, { NULL, NULL, NULL, NULL, 0, NULL } }
 #define EX_CTX_INITIALIZE(ctx) \
     do { \
         (ctx)->ctx_mctx         = NULL; \
@@ -116,7 +115,6 @@
         (ctx)->ctx_shielding    = 0;    \
         (ctx)->ctx_shield       = 0;    \
         (ctx)->ctx_caught       = 0;    \
-        (ctx)->ctx_cleanup      = 0;    \
         (ctx)->ctx_ex.ex_class  = NULL; \
         (ctx)->ctx_ex.ex_object = NULL; \
         (ctx)->ctx_ex.ex_value  = NULL; \
@@ -139,11 +137,11 @@
 #define ex_try \
     { \
         ex_ctx_t *__ex_ctx_ptr = __ex_ctx(); \
+        int __ex_cleanup = 0; \
         __ex_mctx_t *__ex_mctx_en; \
         __ex_mctx_t __ex_mctx_me; \
         __ex_mctx_en = __ex_ctx_ptr->ctx_mctx; \
         __ex_ctx_ptr->ctx_mctx = &__ex_mctx_me; \
-        __ex_ctx_ptr->ctx_cleanup = 0; \
         if (__ex_mctx_save(&__ex_mctx_me)) { \
             if (1)
 
@@ -158,7 +156,7 @@
             __ex_ctx_ptr->ctx_caught = 1; \
         } \
         __ex_ctx_ptr->ctx_mctx = __ex_mctx_en; \
-        __ex_ctx()->ctx_cleanup = 1; \
+        __ex_cleanup = 1; \
         if (1) { \
             if (1)
 
@@ -166,11 +164,11 @@
 #define ex_catch(e) \
             else { \
             } \
-            if (!(__ex_ctx()->ctx_cleanup)) \
+            if (!(__ex_cleanup)) \
                 __ex_ctx_ptr->ctx_caught = 0; \
         } \
         else { \
-            if (!(__ex_ctx()->ctx_cleanup)) { \
+            if (!(__ex_cleanup)) { \
                 __ex_mctx_restored(&__ex_mctx_me); \
                 __ex_ctx_ptr->ctx_caught = 1; \
             } \

CVSTrac 2.0.1