finished getting through 4ed_app.cpp to build in MSVC 2017's compiler

This commit is contained in:
Allen Webster 2017-03-17 13:45:41 -04:00
parent 0373016da3
commit a6d0156e0c
10 changed files with 138 additions and 132 deletions

50
4ed.cpp
View File

@ -247,16 +247,16 @@ do_feedback_message(System_Functions *system, Models *models, String value, b32
#define USE_FILE(n,v) Editing_File *n = (v)->file_data.file #define USE_FILE(n,v) Editing_File *n = (v)->file_data.file
#define USE_PANEL(n) Panel *n = 0;{ \ #define USE_PANEL(n) Panel *n = 0; do{ \
i32 panel_index = command->models->layout.active_panel; \ i32 panel_index = command->models->layout.active_panel; \
n = command->models->layout.panels + panel_index; \ n = command->models->layout.panels + panel_index; \
} }while(false)
#define USE_VIEW(n) View *n = 0;{ \ #define USE_VIEW(n) View *n = 0; do{ \
i32 panel_index = command->models->layout.active_panel; \ i32 panel_index = command->models->layout.active_panel; \
Panel *panel = command->models->layout.panels + panel_index; \ Panel *__panel__ = command->models->layout.panels + panel_index; \
n = panel->view; \ n = __panel__->view; \
} }while(false)
#define REQ_OPEN_VIEW(n) USE_VIEW(n); if (view_lock_level(n) > LockLevel_Open) return #define REQ_OPEN_VIEW(n) USE_VIEW(n); if (view_lock_level(n) > LockLevel_Open) return
@ -1580,7 +1580,7 @@ update_cli_handle_with_file(System_Functions *system, Models *models, CLI_Handle
App_Step_Sig(app_step){ App_Step_Sig(app_step){
Application_Step_Result app_result = *result; Application_Step_Result app_result = *app_result_;
app_result.animating = 0; app_result.animating = 0;
App_Vars *vars = (App_Vars*)memory->vars_memory; App_Vars *vars = (App_Vars*)memory->vars_memory;
@ -1682,24 +1682,24 @@ App_Step_Sig(app_step){
// NOTE(allen): detect mouse hover status // NOTE(allen): detect mouse hover status
i32 mx = input->mouse.x; i32 mx = input->mouse.x;
i32 my = input->mouse.y; i32 my = input->mouse.y;
b32 mouse_in_edit_area = 0; b32 mouse_in_edit_area = false;
b32 mouse_in_margin_area = 0; b32 mouse_in_margin_area = false;
Panel *mouse_panel, *used_panels;
used_panels = &models->layout.used_sentinel; Panel *mouse_panel = 0;
for (dll_items(mouse_panel, used_panels)){ {
if (hit_check(mx, my, mouse_panel->inner)){ Panel *used_panels = &models->layout.used_sentinel, *panel = 0;
mouse_in_edit_area = 1; for (dll_items(panel, used_panels)){
break; if (hit_check(mx, my, panel->inner)){
mouse_panel = panel;
mouse_in_edit_area = true;
break;
}
else if (hit_check(mx, my, panel->full)){
mouse_panel = panel;
mouse_in_margin_area = true;
break;
}
} }
else if (hit_check(mx, my, mouse_panel->full)){
mouse_in_margin_area = 1;
break;
}
}
if (!(mouse_in_edit_area || mouse_in_margin_area)){
mouse_panel = 0;
} }
b32 mouse_on_divider = 0; b32 mouse_on_divider = 0;
@ -2642,7 +2642,7 @@ App_Step_Sig(app_step){
app_result.lctrl_lalt_is_altgr = models->settings.lctrl_lalt_is_altgr; app_result.lctrl_lalt_is_altgr = models->settings.lctrl_lalt_is_altgr;
app_result.perform_kill = !models->keep_playing; app_result.perform_kill = !models->keep_playing;
*result = app_result; *app_result_ = app_result;
// end-of-app_step // end-of-app_step
} }

12
4ed.h
View File

@ -105,12 +105,12 @@ struct Application_Step_Input{
String clipboard; String clipboard;
}; };
#define App_Step_Sig(name) void \ #define App_Step_Sig(name) void \
name(System_Functions *system, \ name(System_Functions *system, \
Render_Target *target, \ Render_Target *target, \
Application_Memory *memory, \ Application_Memory *memory, \
Application_Step_Input *input, \ Application_Step_Input *input, \
Application_Step_Result *result, \ Application_Step_Result *app_result_, \
Command_Line_Parameters params) Command_Line_Parameters params)
typedef App_Step_Sig(App_Step); typedef App_Step_Sig(App_Step);

View File

@ -1390,21 +1390,27 @@ stickieness_guess(Cpp_Token_Type type, Cpp_Token_Type other_type, u16 flags, u16
return(guess); return(guess);
} }
internal f32 struct Wrap_Current_Shift{
get_current_shift(Code_Wrap_State *wrap_state, i32 next_line_start, b32 *adjust_top_to_this){ f32 shift;
f32 current_shift = wrap_state->wrap_x.paren_nesting[wrap_state->wrap_x.paren_safe_top]; b32 adjust_top_to_this;
};
internal Wrap_Current_Shift
get_current_shift(Code_Wrap_State *wrap_state, i32 next_line_start){
Wrap_Current_Shift result = {0};
result.shift = wrap_state->wrap_x.paren_nesting[wrap_state->wrap_x.paren_safe_top];
Assert(adjust_top_to_this != 0);
if (wrap_state->token_ptr > wrap_state->token_array.tokens){ if (wrap_state->token_ptr > wrap_state->token_array.tokens){
Cpp_Token prev_token = *(wrap_state->token_ptr-1); Cpp_Token prev_token = *(wrap_state->token_ptr-1);
if (wrap_state->wrap_x.paren_safe_top != 0 && prev_token.type == CPP_TOKEN_PARENTHESE_OPEN){ if (wrap_state->wrap_x.paren_safe_top != 0 && prev_token.type == CPP_TOKEN_PARENTHESE_OPEN){
current_shift = wrap_state->wrap_x.paren_nesting[wrap_state->wrap_x.paren_safe_top-1] + wrap_state->tab_indent_amount; result.shift = wrap_state->wrap_x.paren_nesting[wrap_state->wrap_x.paren_safe_top-1] + wrap_state->tab_indent_amount;
*adjust_top_to_this = 1; result.adjust_top_to_this = 1;
} }
f32 statement_continuation_indent = 0.f; f32 statement_continuation_indent = 0.f;
if (current_shift != 0.f && wrap_state->wrap_x.paren_safe_top == 0){ if (result.shift != 0.f && wrap_state->wrap_x.paren_safe_top == 0){
if (!(prev_token.flags & (CPP_TFLAG_PP_DIRECTIVE|CPP_TFLAG_PP_BODY))){ if (!(prev_token.flags & (CPP_TFLAG_PP_DIRECTIVE|CPP_TFLAG_PP_BODY))){
switch (prev_token.type){ switch (prev_token.type){
case CPP_TOKEN_BRACKET_OPEN: case CPP_TOKEN_BRACKET_OPEN:
@ -1421,27 +1427,28 @@ get_current_shift(Code_Wrap_State *wrap_state, i32 next_line_start, b32 *adjust_
switch (wrap_state->token_ptr->type){ switch (wrap_state->token_ptr->type){
case CPP_TOKEN_BRACE_CLOSE: case CPP_TOKEN_BRACE_OPEN: break; case CPP_TOKEN_BRACE_CLOSE: case CPP_TOKEN_BRACE_OPEN: break;
default: current_shift += statement_continuation_indent; break; default: result.shift += statement_continuation_indent; break;
} }
} }
if (wrap_state->token_ptr->start < next_line_start){ if (wrap_state->token_ptr->start < next_line_start){
if (wrap_state->token_ptr->flags & CPP_TFLAG_PP_DIRECTIVE){ if (wrap_state->token_ptr->flags & CPP_TFLAG_PP_DIRECTIVE){
current_shift = 0; result.shift = 0;
} }
else{ else{
switch (wrap_state->token_ptr->type){ switch (wrap_state->token_ptr->type){
case CPP_TOKEN_BRACE_CLOSE: case CPP_TOKEN_BRACE_CLOSE:
{ {
if (wrap_state->wrap_x.paren_safe_top == 0){ if (wrap_state->wrap_x.paren_safe_top == 0){
current_shift -= wrap_state->tab_indent_amount; result.shift -= wrap_state->tab_indent_amount;
} }
}break; }break;
} }
} }
} }
return(current_shift); result.shift = clamp_bottom(0.f, result.shift);
return(result);
} }
internal void internal void
@ -1475,7 +1482,7 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
edge_tolerance = width; edge_tolerance = width;
} }
f32 line_shift = 0.f; f32 current_line_shift = 0.f;
b32 do_wrap = 0; b32 do_wrap = 0;
i32 wrap_unit_end = 0; i32 wrap_unit_end = 0;
@ -1505,7 +1512,7 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
i32 stage = 0; i32 stage = 0;
do{ do{
stop = buffer_measure_wrap_y(&state, params, line_shift, do_wrap, wrap_unit_end); stop = buffer_measure_wrap_y(&state, params, current_line_shift, do_wrap, wrap_unit_end);
switch (stop.status){ switch (stop.status){
case BLStatus_NeedWrapDetermination: case BLStatus_NeedWrapDetermination:
@ -1601,15 +1608,15 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
potential_count = 0; potential_count = 0;
stage = 0; stage = 0;
b32 adjust_top_to_this = 0; Wrap_Current_Shift current_shift = get_current_shift(&wrap_state, next_line_start);
f32 current_shift = get_current_shift(&wrap_state, next_line_start, &adjust_top_to_this);
if (adjust_top_to_this){
wrap_state_set_top(&wrap_state, current_shift); if (current_shift.adjust_top_to_this){
wrap_state_set_top(&wrap_state, current_shift.shift);
} }
wrap_indent_marks[real_count].wrap_position = 0; wrap_indent_marks[real_count].wrap_position = 0;
wrap_indent_marks[real_count].line_shift = clamp_bottom(0.f, current_shift); wrap_indent_marks[real_count].line_shift =current_shift.shift;
++real_count; ++real_count;
wrap_state.wrap_x.base_x = wrap_state.wrap_x.paren_nesting[0]; wrap_state.wrap_x.base_x = wrap_state.wrap_x.paren_nesting[0];
@ -1727,18 +1734,17 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
need_to_choose_a_wrap = 1; need_to_choose_a_wrap = 1;
} }
adjust_top_to_this = 0; current_shift = get_current_shift(&wrap_state, next_line_start);
current_shift = get_current_shift(&wrap_state, next_line_start, &adjust_top_to_this);
b32 next_token_is_on_line = 0; b32 next_token_is_on_line = 0;
if (wrap_state.token_ptr->start < next_line_start){ if (wrap_state.token_ptr->start < next_line_start){
next_token_is_on_line = 1; next_token_is_on_line = 1;
} }
i32 wrap_position = step.position_end; i32 next_wrap_position = step.position_end;
f32 wrap_x = step.final_x; f32 wrap_x = step.final_x;
if (wrap_state.token_ptr->start > step.position_start && wrap_position < wrap_state.token_ptr->start && next_token_is_on_line){ if (wrap_state.token_ptr->start > step.position_start && next_wrap_position < wrap_state.token_ptr->start && next_token_is_on_line){
wrap_position = wrap_state.token_ptr->start; next_wrap_position = wrap_state.token_ptr->start;
} }
if (!need_to_choose_a_wrap){ if (!need_to_choose_a_wrap){
@ -1781,18 +1787,18 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
wrappable_score = 64*50; wrappable_score = 64*50;
wrappable_score += 101 - general_stickieness - wrap_state.wrap_x.paren_safe_top*80; wrappable_score += 101 - general_stickieness - wrap_state.wrap_x.paren_safe_top*80;
potential_marks[potential_count].wrap_position = wrap_position; potential_marks[potential_count].wrap_position = next_wrap_position;
potential_marks[potential_count].line_shift = current_shift; potential_marks[potential_count].line_shift = current_shift.shift;
potential_marks[potential_count].wrappable_score = wrappable_score; potential_marks[potential_count].wrappable_score = wrappable_score;
potential_marks[potential_count].wrap_x = wrap_x; potential_marks[potential_count].wrap_x = wrap_x;
potential_marks[potential_count].adjust_top_to_this = adjust_top_to_this; potential_marks[potential_count].adjust_top_to_this = current_shift.adjust_top_to_this;
++potential_count; ++potential_count;
} }
if (need_to_choose_a_wrap){ if (need_to_choose_a_wrap){
if (potential_count == 0){ if (potential_count == 0){
wrap_indent_marks[real_count].wrap_position = wrap_position; wrap_indent_marks[real_count].wrap_position = next_wrap_position;
wrap_indent_marks[real_count].line_shift = current_shift; wrap_indent_marks[real_count].line_shift = current_shift.shift;
++real_count; ++real_count;
} }
else{ else{
@ -1867,30 +1873,25 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
} }
} }
line_shift = wrap_indent_marks[stage].line_shift; current_line_shift = wrap_indent_marks[stage].line_shift;
if (stage > 0){ if (stage > 0){
++stage; ++stage;
} }
if (line_shift < 0){ current_line_shift = clamp_bottom(0.f, current_line_shift);
line_shift = 0;
}
} }
else{ else{
line_shift = 0.f; current_line_shift = 0.f;
} }
if (line_shift > current_width - edge_tolerance){ current_line_shift = clamp_top(current_line_shift, current_width - edge_tolerance);
line_shift = current_width - edge_tolerance;
}
if (stop.wrap_line_index >= file->state.line_indent_max){ if (stop.wrap_line_index >= file->state.line_indent_max){
file_allocate_indents_as_needed(general, file, stop.wrap_line_index); file_allocate_indents_as_needed(general, file, stop.wrap_line_index);
} }
file->state.line_indents[stop.wrap_line_index] = line_shift; file->state.line_indents[stop.wrap_line_index] = current_line_shift;
file->state.wrap_line_count = stop.wrap_line_index; file->state.wrap_line_count = stop.wrap_line_index;
}break; }break;
} }
@ -2951,19 +2952,23 @@ file_update_history_before_edit(Mem_Options *mem, Editing_File *file, Edit_Step
Edit_Step *redo_start = redo_end; Edit_Step *redo_start = redo_end;
i32 steps_of_redo = 0; i32 steps_of_redo = 0;
i32 strings_of_redo = 0; i32 strings_of_redo = 0;
i32 undo_count = 0; {
while (redo_start->type == ED_REDO || redo_start->type == ED_UNDO){ i32 undo_count = 0;
if (redo_start->type == ED_REDO){ while (redo_start->type == ED_REDO || redo_start->type == ED_UNDO){
if (undo_count > 0) --undo_count; if (redo_start->type == ED_REDO){
else{ if (undo_count > 0){
++steps_of_redo; --undo_count;
strings_of_redo += redo_start->edit.len; }
else{
++steps_of_redo;
strings_of_redo += redo_start->edit.len;
}
} }
else{
++undo_count;
}
--redo_start;
} }
else{
++undo_count;
}
--redo_start;
} }
if (redo_start < redo_end){ if (redo_start < redo_end){
@ -2983,31 +2988,33 @@ file_update_history_before_edit(Mem_Options *mem, Editing_File *file, Edit_Step
Edit_Step *edit_src = redo_end; Edit_Step *edit_src = redo_end;
Edit_Step *edit_dest = file->state.undo.redo.edits + file->state.undo.redo.edit_count + steps_of_redo; Edit_Step *edit_dest = file->state.undo.redo.edits + file->state.undo.redo.edit_count + steps_of_redo;
i32 undo_count = 0; {
for (i32 i = 0; i < steps_of_redo;){ i32 undo_count = 0;
--edit_src; for (i32 i = 0; i < steps_of_redo;){
str_src -= edit_src->edit.len; --edit_src;
if (edit_src->type == ED_REDO){ str_src -= edit_src->edit.len;
if (undo_count > 0){ if (edit_src->type == ED_REDO){
--undo_count; if (undo_count > 0){
--undo_count;
}
else{
++i;
--edit_dest;
*edit_dest = *edit_src;
str_redo_pos -= edit_dest->edit.len;
edit_dest->edit.str_start = str_redo_pos;
memcpy(str_dest_base + str_redo_pos, str_src, edit_dest->edit.len);
}
} }
else{ else{
++i; ++undo_count;
--edit_dest;
*edit_dest = *edit_src;
str_redo_pos -= edit_dest->edit.len;
edit_dest->edit.str_start = str_redo_pos;
memcpy(str_dest_base + str_redo_pos, str_src, edit_dest->edit.len);
} }
} }
else{ Assert(undo_count == 0);
++undo_count;
}
} }
Assert(undo_count == 0);
file->state.undo.redo.size += strings_of_redo; file->state.undo.redo.size += strings_of_redo;
file->state.undo.redo.edit_count += steps_of_redo; file->state.undo.redo.edit_count += steps_of_redo;
@ -4743,10 +4750,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
Editing_File *file = view->file_data.file; Editing_File *file = view->file_data.file;
Assert(file != 0); Assert(file != 0);
//Font_Set *font_set = models->font_set; message = make_lit_string("Back");
//Font_Info *info = 0;
String message = make_lit_string("Back");
id.id[0] = 0; id.id[0] = 0;
if (gui_do_button(target, id, message)){ if (gui_do_button(target, id, message)){
@ -4803,7 +4807,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
u32 *fore = 0, *back = 0; u32 *fore = 0, *back = 0;
i32 i = 0; i32 i = 0;
String message = make_lit_string("Back"); message = make_lit_string("Back");
id.id[0] = 0; id.id[0] = 0;
if (gui_do_button(target, id, message)){ if (gui_do_button(target, id, message)){
@ -4915,7 +4919,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
autocomplete_with_enter = 0; autocomplete_with_enter = 0;
} }
String message = {0}; String message = null_string;
switch (view->action){ switch (view->action){
case IAct_Open: message = make_lit_string("Open: "); break; case IAct_Open: message = make_lit_string("Open: "); break;
case IAct_Save_As: message = make_lit_string("Save As: "); break; case IAct_Save_As: message = make_lit_string("Save As: "); break;
@ -4927,8 +4931,6 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
GUI_Item_Update update = {0}; GUI_Item_Update update = {0};
Hot_Directory *hdir = &models->hot_directory; Hot_Directory *hdir = &models->hot_directory;
b32 do_new_directory = 0;
i32 i = 0;
{ {
Single_Line_Input_Step step = {0}; Single_Line_Input_Step step = {0};
@ -4969,8 +4971,9 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
gui_standard_list(target, id, &view->gui_scroll, view->scroll_region, &keys, &view->list_i, &update, user_up_key, user_down_key); gui_standard_list(target, id, &view->gui_scroll, view->scroll_region, &keys, &view->list_i, &update, user_up_key, user_down_key);
} }
b32 do_new_directory = false;
begin_exhaustive_loop(&loop, hdir); begin_exhaustive_loop(&loop, hdir);
for (i = 0; i < loop.count; ++i){ for (i32 i = 0; i < loop.count; ++i){
file_info = get_exhaustive_info(system, &models->working_set, &loop, i); file_info = get_exhaustive_info(system, &models->working_set, &loop, i);
if (file_info.name_match){ if (file_info.name_match){
@ -5013,7 +5016,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
local_persist String message_unsaved = make_lit_string(" *"); local_persist String message_unsaved = make_lit_string(" *");
local_persist String message_unsynced = make_lit_string(" !"); local_persist String message_unsynced = make_lit_string(" !");
String message = {0}; String message = null_string;
switch (view->action){ switch (view->action){
case IAct_Switch: message = make_lit_string("Switch: "); break; case IAct_Switch: message = make_lit_string("Switch: "); break;
case IAct_Kill: message = make_lit_string("Kill: "); break; case IAct_Kill: message = make_lit_string("Kill: "); break;
@ -6497,10 +6500,10 @@ do_render_file_view(System_Functions *system, View *view, GUI_Scroll_Vars *scrol
{ {
GUI_Interactive *b = (GUI_Interactive*)h; GUI_Interactive *b = (GUI_Interactive*)h;
void *ptr = (b + 1); void *ptr = (b + 1);
Font_ID font_id = (Font_ID)gui_read_integer(&ptr); Font_ID this_font_id = (Font_ID)gui_read_integer(&ptr);
String t = gui_read_string(&ptr); String t = gui_read_string(&ptr);
draw_font_button(system, gui_target, target, view, gui_session.rect, b->id, font_id, t); draw_font_button(system, gui_target, target, view, gui_session.rect, b->id, this_font_id, t);
}break; }break;
case guicom_file_option: case guicom_file_option:

View File

@ -28,15 +28,15 @@ ABS(f32 x){
inline f32 inline f32
MOD(f32 x, i32 m){ MOD(f32 x, i32 m){
f32 whole, frac, r; f32 whole;
frac = modff(x, &whole); f32 frac = modff(x, &whole);
r = ((i32)(whole) % m) + frac; f32 r = ((i32)(whole) % m) + frac;
return(r); return(r);
} }
inline f32 inline f32
SQRT(f32 x){ SQRT(f32 x){
f32 r = sqrt(x); f32 r = sqrtf(x);
return(r); return(r);
} }

View File

@ -1,5 +1,6 @@
@echo off @echo off
REM TODO(allen): Figure out a way to find vcvarsall for any MSVC version.
IF NOT DEFINED LIB (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64) IF NOT DEFINED LIB (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64)
SET SRC=%1 SET SRC=%1
@ -15,9 +16,10 @@ REM This stores the path of the buildsuper.bat script
REM in CODE_HOME. This way you can always include the REM in CODE_HOME. This way you can always include the
REM default files no matter where you store your code. REM default files no matter where you store your code.
REM And no matter how you call buildsuper.bat. REM And no matter how you call buildsuper.bat.
SET CODE_HOME=%~dp0 SET CODE_HOME=%~dp0
cl /I%CODE_HOME% %OPTS% %DEBUG% %SRC% /Fecustom_4coder %BUILD_DLL% %EXPORTS% cl %OPTS% /I"%CODE_HOME% " %DEBUG% "%SRC%" /Fecustom_4coder %BUILD_DLL% %EXPORTS%
REM file spammation preventation REM file spammation preventation
del *.exp del *.exp

View File

@ -647,9 +647,9 @@ buffer_convert_out(Gap_Buffer *buffer, char *dest, i32 max){
if (buffer_stringify_loop(&stream, buffer, 0, size)){ if (buffer_stringify_loop(&stream, buffer, 0, size)){
b32 still_looping = 0; b32 still_looping = 0;
do{ do{
i32 size = stream.end - i; i32 chunk_size = stream.end - i;
i32 out_size = 0; i32 out_size = 0;
i32 result = eol_convert_out(dest + pos, max - pos, stream.data + i, size, &out_size); i32 result = eol_convert_out(dest + pos, max - pos, stream.data + i, chunk_size, &out_size);
assert(result); assert(result);
i = stream.end; i = stream.end;
pos += out_size; pos += out_size;

View File

@ -576,6 +576,7 @@ int main(int argc, char **argv){
generate_keycode_enum(); generate_keycode_enum();
generate_style(); generate_style();
generate_custom_headers(); generate_custom_headers();
printf("Metagen finished\n");
} }
// BOTTOM // BOTTOM

View File

@ -72,7 +72,7 @@ static i32 prev_error = 0;
int32_t n = snprintf(SF_CMD, sizeof(SF_CMD), __VA_ARGS__); \ int32_t n = snprintf(SF_CMD, sizeof(SF_CMD), __VA_ARGS__); \
AllowLocal(n); \ AllowLocal(n); \
Assert(n < sizeof(SF_CMD)); \ Assert(n < sizeof(SF_CMD)); \
/** printf("%s\n", SF_CMD); /**/ \ /**/ printf("%s\n", SF_CMD); /**/ \
prev_error = system(SF_CMD); \ prev_error = system(SF_CMD); \
if (prev_error != 0) error_state = 1; \ if (prev_error != 0) error_state = 1; \
}while(0) }while(0)

View File

@ -351,7 +351,7 @@ buildsuper(char *code_path, char *out_path, char *filename, b32 x86_build){
} }
#elif defined(IS_GCC) #elif defined(IS_GCC)
{ {
systemf("\"%s/buildsuper.sh\" %s", code_path, filename); systemf("\"%s/buildsuper.sh\" \"%s\"", code_path, filename);
} }
#else #else
#error The build rule for this compiler is not ready #error The build rule for this compiler is not ready
@ -401,7 +401,7 @@ metagen(char *cdir){
} }
if (prev_error == 0){ if (prev_error == 0){
DECL_STR(cmd, META_DIR"/metagen"); DECL_STR(cmd, META_DIR "/metagen");
BEGIN_TIME_SECTION(); BEGIN_TIME_SECTION();
execute_in_dir(cdir, cmd, 0); execute_in_dir(cdir, cmd, 0);
END_TIME_SECTION("run metagen"); END_TIME_SECTION("run metagen");

View File

@ -912,9 +912,9 @@ parameter_parse(Partition *part, char *data, Cpp_Token *args_start_token, Cpp_To
param_name_token->start > param_string_start; param_name_token->start > param_string_start;
--param_name_token){ --param_name_token){
if (param_name_token->type == CPP_TOKEN_IDENTIFIER){ if (param_name_token->type == CPP_TOKEN_IDENTIFIER){
int32_t start = param_name_token->start; int32_t name_start = param_name_token->start;
int32_t size = param_name_token->size; int32_t name_size = param_name_token->size;
breakdown.args[arg_index].param_name = make_string(data + start, size); breakdown.args[arg_index].param_name = make_string(data + name_start, name_size);
break; break;
} }
} }
@ -1190,7 +1190,7 @@ macro_parse(Partition *part, Parse_Context *context, Item_Node *item){
} }
static Meta_Unit static Meta_Unit
compile_meta_unit(Partition *part, char *code_directory, char **files, Meta_Keywords *keywords, int32_t key_count){ compile_meta_unit(Partition *part, char *code_directory, char **files, Meta_Keywords *meta_keywords, int32_t key_count){
Meta_Unit unit = {0}; Meta_Unit unit = {0};
int32_t file_count = 0; int32_t file_count = 0;
@ -1232,8 +1232,8 @@ compile_meta_unit(Partition *part, char *code_directory, char **files, Meta_Keyw
String lexeme = get_lexeme(*token, context->data); String lexeme = get_lexeme(*token, context->data);
int32_t match_index = 0; int32_t match_index = 0;
if (string_set_match_table(keywords, sizeof(*keywords), key_count, lexeme, &match_index)){ if (string_set_match_table(meta_keywords, sizeof(*meta_keywords), key_count, lexeme, &match_index)){
Item_Type type = keywords[match_index].type; Item_Type type = meta_keywords[match_index].type;
if (type > Item_Null && type < Item_Type_Count){ if (type > Item_Null && type < Item_Type_Count){
++unit.set.count; ++unit.set.count;
@ -1265,8 +1265,8 @@ compile_meta_unit(Partition *part, char *code_directory, char **files, Meta_Keyw
String lexeme = get_lexeme(*token, context->data); String lexeme = get_lexeme(*token, context->data);
int32_t match_index = 0; int32_t match_index = 0;
if (string_set_match_table(keywords, sizeof(*keywords), key_count, lexeme, &match_index)){ if (string_set_match_table(meta_keywords, sizeof(*meta_keywords), key_count, lexeme, &match_index)){
Item_Type type = keywords[match_index].type; Item_Type type = meta_keywords[match_index].type;
switch (type){ switch (type){
case Item_Function: case Item_Function:
@ -1364,9 +1364,9 @@ compile_meta_unit(Partition *part, char *code_directory, char **files, Meta_Keyw
} }
static Meta_Unit static Meta_Unit
compile_meta_unit(Partition *part, char *code_directory, char *file, Meta_Keywords *keywords, int32_t key_count){ compile_meta_unit(Partition *part, char *code_directory, char *file, Meta_Keywords *meta_keywords, int32_t key_count){
char *file_array[2] = {file, 0}; char *file_array[2] = {file, 0};
Meta_Unit unit = compile_meta_unit(part, code_directory, file_array, keywords, key_count); Meta_Unit unit = compile_meta_unit(part, code_directory, file_array, meta_keywords, key_count);
return(unit); return(unit);
} }