Skip to content

Conversation

TheUbMunster
Copy link
Contributor

@TheUbMunster TheUbMunster commented Sep 30, 2025

WIP, need to adjust coll to work with new backup system still.


void LIST_AddFront(LinkedList* list, Item* item)
{
if (item == NULL)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for short one line if statements, just do if (cond) { action(); }

Item* LIST_RemoveMember(LinkedList* L, Item* I);
Item* LIST_RemoveFront(LinkedList* L);
Item* LIST_RemoveBack(LinkedList* L);
void LIST_Init(LinkedList* L, Item* item, int itemSize, int numItems); No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set itemSize as unsigned? Also, try using const Type* every time the function doesn't modify the contents that the variable is pointing to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning on looking closer at the asm to figure out the signs (I imagine it's fine to make it unsigned, but I wanted to check)


void LIST_Init(LinkedList* list, Item* item, int itemSize, int numItems)
{
while (numItems > 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer doing for loops over while loops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants