Corrections while implementing odin bindings

This commit is contained in:
Edward R. Gonzalez 2025-02-03 09:42:31 -05:00
parent 13ebd105c4
commit d08efcb5ef
3 changed files with 18 additions and 18 deletions

View File

@ -239,18 +239,18 @@ template< class Type> forceinline Type tmpl_cast( Code self ) { return * rcast(
#pragma region Code C-Interface
GEN_API void code_append (Code code, Code other );
void code_append (Code code, Code other );
GEN_API Str code_debug_str (Code code);
GEN_API Code code_duplicate (Code code);
GEN_API Code* code_entry (Code code, u32 idx );
GEN_API bool code_has_entries (Code code);
GEN_API bool code_is_body (Code code);
Code* code_entry (Code code, u32 idx );
bool code_has_entries (Code code);
bool code_is_body (Code code);
GEN_API bool code_is_equal (Code code, Code other);
GEN_API bool code_is_valid (Code code);
GEN_API void code_set_global (Code code);
bool code_is_valid (Code code);
void code_set_global (Code code);
GEN_API StrBuilder code_to_strbuilder (Code self );
GEN_API void code_to_strbuilder_ptr(Code self, StrBuilder* result );
GEN_API Str code_type_str (Code self );
Str code_type_str (Code self );
GEN_API bool code_validate_body (Code self );
#pragma endregion Code C-Interface
@ -399,7 +399,7 @@ struct AST
Code Value; // Parameter, Variable
};
union {
Code NextVar; // Variable; Possible way to handle comma separated variables declarations. ( , NextVar->Specs NextVar->Name NextVar->ArrExpr = NextVar->Value )
Code NextVar; // Variable
Code SuffixSpecs; // Typename, Function (Thanks Unreal)
Code PostNameMacro; // Only used with parameters for specifically UE_REQUIRES (Thanks Unreal)
};

View File

@ -227,7 +227,7 @@ struct AST_Enum
Code Parent;
CodeType Type;
ModuleFlag ModuleFlags;
char _PAD_UNUSED_[ sizeof(ModuleFlag) + sizeof(u32) ];
char _PAD_UNUSED_[ sizeof(u32) ];
};
static_assert( sizeof(AST_Enum) == sizeof(AST), "ERROR: AST_Enum is not the same size as AST");
@ -738,8 +738,8 @@ static_assert( sizeof(AST_PreprocessCond) == sizeof(AST), "ERROR: AST_Preprocess
struct AST_Specifiers
{
Specifier ArrSpecs[ AST_ArrSpecs_Cap ];
StrCached Name;
CodeSpecifiers NextSpecs;
StrCached Name;
Code Prev;
Code Next;
Token* Tok;
@ -1056,7 +1056,7 @@ struct AST_Typename
CodeSpecifiers SpecsFuncSuffix; // Only used for function signatures
};
};
StrCached Name;
StrCached Name;
Code Prev;
Code Next;
Token* Tok;
@ -1082,7 +1082,7 @@ struct AST_Typedef
char _PAD_PROPERTIES_2_[ sizeof(AST*) * 3 ];
};
};
StrCached Name;
StrCached Name;
Code Prev;
Code Next;
Token* Tok;

View File

@ -74,7 +74,7 @@ bool code_is_valid(Code self)
return self != nullptr && self->Type != CT_Invalid;
}
forceinline
bool code_has_entries(AST* self)
bool code_has_entries(Code self)
{
GEN_ASSERT(self);
return self->NumEntries > 0;
@ -169,12 +169,12 @@ void class_add_interface( CodeClass self, CodeTypename type )
// then you'll need to move this over to ParentType->next and update ParentAccess accordingly.
}
while ( possible_slot != nullptr )
while ( possible_slot->Next != nullptr )
{
possible_slot = cast(CodeTypename, possible_slot->Next);
}
possible_slot = type;
possible_slot->Next = type;
}
#pragma endregion CodeClass
@ -378,12 +378,12 @@ void struct_add_interface(CodeStruct self, CodeTypename type )
// then you'll need to move this over to ParentType->next and update ParentAccess accordingly.
}
while ( possible_slot != nullptr )
while ( possible_slot->Next != nullptr )
{
possible_slot = cast(CodeTypename, possible_slot->Next);
possible_slot->Next = cast(CodeTypename, possible_slot->Next);
}
possible_slot = type;
possible_slot->Next = type;
}
#pragma endregion Code