Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename CLEANUP macro into _CLEANUP for Supernovae mode.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 23 Sep 2010 09:51:29 +0000 (09:51 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 23 Sep 2010 09:51:29 +0000 (09:51 +0000)
There were two definition of CLEANUP.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8205 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/ex.h
src/ex_unit.c
src/gras/DataDesc/ddt_exchange.c
src/xbt/dict_multi.c
src/xbt/ex.c

index 985526c..8530762 100644 (file)
@@ -140,7 +140,7 @@ __ex_mctx_struct} __ex_mctx_t;
  *
  * @section XBT_ex_base BASIC USAGE
  *
  *
  * @section XBT_ex_base BASIC USAGE
  *
- * \em TRY \b TRIED_BLOCK [\em CLEANUP \b CLEANUP_BLOCK] \em CATCH (variable) \b CATCH_BLOCK
+ * \em TRY \b TRIED_BLOCK [\em _CLEANUP \b _CLEANUP_BLOCK] \em CATCH (variable) \b CATCH_BLOCK
  *
  * This is the primary syntactical construct provided. It is modeled after the
  * ISO-C++ try-catch clause and should sound familiar to most of you.
  *
  * This is the primary syntactical construct provided. It is modeled after the
  * ISO-C++ try-catch clause and should sound familiar to most of you.
@@ -153,7 +153,7 @@ __ex_mctx_struct} __ex_mctx_t;
  *
  * 
  * In absence of exception, the control flow goes into the blocks TRIED_BLOCK
  *
  * 
  * In absence of exception, the control flow goes into the blocks TRIED_BLOCK
- * and CLEANUP_BLOCK (if present); The CATCH_BLOCK block is then ignored. 
+ * and CLEANUP_BLOCK (if present); The CATCH_BLOCK block is then ignored.
  *
  * When an exception is thrown, the control flow goes through the following
  * blocks: TRIED_BLOCK (up to the statement throwing the exception),
  *
  * When an exception is thrown, the control flow goes through the following
  * blocks: TRIED_BLOCK (up to the statement throwing the exception),
@@ -360,10 +360,10 @@ XBT_PUBLIC_DATA(ex_term_cb_t) __xbt_ex_terminate;
         if (__ex_mctx_save(&__ex_mctx_me)) { \
             if (1)
 
         if (__ex_mctx_save(&__ex_mctx_me)) { \
             if (1)
 
-/** @brief optional(!) block for cleanup 
+/** @brief optional(!) block for cleanup
  *  @hideinitializer
  */
  *  @hideinitializer
  */
-#define CLEANUP \
+#define _CLEANUP \
             else { \
             } \
             __xbt_ex_ctx_ptr->ctx_caught = 0; \
             else { \
             } \
             __xbt_ex_ctx_ptr->ctx_caught = 0; \
@@ -422,7 +422,7 @@ XBT_PUBLIC_DATA(ex_term_cb_t) __xbt_ex_terminate;
  *
  * If called from within a TRY/CATCH construct, this exception 
  * is copied into the CATCH relevant variable program control flow 
  *
  * If called from within a TRY/CATCH construct, this exception 
  * is copied into the CATCH relevant variable program control flow 
- * is derouted to the CATCH (after the optional sg_cleanup). 
+ * is derouted to the CATCH (after the optional sg_cleanup).
  *
  * If no TRY/CATCH construct embeeds this call, the program calls
  * abort(3). 
  *
  * If no TRY/CATCH construct embeeds this call, the program calls
  * abort(3). 
index cf14ddf..9f8f51a 100644 (file)
@@ -118,7 +118,7 @@ XBT_TEST_UNIT("cleanup", test_cleanup, "cleanup handling")
   TRY {
     v1 = 5678;
     THROW0(1, 2, "blah");
   TRY {
     v1 = 5678;
     THROW0(1, 2, "blah");
-  } CLEANUP {
+  } _CLEANUP {
     if (v1 != 5678)
       xbt_test_fail1("v1 = %d (!= 5678)", v1);
     c = 1;
     if (v1 != 5678)
       xbt_test_fail1("v1 = %d (!= 5678)", v1);
     c = 1;
@@ -166,7 +166,7 @@ static void bad_example(void)
     cp3 = mallocex(SMALLAMOUNT);
     strcpy(cp1, "foo");
     strcpy(cp2, "bar");
     cp3 = mallocex(SMALLAMOUNT);
     strcpy(cp1, "foo");
     strcpy(cp2, "bar");
-  } CLEANUP {
+  } _CLEANUP {
     if (cp3 != NULL)
       free(cp3);
     if (cp2 != NULL)
     if (cp3 != NULL)
       free(cp3);
     if (cp2 != NULL)
@@ -203,7 +203,7 @@ static void good_example(void)
       cp3 = mallocex(SMALLAMOUNT);
       strcpy(cp1, "foo");
       strcpy(cp2, "bar");
       cp3 = mallocex(SMALLAMOUNT);
       strcpy(cp1, "foo");
       strcpy(cp2, "bar");
-    } CLEANUP {                 /*04 */
+    } _CLEANUP {                 /*04 */
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
       if (cp3 != NULL)
         free(cp3);
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
       if (cp3 != NULL)
         free(cp3);
index cecbcf8..b61f7f8 100644 (file)
@@ -387,10 +387,8 @@ int gras_datadesc_memcpy(gras_datadesc_type_t type, void *src, void *dst)
   }
 
   TRY {
   }
 
   TRY {
-    size =
-      gras_datadesc_memcpy_rec(state, refs, type, (char *) src, (char *) dst,
-                               0, type->cycle);
-  } CLEANUP {
+    size = gras_datadesc_memcpy_rec(state, refs, type, (char *) src, (char *) dst,0, type->cycle);
+  } _CLEANUP {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
@@ -627,7 +625,7 @@ void gras_datadesc_send(gras_socket_t sock,
   TRY {
     gras_datadesc_send_rec(sock, state, refs, type, (char *) src,
                            type->cycle);
   TRY {
     gras_datadesc_send_rec(sock, state, refs, type, (char *) src,
                            type->cycle);
-  } CLEANUP {
+  } _CLEANUP {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
@@ -962,7 +960,7 @@ gras_datadesc_recv(gras_socket_t sock,
   TRY {
     gras_datadesc_recv_rec(sock, state, refs, type,
                            r_arch, NULL, 0, (char *) dst, -1, type->cycle);
   TRY {
     gras_datadesc_recv_rec(sock, state, refs, type,
                            r_arch, NULL, 0, (char *) dst, -1, type->cycle);
-  } CLEANUP {
+  } _CLEANUP {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
index 93e0104..f39e4e3 100644 (file)
@@ -94,7 +94,7 @@ xbt_multidict_set(xbt_dict_t mdict,
 
   TRY {
     xbt_multidict_set_ext(mdict, keys, lens, data, free_ctn);
 
   TRY {
     xbt_multidict_set_ext(mdict, keys, lens, data, free_ctn);
-  } CLEANUP {
+  } _CLEANUP {
     xbt_dynar_free(&lens);
   } CATCH(e) {
     RETHROW;
     xbt_dynar_free(&lens);
   } CATCH(e) {
     RETHROW;
@@ -229,7 +229,7 @@ void xbt_multidict_remove(xbt_dict_t mdict, xbt_dynar_t keys)
 
   TRY {
     xbt_multidict_remove_ext(mdict, keys, lens);
 
   TRY {
     xbt_multidict_remove_ext(mdict, keys, lens);
-  } CLEANUP {
+  } _CLEANUP {
     xbt_dynar_free(&lens);
   } CATCH(e) {
     RETHROW;
     xbt_dynar_free(&lens);
   } CATCH(e) {
     RETHROW;
index a3c5a8b..450f7ba 100644 (file)
@@ -337,7 +337,7 @@ XBT_TEST_UNIT("cleanup", test_cleanup, "cleanup handling")
   TRY {
     v1 = 5678;
     THROW0(1, 2, "blah");
   TRY {
     v1 = 5678;
     THROW0(1, 2, "blah");
-  } CLEANUP {
+  } _CLEANUP {
     if (v1 != 5678)
       xbt_test_fail1("v1 = %d (!= 5678)", v1);
     c = 1;
     if (v1 != 5678)
       xbt_test_fail1("v1 = %d (!= 5678)", v1);
     c = 1;
@@ -385,7 +385,7 @@ static void bad_example(void)
     cp3 = mallocex(SMALLAMOUNT);
     strcpy(cp1, "foo");
     strcpy(cp2, "bar");
     cp3 = mallocex(SMALLAMOUNT);
     strcpy(cp1, "foo");
     strcpy(cp2, "bar");
-  } CLEANUP {
+  } _CLEANUP {
     if (cp3 != NULL)
       free(cp3);
     if (cp2 != NULL)
     if (cp3 != NULL)
       free(cp3);
     if (cp2 != NULL)
@@ -422,7 +422,7 @@ static void good_example(void)
       cp3 = mallocex(SMALLAMOUNT);
       strcpy(cp1, "foo");
       strcpy(cp2, "bar");
       cp3 = mallocex(SMALLAMOUNT);
       strcpy(cp1, "foo");
       strcpy(cp2, "bar");
-    } CLEANUP {                 /*04 */
+    } _CLEANUP {                 /*04 */
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
       if (cp3 != NULL)
         free(cp3);
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
       if (cp3 != NULL)
         free(cp3);