From e8bb381520324748469402a1e16c8d644b54b1df Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 14 Dec 2024 07:14:45 -0500 Subject: [PATCH] fixes --- base/components/code_serialization.cpp | 4 ++-- base/dependencies/strings.hpp | 2 +- gen_c_library/c_library.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/base/components/code_serialization.cpp b/base/components/code_serialization.cpp index 56344cd..2161c21 100644 --- a/base/components/code_serialization.cpp +++ b/base/components/code_serialization.cpp @@ -1371,7 +1371,7 @@ void var_to_strbuilder_ref(CodeVar self, StrBuilder* result ) strbuilder_append_str( result, self->Name ); - if ( self->ValueType->ArrExpr ) + if ( self->ValueType && self->ValueType->ArrExpr ) { strbuilder_append_fmt( result, "[ %SB ]", code_to_strbuilder(self->ValueType->ArrExpr) ); @@ -1454,7 +1454,7 @@ void var_to_strbuilder_ref(CodeVar self, StrBuilder* result ) if ( self->BitfieldSize ) strbuilder_append_fmt( result, "%SB %S : %SB", typename_to_strbuilder(self->ValueType), self->Name, code_to_strbuilder(self->BitfieldSize) ); - else if ( self->ValueType->ArrExpr ) + else if ( self->ValueType && self->ValueType->ArrExpr ) { strbuilder_append_fmt( result, "%SB %S[ %SB ]", typename_to_strbuilder(self->ValueType), self->Name, code_to_strbuilder(self->ValueType->ArrExpr) ); diff --git a/base/dependencies/strings.hpp b/base/dependencies/strings.hpp index e3870c6..788a553 100644 --- a/base/dependencies/strings.hpp +++ b/base/dependencies/strings.hpp @@ -599,7 +599,7 @@ void strbuilder_skip_line(StrBuilder str) } inline -void strip_space(StrBuilder str) +void strbuilder_strip_space(StrBuilder str) { char* write_pos = str; char* read_pos = str; diff --git a/gen_c_library/c_library.cpp b/gen_c_library/c_library.cpp index 5511481..5ece289 100644 --- a/gen_c_library/c_library.cpp +++ b/gen_c_library/c_library.cpp @@ -1466,7 +1466,7 @@ R"(#define ( code ) _Generic( (code), \ Code rf_header_parsing = refactor_and_format(header_parsing); Code rf_types = refactor_and_format(types); - Code rf_parser_types = refactor_and_format(parser_types); + Code rf_parser_types = refactor_and_format(parser_types); Code rf_ecode = refactor_and_format(ecode); Code rf_eoperator = refactor_and_format(eoperator); Code rf_especifier = refactor_and_format(especifier); @@ -1534,7 +1534,7 @@ R"(#define ( code ) _Generic( (code), \ header.print( r_header_macros ); header.print( header_generic_macros ); - header.print_fmt( "GEN_API_C_BEGIN\n" ); + header.print_fmt( "\nGEN_API_C_BEGIN\n" ); header.print( r_header_basic_types ); header.print( r_header_debug );