Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert API breakage about xbt_ex_free since it was not mandatory and since API should...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 12 Apr 2006 07:22:33 +0000 (07:22 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 12 Apr 2006 07:22:33 +0000 (07:22 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2134 48e7efb5-ca39-0410-a469-dd3cf9ba447f

19 files changed:
examples/gras/rpc/rpc.c
include/xbt/ex.h
src/amok/Bandwidth/bandwidth.c
src/amok/Bandwidth/saturate.c
src/gras/DataDesc/cbps.c
src/gras/DataDesc/ddt_create.c
src/gras/DataDesc/ddt_exchange.c
src/gras/DataDesc/ddt_parse.c
src/gras/Msg/msg.c
src/gras/Transport/transport.c
src/gras/Transport/transport_plugin_sg.c
src/gras/Virtu/process.c
src/xbt/config.c
src/xbt/dict.c
src/xbt/dict_cursor.c
src/xbt/dict_multi.c
src/xbt/ex.c
src/xbt/log.c
src/xbt/set.c

index d98c40f..efb7b8d 100644 (file)
@@ -53,7 +53,7 @@ static void exception_catching(void) {
     xbt_assert1(!strncmp(e.msg,"Some error we will catch on client side",
                         strlen("Some error we will catch on client side")), 
                "Got wrong message: %s", e.msg);
     xbt_assert1(!strncmp(e.msg,"Some error we will catch on client side",
                         strlen("Some error we will catch on client side")), 
                "Got wrong message: %s", e.msg);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
 }
 
   }
 }
 
@@ -144,7 +144,7 @@ int client(int argc,char *argv[]) {
                         strlen("Some error we will catch on client side")), 
                "Got wrong message: %s", e.msg);
     INFO0("Got the expected exception when calling the exception raising RPC");
                         strlen("Some error we will catch on client side")), 
                "Got wrong message: %s", e.msg);
     INFO0("Got the expected exception when calling the exception raising RPC");
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
 
   if (!gotit)
   }
 
   if (!gotit)
@@ -162,7 +162,7 @@ int client(int argc,char *argv[]) {
                         gras_msgtype_by_name("raise exception"), NULL, NULL);
      } CATCH(e) {
        gotit = 1;
                         gras_msgtype_by_name("raise exception"), NULL, NULL);
      } CATCH(e) {
        gotit = 1;
-       xbt_ex_free(&e);
+       xbt_ex_free(e);
      }
      if (!gotit) {
        THROW0(unknown_error,0,"Didn't got the remote exception!");
      }
      if (!gotit) {
        THROW0(unknown_error,0,"Didn't got the remote exception!");
@@ -190,7 +190,7 @@ int client(int argc,char *argv[]) {
                "Got wrong category: %d (instead of %d)", 
                e.category,unknown_error);
     INFO0("Got the expected exception when calling the exception raising RPC");
                "Got wrong category: %d (instead of %d)", 
                e.category,unknown_error);
     INFO0("Got the expected exception when calling the exception raising RPC");
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     exception_catching();
   }
   
     exception_catching();
   }
   
index 9e4ff9a..228743b 100644 (file)
@@ -509,7 +509,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e);
 #define RETHROW5(msg,a,b,c,d,e) _XBT_PRE_RETHROW msg,a,b,c,d,e _XBT_POST_RETHROW
 
 /** @brief Exception destructor */
 #define RETHROW5(msg,a,b,c,d,e) _XBT_PRE_RETHROW msg,a,b,c,d,e _XBT_POST_RETHROW
 
 /** @brief Exception destructor */
-void xbt_ex_free(xbt_ex_t *e);
+void xbt_ex_free(xbt_ex_t e);
 
 void xbt_ex_display(xbt_ex_t *e);
 void xbt_display_backtrace(void);
 
 void xbt_ex_display(xbt_ex_t *e);
 void xbt_display_backtrace(void);
index 8e51556..758cd56 100644 (file)
@@ -129,7 +129,7 @@ void amok_bw_test(gras_socket_t peer,
       if (port == 10000 -1) {
        RETHROW0("Error caught while opening a measurement socket: %s");
       } else {
       if (port == 10000 -1) {
        RETHROW0("Error caught while opening a measurement socket: %s");
       } else {
-       xbt_ex_free(&e);        
+       xbt_ex_free(e); 
       }
     }
   }
       }
     }
   }
@@ -215,7 +215,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t  ctx,
     } CATCH(e) {
       measMasterIn = NULL;
       if (port < 10000)
     } CATCH(e) {
       measMasterIn = NULL;
       if (port < 10000)
-       xbt_ex_free(&e);
+       xbt_ex_free(e);
       else
        /* FIXME: tell error to remote */
        RETHROW0("Error encountered while opening a measurement server socket: %s");
       else
        /* FIXME: tell error to remote */
        RETHROW0("Error encountered while opening a measurement server socket: %s");
index 203535b..6b541f9 100644 (file)
@@ -169,7 +169,7 @@ void amok_bw_saturate_begin(const char* to_name,unsigned int to_port,
        saturate_further=1;
        memset(&msg_got,0,sizeof(msg_got)); /* may be overprotectiv here */
       }
        saturate_further=1;
        memset(&msg_got,0,sizeof(msg_got)); /* may be overprotectiv here */
       }
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     }
 
     /* Check whether the experiment has to be terminated by now */
     }
 
     /* Check whether the experiment has to be terminated by now */
@@ -228,7 +228,7 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload){
     } CATCH(e) {
       measMaster = NULL;
       if (port < 10000)
     } CATCH(e) {
       measMaster = NULL;
       if (port < 10000)
-       xbt_ex_free(&e);
+       xbt_ex_free(e);
       else
        RETHROW0("Error encountered while opening a measurement server socket: %s");
     }
       else
        RETHROW0("Error encountered while opening a measurement server socket: %s");
     }
@@ -255,7 +255,7 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload){
       gras_socket_meas_recv(meas,120,request->msg_size,request->msg_size);
     } CATCH(e) {
       saturate_further = 0;
       gras_socket_meas_recv(meas,120,request->msg_size,request->msg_size);
     } CATCH(e) {
       saturate_further = 0;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     }
   }
   INFO1("Saturation stopped on %s",gras_os_myname());
     }
   }
   INFO1("Saturation stopped on %s",gras_os_myname());
index d4ac84b..952931e 100644 (file)
@@ -99,7 +99,7 @@ gras_cbps_v_push(gras_cbps_t          ps,
     DEBUG1("Create a new variable stack for '%s' into the space",name);
     varstack = xbt_dynar_new(sizeof (gras_cbps_elm_t *), NULL);
     xbt_dict_set(ps->space, varname, (void **)varstack, NULL);
     DEBUG1("Create a new variable stack for '%s' into the space",name);
     varstack = xbt_dynar_new(sizeof (gras_cbps_elm_t *), NULL);
     xbt_dict_set(ps->space, varname, (void **)varstack, NULL);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     /* leaking, you think? only if you do not close all the openned blocks ;)*/
   }
  
     /* leaking, you think? only if you do not close all the openned blocks ;)*/
   }
  
@@ -137,7 +137,7 @@ gras_cbps_v_pop (gras_cbps_t            ps,
     if (e.category != mismatch_error)
       RETHROW;
 
     if (e.category != mismatch_error)
       RETHROW;
 
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     THROW1(not_found_error,1,"Asked to pop the non-existant %s", name);
   }
   xbt_dynar_pop(varstack, &var);
     THROW1(not_found_error,1,"Asked to pop the non-existant %s", name);
   }
   xbt_dynar_pop(varstack, &var);
index 0bbc088..1ac7274 100644 (file)
@@ -59,7 +59,7 @@ gras_datadesc_type_t gras_datadesc_by_name(const char *name) {
   } CATCH(e) {
     if (e.category != not_found_error)
       RETHROW;
   } CATCH(e) {
     if (e.category != not_found_error)
       RETHROW;
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     res = NULL;
   }
   return res;
     res = NULL;
   }
   return res;
@@ -76,7 +76,7 @@ gras_datadesc_type_t gras_datadesc_by_id(long int code) {
   } CATCH(e) {
     if (e.category != not_found_error)
       RETHROW;
   } CATCH(e) {
     if (e.category != not_found_error)
       RETHROW;
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     res = NULL;
   }
   return res;
     res = NULL;
   }
   return res;
index d369df6..49f0879 100644 (file)
@@ -231,7 +231,7 @@ gras_datadesc_copy_rec(gras_cbps_t           state,
       if (e.category != not_found_error)
        RETHROW;
       reference_is_to_cpy = 1;
       if (e.category != not_found_error)
        RETHROW;
       reference_is_to_cpy = 1;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     }
 
     if (reference_is_to_cpy) {
     }
 
     if (reference_is_to_cpy) {
@@ -511,7 +511,7 @@ gras_datadesc_send_rec(gras_socket_t         sock,
       if (e.category != not_found_error)
        RETHROW;
       reference_is_to_send = 1;
       if (e.category != not_found_error)
        RETHROW;
       reference_is_to_send = 1;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     }
 
     if (reference_is_to_send) {
     }
 
     if (reference_is_to_send) {
@@ -766,7 +766,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
       if (e.category != not_found_error)
         RETHROW;
       reference_is_to_recv = 1;
       if (e.category != not_found_error)
         RETHROW;
       reference_is_to_recv = 1;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     }
     if (reference_is_to_recv) {
       int subsubcount = 0;
     }
     if (reference_is_to_recv) {
       int subsubcount = 0;
index 193c6f1..341767e 100644 (file)
@@ -498,7 +498,7 @@ static gras_datadesc_type_t parse_struct(char *definition) {
     } CATCH(e) {
       if (e.category != mismatch_error)
        RETHROW;
     } CATCH(e) {
       if (e.category != mismatch_error)
        RETHROW;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       done = 1;
     }
     
       done = 1;
     }
     
index ab0f1fb..61a0701 100644 (file)
@@ -140,7 +140,7 @@ gras_msgtype_declare_ext(const char           *name,
   } CATCH(e) {
     if (e.category != not_found_error)
       RETHROW;
   } CATCH(e) {
     if (e.category != not_found_error)
       RETHROW;
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
 
   if (found) {
   }
 
   if (found) {
@@ -229,7 +229,7 @@ gras_msgtype_t gras_msgtype_by_namev(const char      *name,
   TRY {
     res = (gras_msgtype_t)xbt_set_get_by_name(_gras_msgtype_set, namev);
   } CATCH(e) {
   TRY {
     res = (gras_msgtype_t)xbt_set_get_by_name(_gras_msgtype_set, namev);
   } CATCH(e) {
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     THROW1(not_found_error,0,"No registred message of that name: %s",name);
   }
   if (name != namev) 
     THROW1(not_found_error,0,"No registred message of that name: %s",name);
   }
   if (name != namev) 
@@ -412,7 +412,7 @@ gras_msg_handle(double timeOut) {
     } CATCH(e) {
       if (e.category != timeout_error)
        RETHROW;
     } CATCH(e) {
       if (e.category != timeout_error)
        RETHROW;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       timeouted = 1;
     }
 
       timeouted = 1;
     }
 
@@ -505,7 +505,7 @@ gras_msg_handle(double timeOut) {
              gras_socket_peer_port(msg.expe));
        gras_msg_send_ext(msg.expe, e_gras_msg_kind_rpcerror,
                          msg.ID, msg.type, &e);
              gras_socket_peer_port(msg.expe));
        gras_msg_send_ext(msg.expe, e_gras_msg_kind_rpcerror,
                          msg.ID, msg.type, &e);
-       xbt_ex_free(&e);
+       xbt_ex_free(e);
        ran_ok=1;
       } else {
        RETHROW0("Callback raised an exception: %s");
        ran_ok=1;
       } else {
        RETHROW0("Callback raised an exception: %s");
index 9d66b21..fa2bda9 100644 (file)
@@ -36,7 +36,7 @@ gras_trp_plugin_new(const char *name, gras_trp_setup_t setup) {
       free(plug->name);
       free(plug);
       plug=NULL;
       free(plug->name);
       free(plug);
       plug=NULL;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     } else {
       RETHROW;
     }
     } else {
       RETHROW;
     }
index 92bea15..d90c36f 100644 (file)
@@ -115,7 +115,7 @@ void gras_trp_sg_socket_client(gras_trp_plugin_t self,
     find_port(hd,sock->peer_port,&pr);
   } CATCH(e) {
     if (e.category == mismatch_error) {
     find_port(hd,sock->peer_port,&pr);
   } CATCH(e) {
     if (e.category == mismatch_error) {
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       THROW2(mismatch_error,0,
             "can't connect to %s:%d, no process listen on this port",
             sock->peer_name,sock->peer_port);
       THROW2(mismatch_error,0,
             "can't connect to %s:%d, no process listen on this port",
             sock->peer_name,sock->peer_port);
@@ -173,7 +173,7 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self,
     found = 1;
   } CATCH(e) {
     if (e.category == mismatch_error)
     found = 1;
   } CATCH(e) {
     if (e.category == mismatch_error)
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     else
       RETHROW;
   }
     else
       RETHROW;
   }
index 77ef6c5..9b6c65c 100644 (file)
@@ -112,7 +112,7 @@ gras_procdata_init() {
       data = xbt_set_get_by_name(pd->libdata, fab.name);
       found = 1;
     } CATCH(e) {
       data = xbt_set_get_by_name(pd->libdata, fab.name);
       found = 1;
     } CATCH(e) {
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       found = 0;
     }
     if (found)
       found = 0;
     }
     if (found)
index e10dc0d..f89e94c 100644 (file)
@@ -215,7 +215,7 @@ xbt_cfg_register(xbt_cfg_t cfg,
   } CATCH(e) {
     if (e.category == not_found_error) {
       found = 1;
   } CATCH(e) {
     if (e.category == not_found_error) {
       found = 1;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     } else {
       RETHROW;
     }
     } else {
       RETHROW;
     }
@@ -372,7 +372,7 @@ static xbt_cfgelm_t xbt_cfgelm_get(xbt_cfg_t  cfg,
     res = xbt_dict_get((xbt_dict_t)cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) {
     res = xbt_dict_get((xbt_dict_t)cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) {
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       THROW1(not_found_error,0,
             "No registered variable '%s' in this config set",name);
     }
       THROW1(not_found_error,0,
             "No registered variable '%s' in this config set",name);
     }
@@ -406,7 +406,7 @@ xbt_cfg_get_type(xbt_cfg_t cfg, const char *name) {
     variable = xbt_dict_get((xbt_dict_t)cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) { 
     variable = xbt_dict_get((xbt_dict_t)cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) { 
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       THROW1(not_found_error,0,
             "Can't get the type of '%s' since this variable does not exist",name);
     }
       THROW1(not_found_error,0,
             "Can't get the type of '%s' since this variable does not exist",name);
     }
@@ -440,7 +440,7 @@ xbt_cfg_set_vargs(xbt_cfg_t cfg, const char *name, va_list pa) {
     type = xbt_cfg_get_type(cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) {
     type = xbt_cfg_get_type(cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) {
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       THROW1(not_found_error,0,"Can't set the property '%s' since it's not registered",name);
     }
     RETHROW;
       THROW1(not_found_error,0,"Can't set the property '%s' since it's not registered",name);
     }
     RETHROW;
@@ -579,7 +579,7 @@ xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) {
       name = (char*) (optionlist_cpy-name + options); 
       free(optionlist_cpy);
       if (e.category == not_found_error) {
       name = (char*) (optionlist_cpy-name + options); 
       free(optionlist_cpy);
       if (e.category == not_found_error) {
-       xbt_ex_free(&e);
+       xbt_ex_free(e);
        THROW1(not_found_error,0,"No registrated variable corresponding to '%s'.",name);
       }
       RETHROW;
        THROW1(not_found_error,0,"No registrated variable corresponding to '%s'.",name);
       }
       RETHROW;
@@ -951,7 +951,7 @@ xbt_cfg_empty(xbt_cfg_t cfg,const char*name) {
     if (e.category != not_found_error)
       RETHROW;
 
     if (e.category != not_found_error)
       RETHROW;
 
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     THROW1(not_found_error,0,
           "Can't empty  '%s' since this config element does not exist", name);
   }
     THROW1(not_found_error,0,
           "Can't empty  '%s' since this config element does not exist", name);
   }
@@ -1092,7 +1092,7 @@ xbt_dynar_t xbt_cfg_get_dynar (xbt_cfg_t    cfg, const char *name) {
     variable = xbt_dict_get((xbt_dict_t)cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) {
     variable = xbt_dict_get((xbt_dict_t)cfg,name);
   } CATCH(e) {
     if (e.category == not_found_error) {
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       THROW1(not_found_error,0,
             "No registered variable %s in this config set",name);
     }
       THROW1(not_found_error,0,
             "No registered variable %s in this config set",name);
     }
@@ -1178,7 +1178,7 @@ XBT_TEST_UNIT("validation",test_config_validation,"Validation tests") {
     if (e.category != mismatch_error || 
        strncmp(e.msg,"Config elem speed needs",strlen("Config elem speed needs")))
       xbt_test_fail1("Got an exception. msg=%s",e.msg);
     if (e.category != mismatch_error || 
        strncmp(e.msg,"Config elem speed needs",strlen("Config elem speed needs")))
       xbt_test_fail1("Got an exception. msg=%s",e.msg);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
   xbt_cfg_free(&set);
   xbt_cfg_free(&set);
   }
   xbt_cfg_free(&set);
   xbt_cfg_free(&set);
@@ -1195,7 +1195,7 @@ XBT_TEST_UNIT("validation",test_config_validation,"Validation tests") {
        strncmp(e.msg,"Cannot add value 34 to the config elem speed",
                strlen("Config elem speed needs")))
       xbt_test_fail1("Got an exception. msg=%s",e.msg);
        strncmp(e.msg,"Cannot add value 34 to the config elem speed",
                strlen("Config elem speed needs")))
       xbt_test_fail1("Got an exception. msg=%s",e.msg);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
   xbt_cfg_check(set);
   xbt_cfg_free(&set);
   }
   xbt_cfg_check(set);
   xbt_cfg_free(&set);
@@ -1256,7 +1256,7 @@ XBT_TEST_UNIT("use",test_config_use,"Data retrieving tests") {
     } CATCH(e) {
       if (e.category != not_found_error)
         xbt_test_exception(e);
     } CATCH(e) {
       if (e.category != not_found_error)
         xbt_test_exception(e);
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
     }
     xbt_cfg_free(&myset);    
   }
     }
     xbt_cfg_free(&myset);    
   }
index 1dd1e31..a673500 100644 (file)
@@ -146,7 +146,7 @@ xbt_dict_get_or_null(xbt_dict_t     dict,
   } CATCH(e) {
     if (e.category != not_found_error) 
       RETHROW;
   } CATCH(e) {
     if (e.category != not_found_error) 
       RETHROW;
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
     res=NULL;
   }
   return res;
     res=NULL;
   }
   return res;
@@ -292,7 +292,7 @@ static void search_not_found(xbt_dict_t head, const char *data) {
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
 }
 
   }
 }
 
@@ -371,7 +371,7 @@ XBT_TEST_UNIT("remove",test_dict_remove,"Removing some values"){
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
   traverse(head);
 
   }
   traverse(head);
 
@@ -383,7 +383,7 @@ XBT_TEST_UNIT("remove",test_dict_remove,"Removing some values"){
   } CATCH(e) {
     if (e.category != arg_error) 
       xbt_test_exception(e);
   } CATCH(e) {
     if (e.category != arg_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   } 
 
   xbt_test_add0("Remove each data manually (traversing the resulting dictionnary each time)");
   } 
 
   xbt_test_add0("Remove each data manually (traversing the resulting dictionnary each time)");
@@ -397,7 +397,7 @@ XBT_TEST_UNIT("remove",test_dict_remove,"Removing some values"){
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);         
+    xbt_ex_free(e);         
     traverse(head);
   } 
   debuged_remove(head,"1234");   traverse(head);
     traverse(head);
   } 
   debuged_remove(head,"1234");   traverse(head);
@@ -408,7 +408,7 @@ XBT_TEST_UNIT("remove",test_dict_remove,"Removing some values"){
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }                              traverse(head);
   
   xbt_test_add0("Free the dictionnary twice");
   }                              traverse(head);
   
   xbt_test_add0("Free the dictionnary twice");
index fbe037f..1827eeb 100644 (file)
@@ -188,7 +188,7 @@ xbt_dict_cursor_get_or_free(xbt_dict_cursor_t  *cursor,
   } CATCH(e) {
     if (e.category == mismatch_error) {
       xbt_dict_cursor_free(cursor);
   } CATCH(e) {
     if (e.category == mismatch_error) {
       xbt_dict_cursor_free(cursor);
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       return FALSE;
     }
     RETHROW;
       return FALSE;
     }
     RETHROW;
index eadf725..c317b81 100644 (file)
@@ -62,7 +62,7 @@ xbt_multidict_set_ext(xbt_dict_t  mdict,
        RETHROW;
 
       /* make sure the dict of next level exists */
        RETHROW;
 
       /* make sure the dict of next level exists */
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       nextlevel=xbt_dict_new();
       VERB1("Create a dict (%p)",nextlevel);
       xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel, &_free_dict);
       nextlevel=xbt_dict_new();
       VERB1("Create a dict (%p)",nextlevel);
       xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel, &_free_dict);
@@ -208,7 +208,7 @@ xbt_multidict_remove_ext(xbt_dict_t mdict, xbt_dynar_t keys, xbt_dynar_t lens) {
     } CATCH(e) {
       /* If non-existant entry, nothing to do */
       if (e.category == arg_error) 
     } CATCH(e) {
       /* If non-existant entry, nothing to do */
       if (e.category == arg_error) 
-       xbt_ex_free(&e);
+       xbt_ex_free(e);
       else 
        RETHROW;
     }
       else 
        RETHROW;
     }
index d579bce..923df6a 100644 (file)
@@ -61,7 +61,7 @@ void xbt_display_backtrace(void) {
 
   e.msg=NULL;
   e.remote=0;
 
   e.msg=NULL;
   e.remote=0;
-  xbt_ex_free(&e);
+  xbt_ex_free(e);
 #else 
   fprintf(stderr,"No backtrace on this arch");
 #endif
 #else 
   fprintf(stderr,"No backtrace on this arch");
 #endif
@@ -225,7 +225,7 @@ void xbt_ex_display(xbt_ex_t *e)  {
   fprintf(stderr," at %s:%d:%s (no backtrace available on that arch)\n",  
          e->file,e->line,e->func);
 #endif
   fprintf(stderr," at %s:%d:%s (no backtrace available on that arch)\n",  
          e->file,e->line,e->func);
 #endif
-  xbt_ex_free(e);
+  xbt_ex_free(*e);
 }
 
 
 }
 
 
@@ -240,23 +240,23 @@ void __xbt_ex_terminate_default(xbt_ex_t *e)  {
 ex_ctx_cb_t  __xbt_ex_ctx       = &__xbt_ex_ctx_default;
 ex_term_cb_t __xbt_ex_terminate = &__xbt_ex_terminate_default;
 
 ex_ctx_cb_t  __xbt_ex_ctx       = &__xbt_ex_ctx_default;
 ex_term_cb_t __xbt_ex_terminate = &__xbt_ex_terminate_default;
 
-void xbt_ex_free(xbt_ex_t *e) {
+void xbt_ex_free(xbt_ex_t e) {
   int i;
 
   int i;
 
-  if (e->msg) free(e->msg);
-  if (e->remote) {
-    free(e->procname);
-    free(e->file);
-    free(e->func);
-    free(e->host);
+  if (e.msg) free(e.msg);
+  if (e.remote) {
+    free(e.procname);
+    free(e.file);
+    free(e.func);
+    free(e.host);
   }
 
   }
 
-  if (e->bt_strings) { 
-     for (i=0; i<e->used; i++) 
-       free((char*)e->bt_strings[i]);
-     free((char **)e->bt_strings);
+  if (e.bt_strings) {  
+     for (i=0; i<e.used; i++) 
+       free((char*)e.bt_strings[i]);
+     free((char **)e.bt_strings);
   }
   }
-  memset(e,0,sizeof(xbt_ex_t));
+//  memset(e,0,sizeof(xbt_ex_t));
 }
 
 /** \brief returns a short name for the given exception category */
 }
 
 /** \brief returns a short name for the given exception category */
@@ -306,7 +306,7 @@ XBT_TEST_UNIT("controlflow",test_controlflow, "basic nested control flow") {
             if (n != 3)
                 xbt_test_fail1("M3: n=%d (!= 3)", n);
             n++;
             if (n != 3)
                 xbt_test_fail1("M3: n=%d (!= 3)", n);
             n++;
-           xbt_ex_free(&ex);
+           xbt_ex_free(ex);
         }
        n++;
         TRY {
         }
        n++;
         TRY {
@@ -327,7 +327,7 @@ XBT_TEST_UNIT("controlflow",test_controlflow, "basic nested control flow") {
         if (n != 7)
             xbt_test_fail1("M4: n=%d (!= 7)", n);
         n++;
         if (n != 7)
             xbt_test_fail1("M4: n=%d (!= 7)", n);
         n++;
-        xbt_ex_free(&ex);
+        xbt_ex_free(ex);
     }
     if (n != 8)
         xbt_test_fail1("M5: n=%d (!= 8)", n);
     }
     if (n != 8)
         xbt_test_fail1("M5: n=%d (!= 8)", n);
@@ -346,7 +346,7 @@ XBT_TEST_UNIT("value",test_value,"exception value passing") {
             xbt_test_fail1("value=%d (!= 2)", ex.value);
         if (strcmp(ex.msg,"toto"))
             xbt_test_fail1("message=%s (!= toto)", ex.msg);
             xbt_test_fail1("value=%d (!= 2)", ex.value);
         if (strcmp(ex.msg,"toto"))
             xbt_test_fail1("message=%s (!= toto)", ex.msg);
-        xbt_ex_free(&ex);
+        xbt_ex_free(ex);
     }
 }
 
     }
 }
 
@@ -369,7 +369,7 @@ XBT_TEST_UNIT("variables",test_variables,"variable value preservation") {
         /* r2 is allowed to be destroyed because not volatile */
         if (v2 != 5678)
             xbt_test_fail1("v2=%d (!= 5678)", v2);
         /* r2 is allowed to be destroyed because not volatile */
         if (v2 != 5678)
             xbt_test_fail1("v2=%d (!= 5678)", v2);
-        xbt_ex_free(&ex);
+        xbt_ex_free(ex);
     }
 }
 
     }
 }
 
@@ -394,7 +394,7 @@ XBT_TEST_UNIT("cleanup",test_cleanup,"cleanup handling") {
             xbt_test_fail1("v1 = %d (!= 5678)", v1);
         if (!(ex.category == 1 && ex.value == 2 && !strcmp(ex.msg,"blah")))
             xbt_test_fail0("unexpected exception contents");
             xbt_test_fail1("v1 = %d (!= 5678)", v1);
         if (!(ex.category == 1 && ex.value == 2 && !strcmp(ex.msg,"blah")))
             xbt_test_fail0("unexpected exception contents");
-        xbt_ex_free(&ex);
+        xbt_ex_free(ex);
     }
     if (!c)
         xbt_test_fail0("xbt_ex_free not executed");
     }
     if (!c)
         xbt_test_fail0("xbt_ex_free not executed");
index e84d50f..e80332a 100644 (file)
@@ -687,7 +687,7 @@ void xbt_log_control_set(const char* control_string) {
     } CATCH(e) {
       if (e.category != not_found_error)
        RETHROW;
     } CATCH(e) {
       if (e.category != not_found_error)
        RETHROW;
-      xbt_ex_free(&e);
+      xbt_ex_free(e);
       found = 0;
 
       DEBUG0("Store for further application");
       found = 0;
 
       DEBUG0("Store for further application");
index 8991459..5ac0f0c 100644 (file)
@@ -79,7 +79,7 @@ void xbt_set_add    (xbt_set_t      set,
     xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
     xbt_dynar_set(set->dynar, elm->ID, &elm);
     DEBUG2("Insertion of key '%s' (id %d)", elm->name, elm->ID);
     xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
     xbt_dynar_set(set->dynar, elm->ID, &elm);
     DEBUG2("Insertion of key '%s' (id %d)", elm->name, elm->ID);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
   
   if (found) {
   }
   
   if (found) {
@@ -315,7 +315,7 @@ static void search_not_found(xbt_set_t set, const char *data) {
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);  
+    xbt_ex_free(e);  
   }
 }
 
   }
 }