Commit faa37d89 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

Don't start enums with 0.



This is to help with debugging.  Zero is too common a value, and is
often set automatically by the system if not initialized.  Starting at
a different value helps us catch uninitialized cases more easily.

We pick "42" as our magic number as it is the answer to the ultimate
question of life, the Universe, and everything.
Signed-off-by: default avatarWesley Bland <wbland@anl.gov>
parent 983df3ae
......@@ -60,9 +60,12 @@ typedef union {
*/
/* FIXME: Having predefined names makes it harder to add new message types,
such as different RMA types. */
/* We start with an arbitrarily chosen number (42), to help with
* debugging when a packet type is not initialized or wrongly
* initialized. */
enum MPIDI_CH3_Pkt_types
{
MPIDI_CH3_PKT_EAGER_SEND = 0,
MPIDI_CH3_PKT_EAGER_SEND = 42,
#if defined(USE_EAGER_SHORT)
MPIDI_CH3_PKT_EAGERSHORT_SEND,
#endif /* defined(USE_EAGER_SHORT) */
......
......@@ -196,8 +196,11 @@ typedef struct MPIDI_VC * MPID_VCR;
# define MPIDI_REQUEST_SEQNUM
#endif
/* We start with an arbitrarily chosen number (42), to help with
* debugging when a packet type is not initialized or wrongly
* initialized. */
enum MPIDI_CH3_Lock_states {
MPIDI_CH3_WIN_LOCK_NONE = 0,
MPIDI_CH3_WIN_LOCK_NONE = 42,
MPIDI_CH3_WIN_LOCK_CALLED,
MPIDI_CH3_WIN_LOCK_REQUESTED,
MPIDI_CH3_WIN_LOCK_GRANTED,
......@@ -216,8 +219,11 @@ enum MPIDI_Win_info_arg_vals_accumulate_ops {
MPIDI_ACC_OPS_SAME_OP_NO_OP
};
/* We start with an arbitrarily chosen number (42), to help with
* debugging when a packet type is not initialized or wrongly
* initialized. */
enum MPIDI_Win_epoch_states {
MPIDI_EPOCH_NONE = 0,
MPIDI_EPOCH_NONE = 42,
MPIDI_EPOCH_FENCE,
MPIDI_EPOCH_POST,
MPIDI_EPOCH_START,
......
......@@ -31,9 +31,12 @@ enum MPIDI_RMA_Datatype {
MPIDI_RMA_DATATYPE_DERIVED = 51
};
/* We start with an arbitrarily chosen number (42), to help with
* debugging when a packet type is not initialized or wrongly
* initialized. */
enum MPID_Lock_state {
MPID_LOCK_NONE = 0,
MPID_LOCK_SHARED_ALL = 1
MPID_LOCK_NONE = 42,
MPID_LOCK_SHARED_ALL
};
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment