Upgrade codegen
This commit is contained in:
@@ -4,13 +4,16 @@
|
||||
|
||||
#include "./str8_list.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "./str8.h"
|
||||
#include <stddef.h>
|
||||
|
||||
internal Str8List str8_node_to_list(Str8Node *node);
|
||||
|
||||
Str8Node wapp_str8_list_node(Str8 *item) {
|
||||
return (Str8Node){.item = item};
|
||||
}
|
||||
|
||||
Str8Node *wapp_str8_list_get(const Str8List *list, u64 index) {
|
||||
if (index >= list->node_count) {
|
||||
if (index >= list->node_count) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -26,7 +29,7 @@ if (index >= list->node_count) {
|
||||
}
|
||||
|
||||
void wapp_str8_list_push_front(Str8List *list, Str8Node *node) {
|
||||
if (!list || !node || !(node->item)) {
|
||||
if (!list || !node || !(node->item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,7 +52,7 @@ if (!list || !node || !(node->item)) {
|
||||
}
|
||||
|
||||
void wapp_str8_list_push_back(Str8List *list, Str8Node *node) {
|
||||
if (!list || !node || !(node->item)) {
|
||||
if (!list || !node || !(node->item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +75,7 @@ if (!list || !node || !(node->item)) {
|
||||
}
|
||||
|
||||
void wapp_str8_list_insert(Str8List *list, Str8Node *node, u64 index) {
|
||||
if (!list || !node || !(node->item)) {
|
||||
if (!list || !node || !(node->item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -103,7 +106,7 @@ if (!list || !node || !(node->item)) {
|
||||
}
|
||||
|
||||
Str8Node *wapp_str8_list_pop_front(Str8List *list) {
|
||||
Str8Node *output = NULL;
|
||||
Str8Node *output = NULL;
|
||||
|
||||
if (!list || list->node_count == 0) {
|
||||
goto RETURN_STR8_LIST_POP_FRONT;
|
||||
@@ -126,7 +129,7 @@ RETURN_STR8_LIST_POP_FRONT:
|
||||
}
|
||||
|
||||
Str8Node *wapp_str8_list_pop_back(Str8List *list) {
|
||||
Str8Node *output = NULL;
|
||||
Str8Node *output = NULL;
|
||||
|
||||
if (!list || list->node_count == 0) {
|
||||
goto RETURN_STR8_LIST_POP_BACK;
|
||||
@@ -149,7 +152,7 @@ RETURN_STR8_LIST_POP_BACK:
|
||||
}
|
||||
|
||||
Str8Node *wapp_str8_list_remove(Str8List *list, u64 index) {
|
||||
Str8Node *output = NULL;
|
||||
Str8Node *output = NULL;
|
||||
if (!list) {
|
||||
goto RETURN_STR8_LIST_REMOVE;
|
||||
}
|
||||
@@ -179,7 +182,7 @@ RETURN_STR8_LIST_REMOVE:
|
||||
}
|
||||
|
||||
void wapp_str8_list_empty(Str8List *list) {
|
||||
if (!list) {
|
||||
if (!list) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -190,7 +193,7 @@ if (!list) {
|
||||
}
|
||||
|
||||
internal Str8List str8_node_to_list(Str8Node *node) {
|
||||
Str8List output = {.first = node, .last = node, .node_count = 1};
|
||||
Str8List output = {.first = node, .last = node, .node_count = 1};
|
||||
|
||||
while (output.first->prev != NULL) {
|
||||
output.first = output.first->prev;
|
||||
|
@@ -27,6 +27,7 @@ struct Str8List {
|
||||
u64 node_count;
|
||||
};
|
||||
|
||||
Str8Node wapp_str8_list_node(Str8 *item);
|
||||
Str8Node *wapp_str8_list_get(const Str8List *list, u64 index);
|
||||
void wapp_str8_list_push_front(Str8List *list, Str8Node *node);
|
||||
void wapp_str8_list_push_back(Str8List *list, Str8Node *node);
|
||||
|
Reference in New Issue
Block a user