const char *getStateString(State st) { #define state_case(x) case x: return #x switch (st) { state_case(ST_NORM); state_case(ST_SURF_INIT); state_case(ST_SURF_DATA); state_case(ST_VOL_INIT); state_case(ST_VOL_DATA); state_case(ST_PTS_INIT); state_case(ST_PTS_DATA); state_case(ST_CURVE_INIT); state_case(ST_CURVE_DATA); state_case(ST_STOP); default: return "(error state)"; } #undef state_case }
static const char *vc_state_to_str(MPIDI_VC_State_t state) { switch (state) { state_case(INACTIVE); state_case(ACTIVE); state_case(LOCAL_CLOSE); state_case(REMOTE_CLOSE); state_case(CLOSE_ACKED); state_case(CLOSED); state_case(INACTIVE_CLOSED); state_case(MORIBUND); default: return "(invalid state)"; break; } }