From 8e412481e8faa8797009e35afc857474a0999a7a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 10 Mar 2014 15:06:51 +0100 Subject: [PATCH 1/1] Comment unused field when !HAVE_MC. --- src/simix/smx_network.c | 10 +++++----- src/simix/smx_smurf.c | 2 +- src/simix/smx_smurf_private.h | 10 ++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 9797825fc9..fc3f4b8f54 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -361,7 +361,7 @@ void SIMIX_pre_comm_send(smx_simcall_t simcall, smx_rdv_t rdv, smx_action_t comm = SIMIX_comm_isend(simcall->issuer, rdv, task_size, rate, src_buff, src_buff_size, match_fun, NULL, data, 0); - simcall->mc_value = 0; + SIMCALL_SET_MC_VALUE(simcall, 0); SIMIX_pre_comm_wait(simcall, comm, timeout); } smx_action_t SIMIX_pre_comm_isend(smx_simcall_t simcall, smx_rdv_t rdv, @@ -456,7 +456,7 @@ void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv, { smx_action_t comm = SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, dst_buff_size, match_fun, data, rate); - simcall->mc_value = 0; + SIMCALL_SET_MC_VALUE(simcall, 0); SIMIX_pre_comm_wait(simcall, comm, timeout); } @@ -604,7 +604,7 @@ void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double time simcall->issuer->waiting_action = action; if (MC_is_active()) { - int idx = simcall->mc_value; + int idx = SIMCALL_GET_MC_VALUE(simcall); if (idx == 0) { action->state = SIMIX_DONE; } else { @@ -668,7 +668,7 @@ void SIMIX_pre_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions) simcall_comm_testany__set__result(simcall, -1); if (MC_is_active()){ - int idx = simcall->mc_value; + int idx = SIMCALL_GET_MC_VALUE(simcall); if(idx == -1){ SIMIX_simcall_answer(simcall); }else{ @@ -698,7 +698,7 @@ void SIMIX_pre_comm_waitany(smx_simcall_t simcall, xbt_dynar_t actions) unsigned int cursor = 0; if (MC_is_active()){ - int idx = simcall->mc_value; + int idx = SIMCALL_GET_MC_VALUE(simcall); action = xbt_dynar_get_as(actions, idx, smx_action_t); xbt_fifo_push(action->simcalls, simcall); simcall_comm_waitany__set__result(simcall, idx); diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c index b76914ff0d..515446b43e 100644 --- a/src/simix/smx_smurf.c +++ b/src/simix/smx_smurf.c @@ -56,7 +56,7 @@ void SIMIX_simcall_answer(smx_simcall_t simcall) void SIMIX_simcall_pre(smx_simcall_t simcall, int value) { XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call)); - simcall->mc_value = value; + SIMCALL_SET_MC_VALUE(simcall, value); if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP) return; switch (simcall->call) { diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index f14c89db14..dbd5f92907 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -58,7 +58,9 @@ union u_smx_scalar { typedef struct s_smx_simcall { e_smx_simcall_t call; smx_process_t issuer; +#ifdef HAVE_MC int mc_value; +#endif union u_smx_scalar args[10]; union u_smx_scalar result; //FIXME: union u_smx_scalar retval; @@ -72,6 +74,14 @@ typedef struct s_smx_simcall { }; } s_smx_simcall_t, *smx_simcall_t; +#if HAVE_MC +#define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value)) +#define SIMCALL_GET_MC_VALUE(simcall) ((simcall)->mc_value) +#else +#define SIMCALL_SET_MC_VALUE(simcall, value) ((void)0) +#define SIMCALL_GET_MC_VALUE(simcall) 0 +#endif + #include "simcalls_generated_res_getter_setter.h" #include "simcalls_generated_args_getter_setter.h" -- 2.20.1