A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Cosmetics: fix comment.
[simgrid.git]
/
src
/
gras
/
Msg
/
rl_msg.c
diff --git
a/src/gras/Msg/rl_msg.c
b/src/gras/Msg/rl_msg.c
index
25860b0
..
d395371
100644
(file)
--- a/
src/gras/Msg/rl_msg.c
+++ b/
src/gras/Msg/rl_msg.c
@@
-21,7
+21,7
@@
gras_msg_t gras_msg_recv_any(void)
{
gras_msg_t msg = xbt_new0(s_gras_msg_t, 1);
msg->expe = gras_trp_select(-1);
-
DEBUG0
("Select returned something");
+
XBT_DEBUG
("Select returned something");
gras_msg_recv(msg->expe, msg);
return msg;
}
@@
-36,7
+36,7
@@
void gras_msg_send_ext(gras_socket_t sock,
static gras_datadesc_type_t ulong_type = NULL;
char c_kind = (char) kind;
- xbt_assert
0
(msgtype, "Cannot send the NULL message");
+ xbt_assert(msgtype, "Cannot send the NULL message");
if (!string_type) {
string_type = gras_datadesc_by_name("string");
@@
-47,7
+47,7
@@
void gras_msg_send_ext(gras_socket_t sock,
xbt_assert(ulong_type);
}
-
DEBUG3
("send '%s' to %s:%d", msgtype->name,
+
XBT_DEBUG
("send '%s' to %s:%d", msgtype->name,
gras_socket_peer_name(sock), gras_socket_peer_port(sock));
gras_trp_send(sock, _GRAS_header, 6, 1 /* stable */ );
gras_trp_send(sock, &c_kind, 1, 1 /* stable */ );
@@
-62,7
+62,7
@@
void gras_msg_send_ext(gras_socket_t sock,
break;
default:
- THROW
1
(unknown_error, 0, "Unknown msg kind %d", kind);
+ THROW
F
(unknown_error, 0, "Unknown msg kind %d", kind);
}
gras_datadesc_send(sock, string_type, &msgtype->name);
@@
-99,7
+99,7
@@
void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
char *msg_name = NULL;
char c_kind;
- xbt_assert
1
(!gras_socket_is_meas(sock),
+ xbt_assert(!gras_socket_is_meas(sock),
"Asked to receive a message on the measurement socket %p",
sock);
if (!string_type) {
@@
-117,18
+117,18
@@
void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
gras_trp_recv(sock, &c_kind, 1);
msg->kind = (e_gras_msg_kind_t) c_kind;
}
- CATCH
(e)
{
- RETHROW
0
+ CATCH
_ANONYMOUS
{
+ RETHROW
F
("Exception caught while trying to get the message header: %s");
}
for (cpt = 0; cpt < 4; cpt++)
if (header[cpt] != _GRAS_header[cpt])
- THROW
2
(mismatch_error, 0,
+ THROW
F
(mismatch_error, 0,
"Incoming bytes do not look like a GRAS message (header='%s' not '%.4s')",
hexa_str((unsigned char *) header, 4, 0), _GRAS_header);
if (header[4] != _GRAS_header[4])
- THROW
2
(mismatch_error, 0, "GRAS protocol mismatch (got %d, use %d)",
+ THROW
F
(mismatch_error, 0, "GRAS protocol mismatch (got %d, use %d)",
(int) header[4], (int) _GRAS_header[4]);
r_arch = (int) header[5];
@@
-147,7
+147,7
@@
void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
}
gras_datadesc_recv(sock, string_type, r_arch, &msg_name);
- DEBUG4
+ XBT_DEBUG
("Handle an incoming message '%s' (%s) using protocol %d (remote is %s)",
msg_name, e_gras_msg_kind_names[msg->kind], (int) header[4],
gras_datadesc_arch_name(r_arch));
@@
-155,15
+155,16
@@
void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
TRY {
msg->type =
(gras_msgtype_t) xbt_set_get_by_name(_gras_msgtype_set, msg_name);
- } CATCH(e) {
+ }
+ CATCH(e) {
/* FIXME: Survive unknown messages */
if (e.category == not_found_error) {
xbt_ex_free(e);
- THROW
1
(not_found_error, 0,
+ THROW
F
(not_found_error, 0,
"Received an unknown message: %s (FIXME: should survive to these)",
msg_name);
} else
- RETHROW
1
+ RETHROW
F
("Exception caught while retrieving the type associated to messages '%s' : %s",
msg_name);
}
@@
-180,7
+181,7
@@
void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
/* answer to RPC */
if (msg->type->answer_type) {
msg->payl_size = gras_datadesc_size(msg->type->answer_type);
- xbt_assert
2
(msg->payl_size > 0,
+ xbt_assert(msg->payl_size > 0,
"%s %s",
"Dynamic array as payload is forbided for now (FIXME?).",
"Reference to dynamic array is allowed.");
@@
-194,7
+195,7
@@
void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
/* regular message */
if (msg->type->ctn_type) {
msg->payl_size = gras_datadesc_size(msg->type->ctn_type);
- xbt_assert
2
(msg->payl_size > 0,
+ xbt_assert(msg->payl_size > 0,
"%s %s",
"Dynamic array as payload is forbided for now (FIXME?).",
"Reference to dynamic array is allowed.");