diff --git a/codegen/datatypes.py b/codegen/datatypes.py index fab1b9d..58e5baa 100644 --- a/codegen/datatypes.py +++ b/codegen/datatypes.py @@ -162,7 +162,7 @@ class CFunc: return f"{str(self)};\n" def define(self) -> str: - return f"{str(self)} {{\n{self.body}\n}}\n\n" + return f"{str(self)} {{\n{self.body}}}\n\n" @dataclass diff --git a/codegen/dbl_list/snippets/list_empty b/codegen/dbl_list/snippets/list_empty index 93380be..a5e2c4a 100644 --- a/codegen/dbl_list/snippets/list_empty +++ b/codegen/dbl_list/snippets/list_empty @@ -4,5 +4,5 @@ u64 count = list->node_count; for (u64 i = 0; i < count; ++i) {{ - wapp_{T}_list_pop_back(list); + wapp_{Tlower}_list_pop_back(list); }} diff --git a/codegen/dbl_list/snippets/list_insert b/codegen/dbl_list/snippets/list_insert index 88f45b6..e8eb294 100644 --- a/codegen/dbl_list/snippets/list_insert +++ b/codegen/dbl_list/snippets/list_insert @@ -3,14 +3,14 @@ }} if (index == 0) {{ - wapp_{T}_list_push_front(list, node); + wapp_{Tlower}_list_push_front(list, node); return; }} else if (index == list->node_count) {{ - wapp_{T}_list_push_back(list, node); + wapp_{Tlower}_list_push_back(list, node); return; }} - {T}Node *dst_node = wapp_{T}_list_get(list, index); + {T}Node *dst_node = wapp_{Tlower}_list_get(list, index); if (!dst_node) {{ return; }} diff --git a/codegen/dbl_list/snippets/list_remove b/codegen/dbl_list/snippets/list_remove index 31d0a39..90095b5 100644 --- a/codegen/dbl_list/snippets/list_remove +++ b/codegen/dbl_list/snippets/list_remove @@ -4,14 +4,14 @@ }} if (index == 0) {{ - output = wapp_{T}_list_pop_front(list); + output = wapp_{Tlower}_list_pop_front(list); goto RETURN_{Tupper}_LIST_REMOVE; }} else if (index == list->node_count) {{ - output = wapp_{T}_list_pop_back(list); + output = wapp_{Tlower}_list_pop_back(list); goto RETURN_{Tupper}_LIST_REMOVE; }} - output = wapp_{T}_list_get(list, index); + output = wapp_{Tlower}_list_get(list, index); if (!output) {{ goto RETURN_{Tupper}_LIST_REMOVE; }} diff --git a/codegen/dbl_list/snippets/node_to_list b/codegen/dbl_list/snippets/node_to_list index 6f88b81..b11a634 100644 --- a/codegen/dbl_list/snippets/node_to_list +++ b/codegen/dbl_list/snippets/node_to_list @@ -1,4 +1,4 @@ - {T}List output = {{.first = node, .last = node, .total_size = node->item->size, .node_count = 1}}; + {T}List output = {{.first = node, .last = node, .node_count = 1}}; while (output.first->prev != NULL) {{ output.first = output.first->prev;