fix to delay.cpp generator

This commit is contained in:
Allen Webster 2016-05-16 12:14:42 -04:00
parent d307d2581a
commit d7d2f7d6f2
4 changed files with 24 additions and 4 deletions

Binary file not shown.

View File

@ -35,7 +35,10 @@ str_alloc_copy(General_Memory *general, String str){
result.str = (char*)general_memory_allocate(general, result.memory_size, 0);
memcpy(result.str, str.str, str.size);
result.str[result.size] = 0;
return(result);}
return(result);
}
inline Delayed_Action*
delayed_action_(Delay *delay, Action_Type type){

View File

@ -9,7 +9,16 @@
// TOP
#include "4ed_keyboard.cpp"
// TODO(allen): Let's go ahead and eliminate this file
// like I did with the win32 keyboard files.
// NOTE(allen): Old contents of 4ed_keyboard.cpp
globalvar u8 keycode_lookup_table[255];
inline u8
keycode_lookup(u8 system_code){
return keycode_lookup_table[system_code];
}
internal void
keycode_init(Display* dpy){

View File

@ -167,9 +167,17 @@ char str_alloc_copy[] =
" result.str = (char*)general_memory_allocate(general, result.memory_size, 0);\n"
" memcpy(result.str, str.str, str.size);\n"
" result.str[result.size] = 0;\n"
" return(result);"
" return(result);\n"
"}\n\n";
char delayed_action_zero[] =
"inline Delayed_Action\n"
"delayed_action_zero(){\n"
" Delayed_Action result = {0};\n"
" return(result);\n"
"}\n\n"
;
char daction_name[] = "Delayed_Action";
Struct_Field daction_fields[] = {
{"Action_Type", "type"},
@ -218,7 +226,7 @@ char delayed_action_function_bottom[] =
"delay->general, delay->acts, delay->count*sizeof(Delayed_Action), delay->max*sizeof(Delayed_Action), 0);\n"
" }\n"
" result = delay->acts + delay->count++;\n"
" *result = {};\n"
" *result = delayed_action_zero();\n"
" result->type = type;\n"
" return(result);\n"
"}\n\n";