-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/86dregyz4/circular queue #7
base: develop
Are you sure you want to change the base?
Conversation
.DS_Store
Outdated
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.
delete files added to .gitignore in develop
.idea/vcs.xml
Outdated
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.
delete
.idea/workspace.xml
Outdated
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.
delete
Common/.DS_Store
Outdated
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.
delete
Common/Src/circ_queue.c
Outdated
#include "circ_queue.h" | ||
|
||
// Function to increment head pointer | ||
void inc_head(Queue_t *self) { |
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.
make these two increment functions static if they only need to be accessed in this .c file
// Function to increment tail pointer | ||
void inc_tail(Queue_t *self) { | ||
if (++self->_tail == self->_arr + BUFF_SIZE) { | ||
self->_tail = self->_arr; |
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.
_head and _tail aren't defined as pointers
Common/Src/circ_queue.c
Outdated
Queue_t queue_init() { | ||
Queue_t ret = { | ||
.len = 0, | ||
._head = 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.
set _head and _tail to _arr to start
Common/Src/circ_queue.c
Outdated
*self->_tail = frame; | ||
inc_tail(self); | ||
if (self->len > 0) { | ||
inc_tail(self); |
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.
why does it increment twice if (len == 0)? I think you had the right logic before.
Common/Src/circ_queue.c
Outdated
current = self->_arr; | ||
} | ||
} | ||
} |
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.
add a newline at the end of both files
No description provided.