Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename CLEANUP definition (used after TRY) into TRY_CLEANUP
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 23 Sep 2010 12:21:24 +0000 (12:21 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 23 Sep 2010 12:21:24 +0000 (12:21 +0000)
due to other definition of CLEANUP
like src/xbt/graphxml.c:1201 "#define CLEANUP  cleanup()"

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8212 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 8530762..7667341 100644 (file)
@@ -140,7 +140,7 @@ __ex_mctx_struct} __ex_mctx_t;
  *
  * @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 TRY_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.
@@ -363,7 +363,7 @@ XBT_PUBLIC_DATA(ex_term_cb_t) __xbt_ex_terminate;
 /** @brief optional(!) block for cleanup
  *  @hideinitializer
  */
-#define _CLEANUP \
+#define TRY_CLEANUP \
             else { \
             } \
             __xbt_ex_ctx_ptr->ctx_caught = 0; \
index 9f8f51a..d291c97 100644 (file)
@@ -118,7 +118,7 @@ XBT_TEST_UNIT("cleanup", test_cleanup, "cleanup handling")
   TRY {
     v1 = 5678;
     THROW0(1, 2, "blah");
-  } _CLEANUP {
+  } TRY_CLEANUP {
     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");
-  } _CLEANUP {
+  } TRY_CLEANUP {
     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");
-    } _CLEANUP {                 /*04 */
+    } TRY_CLEANUP {                 /*04 */
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
       if (cp3 != NULL)
         free(cp3);
index b61f7f8..97d1a41 100644 (file)
@@ -388,7 +388,7 @@ int gras_datadesc_memcpy(gras_datadesc_type_t type, void *src, void *dst)
 
   TRY {
     size = gras_datadesc_memcpy_rec(state, refs, type, (char *) src, (char *) dst,0, type->cycle);
-  } _CLEANUP {
+  } TRY_CLEANUP {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
@@ -625,7 +625,7 @@ void gras_datadesc_send(gras_socket_t sock,
   TRY {
     gras_datadesc_send_rec(sock, state, refs, type, (char *) src,
                            type->cycle);
-  } _CLEANUP {
+  } TRY_CLEANUP {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
@@ -960,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);
-  } _CLEANUP {
+  } TRY_CLEANUP {
     xbt_dict_reset(refs);
     gras_cbps_reset(state);
   } CATCH(e) {
index f39e4e3..1536b55 100644 (file)
@@ -94,7 +94,7 @@ xbt_multidict_set(xbt_dict_t mdict,
 
   TRY {
     xbt_multidict_set_ext(mdict, keys, lens, data, free_ctn);
-  } _CLEANUP {
+  } TRY_CLEANUP {
     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);
-  } _CLEANUP {
+  } TRY_CLEANUP {
     xbt_dynar_free(&lens);
   } CATCH(e) {
     RETHROW;
index 450f7ba..9ba09f4 100644 (file)
@@ -337,7 +337,7 @@ XBT_TEST_UNIT("cleanup", test_cleanup, "cleanup handling")
   TRY {
     v1 = 5678;
     THROW0(1, 2, "blah");
-  } _CLEANUP {
+  } TRY_CLEANUP {
     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");
-  } _CLEANUP {
+  } TRY_CLEANUP {
     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");
-    } _CLEANUP {                 /*04 */
+    } TRY_CLEANUP {                 /*04 */
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
       if (cp3 != NULL)
         free(cp3);