Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
useless cleanups
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 6 Aug 2014 20:04:35 +0000 (22:04 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 6 Aug 2014 22:51:50 +0000 (00:51 +0200)
- one letter variables are harder to read
- remove a useless assert (the system will complain if it's null)
- improve some debug messages and comments

src/msg/msg_gos.c
src/simix/smx_private.h
src/simix/smx_process.c
src/xbt/ex.c

index df8c0d3..73c91df 100644 (file)
@@ -173,7 +173,7 @@ msg_error_t MSG_process_sleep(double nb_sec)
       // adsein: MSG_TASK_CANCELED is assigned when someone kills the process that made the sleep, this is not
       // correct. For instance, when the node is turned off, the error should be MSG_HOST_FAILURE, which is by the way
       // and according to the JAVA document, the only exception that can be triggered by MSG_Process_sleep call.
       // adsein: MSG_TASK_CANCELED is assigned when someone kills the process that made the sleep, this is not
       // correct. For instance, when the node is turned off, the error should be MSG_HOST_FAILURE, which is by the way
       // and according to the JAVA document, the only exception that can be triggered by MSG_Process_sleep call.
-      // To avoid possible impacts in the code, I just raised a host_failure execption for the moment in the JAVA code 
+      // To avoid possible impacts in the code, I just raised a host_failure exception for the moment in the JAVA code
       // and did not change anythings at the C level.
       // See comment in the jmsg_process.c file, function JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos) 
       status = MSG_TASK_CANCELED;
       // and did not change anythings at the C level.
       // See comment in the jmsg_process.c file, function JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos) 
       status = MSG_TASK_CANCELED;
index b2e5375..34cf63e 100644 (file)
@@ -71,11 +71,11 @@ XBT_PUBLIC(void) SIMIX_clean(void);
 #endif
 
 /******************************** Exceptions *********************************/
 #endif
 
 /******************************** Exceptions *********************************/
-
-#define SMX_EXCEPTION(issuer, c, v, m)                                  \
+/** @brief Ask to the provided simix process to raise the provided exception */
+#define SMX_EXCEPTION(issuer, cat, val, msg)                            \
   if (1) {                                                              \
   if (1) {                                                              \
-    smx_process_t _smx_throw_issuer = (issuer);                         \
-    THROW_PREPARE(_smx_throw_issuer->running_ctx, (c), (v), xbt_strdup(m)); \
+    smx_process_t _smx_throw_issuer = (issuer); /* evaluate only once */\
+    THROW_PREPARE(_smx_throw_issuer->running_ctx, (cat), (val), xbt_strdup(msg)); \
     _smx_throw_issuer->doexception = 1;                                 \
   } else ((void)0)
 
     _smx_throw_issuer->doexception = 1;                                 \
   } else ((void)0)
 
index 8d2320a..77578ae 100644 (file)
@@ -494,8 +494,6 @@ void SIMIX_pre_process_resume(smx_simcall_t simcall, smx_process_t process){
 
 void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
 {
 
 void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
 {
-  xbt_assert((process != NULL), "Invalid parameters");
-
   XBT_IN("process = %p, issuer = %p", process, issuer);
 
   if(process->context->iwannadie) {
   XBT_IN("process = %p, issuer = %p", process, issuer);
 
   if(process->context->iwannadie) {
@@ -844,7 +842,7 @@ void SIMIX_process_yield(smx_process_t self)
 
   if (self->suspended) {
     XBT_DEBUG("Hey! I'm suspended.");
 
   if (self->suspended) {
     XBT_DEBUG("Hey! I'm suspended.");
-    xbt_assert(!self->doexception, "Gloups! This exception may be lost by subsequent calls.");
+    xbt_assert(!self->doexception, "Gasp! This exception may be lost by subsequent calls.");
     self->suspended = 0;
     SIMIX_process_suspend(self, self);
   }
     self->suspended = 0;
     SIMIX_process_suspend(self, self);
   }
index 4b0d7bd..8d4487c 100644 (file)
@@ -177,8 +177,7 @@ void __xbt_ex_terminate_default(xbt_ex_t * e)
 
 /* the externally visible API */
 XBT_EXPORT_NO_IMPORT(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
 
 /* the externally visible API */
 XBT_EXPORT_NO_IMPORT(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
-XBT_EXPORT_NO_IMPORT(ex_term_cb_t) __xbt_ex_terminate =
-    &__xbt_ex_terminate_default;
+XBT_EXPORT_NO_IMPORT(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)