delay.cpp generator fixed

master
Allen Webster 2016-05-16 12:19:17 -04:00
parent d7d2f7d6f2
commit d5f98bcd31
3 changed files with 9 additions and 4 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
vc120.pdb
custom_casey.cpp
4ed_data.ctm

View File

@ -38,7 +38,11 @@ str_alloc_copy(General_Memory *general, String str){
return(result);
}
inline Delayed_Action
delayed_action_zero(){
Delayed_Action result = {(Action_Type)0};
return(result);
}
inline Delayed_Action*
delayed_action_(Delay *delay, Action_Type type){
@ -48,7 +52,7 @@ delayed_action_(Delay *delay, Action_Type type){
delay->acts = (Delayed_Action*)general_memory_reallocate(delay->general, delay->acts, delay->count*sizeof(Delayed_Action), delay->max*sizeof(Delayed_Action), 0);
}
result = delay->acts + delay->count++;
*result = {};
*result = delayed_action_zero();
result->type = type;
return(result);
}

View File

@ -173,7 +173,7 @@ char str_alloc_copy[] =
char delayed_action_zero[] =
"inline Delayed_Action\n"
"delayed_action_zero(){\n"
" Delayed_Action result = {0};\n"
" Delayed_Action result = {(Action_Type)0};\n"
" return(result);\n"
"}\n\n"
;
@ -286,6 +286,7 @@ char* generate_delayed_action(){
struct_end(file);
fprintf(file, "%s", str_alloc_copy);
fprintf(file, "%s", delayed_action_zero);
fprintf(file, "%s%s", delayed_action_function_top, delayed_action_function_bottom);
for (i = 0; i < ArrayCount(dact_param_sets); ++i){