Menu ▾ ▴

#229 ENTRY_STATE macro lacks fsm variable

SMC 7.3.0
closed-fixed
None
5
2021-11-11
2021-09-06
David Rea
No

Pre-7.x version of SMC used getState(fsm) in their classContext_EnterStartState(fsm) macros:

#define {class}Context_EnterStartState(fsm) \
    if (getState(fsm)->Entry != NULL) { \
        getState(fsm)->Entry(fsm); \
    }

SMC 7.x uses the ENTRY_STATE macro:

#define ENTRY_STATE(state) \
    if ((state)->Entry != NULL) { \
        (state)->Entry(fsm); \
    }

#define {class}Context_EnterStartState(fsm) \
    ENTRY_STATE(getState(fsm))

The ENTRY_STATE macro does not accept a fsm argument and thus can't pass it to the state's Entry function. Building with gcc:

error: 'fsm' undeclared (first use in this function);

Discussion

  • Charles Rapp

    Charles Rapp - 2021-10-02
    • status: open --> open-accepted
    • assigned_to: Charles Rapp
     
  • Charles Rapp

    Charles Rapp - 2021-11-11
    • Group: Assigned --> SMC 7.3.0
     
  • Charles Rapp

    Charles Rapp - 2021-11-11
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.