int slave(int argc, char *argv[]);
MSG_error_t test_all(const char *);
-typedef enum {
- PORT_22 = 0,
- MAX_CHANNEL
-} channel_t;
-
/** Emitter function */
int master(int argc, char *argv[])
{
int slave(int argc, char *argv[])
{
m_task_t task = NULL;
- int res;
+ _XBT_GNUC_UNUSED int res;
int id = -1;
char mailbox[80];
- int read;
+ _XBT_GNUC_UNUSED int read;
read = sscanf(argv[1], "%d", &id);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
sprintf(mailbox, "slave-%d", id);
while (1) {
res = MSG_task_receive(&(task), mailbox);
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
if (!strcmp(MSG_task_get_name(task), "finalize")) {
MSG_error_t test_all(const char *file) //(void)
{
MSG_error_t res = MSG_OK;
- /* Simulation setting */
- MSG_set_channel_number(MAX_CHANNEL);
+
/*start by registering functions before loading script */
MSG_function_register("master", master);
MSG_function_register("slave", slave);