Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove one indirection of gras_datadesc_recv to ease its semantic; plug a few leaks...
[simgrid.git] / src / gras / Msg / msg.c
index 4cb483b..077f51c 100644 (file)
@@ -120,7 +120,7 @@ gras_msgtype_declare_v(const char            *name,
     RAISE_MALLOC;
 
   errcode = gras_set_get_by_name(_gras_msgtype_set,
-                                namev,(gras_set_elm_t**)msgtype);
+                                namev,(gras_set_elm_t**)&msgtype);
   if (errcode == mismatch_error) {
     /* create type */
     if (! (msgtype = malloc(sizeof(gras_msgtype_t))) ) 
@@ -194,8 +194,10 @@ gras_msg_send(gras_socket_t  *sock,
 
   gras_error_t errcode;
   static gras_datadesc_type_t *string_type=NULL;
-  if (!string_type)
-    TRY(gras_datadesc_by_name("string", &string_type));
+  if (!string_type) {
+    string_type = gras_datadesc_by_name("string");
+    gras_assert(string_type);
+  }
   
   TRY(gras_trp_chunk_send(sock, GRAS_header, 6));
 
@@ -222,8 +224,10 @@ gras_msg_recv(gras_socket_t   *sock,
   int r_arch;
   char *msg_name;
 
-  if (!string_type)
-    TRY(gras_datadesc_by_name("string", &string_type));
+  if (!string_type) {
+    string_type=gras_datadesc_by_name("string");
+    gras_assert(string_type);
+  }
   
   TRY(gras_trp_chunk_recv(sock, header, 6));
   for (cpt=0; cpt<4; cpt++)
@@ -331,7 +335,7 @@ gras_msg_handle(double timeOut) {
 
 
 
-  VERB1("Handling message within the next %.2s",timeOut);
+  VERB1("Handling message within the next %d",timeOut);
   
   /* get a message (from the queue or from the net) */
   if (gras_dynar_length(pd->msg_queue)) {