#include "xbt/automaton.h"
#include <stdio.h> /* printf */
-#include <xbt/log.h>
#include <xbt/sysdep.h>
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_automaton, xbt, "Automaton");
-
struct xbt_automaton_propositional_symbol{
char* pred;
/** Callback used to evaluate the value of the symbol */
return a->current_state;
}
-static int call_simple_function(void* function)
+static int call_simple_function(int function(void) )
{
- return ((int (*)(void)) function)();
+ return function();
}
xbt_automaton_propositional_symbol_t xbt_automaton_propositional_symbol_new(xbt_automaton_t a, const char* id,
{
xbt_automaton_propositional_symbol_t prop_symb = xbt_new0(struct xbt_automaton_propositional_symbol, 1);
prop_symb->pred = xbt_strdup(id);
- prop_symb->callback = &call_simple_function;
- prop_symb->data = fct;
+ prop_symb->callback = ((int (*)(void *))&call_simple_function);
+ prop_symb->data = (void*)&fct;
prop_symb->free_function = NULL;
xbt_dynar_push(a->propositional_symbols, &prop_symb);
return prop_symb;