-
Notifications
You must be signed in to change notification settings - Fork 43
LIST namespace #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
LIST namespace #234
Conversation
rewrite/src/exe/list.c
Outdated
|
||
void LIST_AddFront(LinkedList* list, Item* item) | ||
{ | ||
if (item == NULL) |
There was a problem hiding this comment.
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(); }
include/ctr/list.h
Outdated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
rewrite/src/exe/list.c
Outdated
|
||
void LIST_Init(LinkedList* list, Item* item, int itemSize, int numItems) | ||
{ | ||
while (numItems > 0) |
There was a problem hiding this comment.
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
WIP, need to adjust coll to work with new backup system still.