void NewStateExternalFunctions::EnterSection(const char *name, ...) { //analysis: multiple passes to generate string not ideal, but there arent many sections.. so it should be OK. improvement would be special vararg overload va_list ap; va_start(ap,name); char easybuf[32]; int size = vsnprintf(easybuf,0,name,ap); char *ptr = easybuf; if(size>31) ptr = (char*)malloc(size+1); vsprintf(ptr,name,ap); EnterSection_(ptr); if(ptr != easybuf) free(ptr); va_end(ap); }
void NewStateExternalFunctions::EnterSection(const char *name) { EnterSection_(name); }