Update codegen
This commit is contained in:
@@ -67,6 +67,9 @@ def make_array(user_datatypes: Dict[CDataType, ArrayData] = {}):
|
||||
common_decl_types: List[CStruct] = []
|
||||
|
||||
datatypes: dict[CDataType, ArrayData] = {
|
||||
CType.VOID: ArrayData(
|
||||
array_typename="GenericArray",
|
||||
),
|
||||
"Str8": ArrayData(
|
||||
array_typename="Str8Array",
|
||||
hdr_decl_types=[
|
||||
@@ -77,13 +80,10 @@ def make_array(user_datatypes: Dict[CDataType, ArrayData] = {}):
|
||||
|
||||
for _type in CType:
|
||||
if _type == CType.VOID:
|
||||
datatypes[_type.value] = ArrayData(
|
||||
array_typename="GenericArray",
|
||||
)
|
||||
continue
|
||||
|
||||
type_title = _type.value.title()
|
||||
datatypes[_type.value] = ArrayData(
|
||||
datatypes[_type] = ArrayData(
|
||||
array_typename=f"{type_title}Array",
|
||||
)
|
||||
|
||||
@@ -137,7 +137,7 @@ def make_array(user_datatypes: Dict[CDataType, ArrayData] = {}):
|
||||
],
|
||||
)
|
||||
|
||||
if isinstance(_type, str) and _type == CType.VOID.value:
|
||||
if isinstance(_type, CType) and _type == CType.VOID:
|
||||
alloc_capacity_func = CFunc(
|
||||
name=f"_array_alloc_capacity",
|
||||
ret_type=array,
|
||||
|
Reference in New Issue
Block a user