When you define an objective function this way:
var objective(PERFORMANCE * perf)
it does NOT override the default objective since C makes a difference between functions of the same name, but different parameter types. It's better this way:
var objective()
{
PERFORMANCE* perf = &g->w;
...
}
Passing PERFORMANCE as a parameter is not really needed since it's also stored in the g struct.