Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug memleak, fix uninitialized values, export functions
[simgrid.git] / include / xbt / ex.h
index c2d2cac..3a4a7ba 100644 (file)
@@ -211,6 +211,7 @@ typedef struct { __ex_mctx_struct } __ex_mctx_t;
  * @{
  */
 
+/** @brief different kind of errors */
 typedef enum {
   unknown_error=0,  /**< unknown error */
   arg_error,        /**< Invalid argument */
@@ -258,7 +259,7 @@ typedef struct {
         (ctx)->ctx_mctx        = NULL; \
         (ctx)->ctx_caught      = 0;    \
         (ctx)->ctx_ex.msg      = NULL; \
-        (ctx)->ctx_ex.category = 0;    \
+        (ctx)->ctx_ex.category = unknown_error;    \
         (ctx)->ctx_ex.value    = 0;    \
         (ctx)->ctx_ex.host     = NULL; \
         (ctx)->ctx_ex.procname = NULL; \
@@ -369,7 +370,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e);
   do { /* change this sequence into one block */                               \
      /* build the exception */ \
      __xbt_ex_ctx()->ctx_ex.msg      = (m); \
-     __xbt_ex_ctx()->ctx_ex.category = (c); \
+     __xbt_ex_ctx()->ctx_ex.category = (xbt_errcat_t)(c); \
      __xbt_ex_ctx()->ctx_ex.value    = (v);  \
      __xbt_ex_ctx()->ctx_ex.host     = (char*)NULL;                            \
      __xbt_ex_ctx()->ctx_ex.procname = strdup(xbt_procname());                 \