[BIOSAL] Random values vs BASE + xyz vs enum for actions

Boisvert, Sebastien boisvert at anl.gov
Wed Nov 5 21:08:00 CST 2014


Hi George,

The new action definitions that use a base and an offset is great [1].

#define ACTOR_ACTION_BASE -1000

#define ACTION_START (ACTOR_ACTION_BASE + 0)
#define ACTION_START_REPLY (ACTOR_ACTION_BASE + 1)
#define ACTION_STOP (ACTOR_ACTION_BASE + 2)
#define ACTION_STOP_REPLY (ACTOR_ACTION_BASE + 3)
#define ACTION_ASK_TO_STOP (ACTOR_ACTION_BASE + 4)
#define ACTION_ASK_TO_STOP_REPLY (ACTOR_ACTION_BASE + 5)


I was told by a friend (from industry) of mine that the following would be better:

enum {
    ACTOR_ACTION_BASE = -1000,
    ACTION_START,
    ACTION_START_REPLY,
    ACTION_STOP,
    ACTION_STOP_REPLY,
    ACTION_ASK_TO_STOP,
    ACTION_ASK_TO_STOP_REPLY
};


What do you think ?


---
[1] https://github.com/gkthiruvathukal/biosal/commit/8e0448d4c98babd9e471d134745791165fb08536


More information about the BIOSAL mailing list