core update
[henge/webcc.git] / src / core / trigger.h
index 1f1878d..5c3c64d 100644 (file)
@@ -48,7 +48,7 @@
            }
 
 
-  \author  K
+  \author  Mihrtec
   \date    2016
   -----------------------------------------------------------------------------*/
 
 #endif
 
 /* Internal macro prototypes */
-#define _TRIGGER_DEL(TARG) --TARG.num_funcs
-#define _TRIGGER_POP(TARG) (TARG.func[_TRIGGER_DEL(TARG)])()
-#define _TRIGGER_SET(TARG, FUNC) TARG.func[TARG.num_funcs++] = FUNC
-#define _TRIGGER(TARG) while(TARG.num_funcs) TRIGGER_POP(TARG)
+#define _TRIGGER_DEL(TARG) --((TARG).num_funcs)
+#define _TRIGGER_POP(TARG) ((TARG).func[_TRIGGER_DEL(TARG)])()
+#define _TRIGGER_SET(TARG, FUNC) (TARG).func[(TARG).num_funcs++] = (FUNC)
+#define _TRIGGER(TARG) while((TARG).num_funcs) TRIGGER_POP(TARG)
 
 /* If TRIGGERS is not defined, use only a default trigger and define shorthand
    functions for easy use. */