This is kind of a noob C question although I'm not really one anymore.
I have this simple function which processes a button press:
Expand|Select|Wrap|Line Numbers
- void ButtonAction( Button *button, Mode mode )
- {
- Button *b = (Button *)((button)->actions[(mode)];
- if( mode == RepeatPress ) // some enum val
- *(b->actions[RepeatPress]) = EventMultiStepLeft;
- //execute
- ...
- }
But, why is it null? I cast it.
Button type looks like this:
Expand|Select|Wrap|Line Numbers
- typedef struct
- {
- VOLATILE UINT32 type ;
- VOLATILE UINT32 polarity ;
- VOLATILE UINT32 pin ;
- VOLATILE void * actions [ NumButtonActions ] ;
- } Button ;