Open
Conversation
mahir-mahota
requested changes
Mar 13, 2024
.DS_Store
Outdated
Contributor
There was a problem hiding this comment.
delete files added to .gitignore in develop
.idea/vcs.xml
Outdated
.idea/workspace.xml
Outdated
Common/.DS_Store
Outdated
Common/Src/circ_queue.c
Outdated
| #include "circ_queue.h" | ||
|
|
||
| // Function to increment head pointer | ||
| void inc_head(Queue_t *self) { |
Contributor
There was a problem hiding this comment.
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; |
Contributor
There was a problem hiding this comment.
_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, |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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; | ||
| } | ||
| } | ||
| } No newline at end of file |
Contributor
There was a problem hiding this comment.
add a newline at the end of both files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.