-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fix groupav.c style and avoid casts in toxav_old.c. #1082
Conversation
e1fd22b
to
5d2fa96
Compare
return nullptr; | ||
} | ||
|
||
if (!(q->queue = (Group_Audio_Packet **)calloc(sizeof(Group_Audio_Packet *), size))) { |
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.
What are you some kinda babby who can't handle assigning variables within if statements
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.
If this question is serious, let me know and I'll be happy to talk about it.
@@ -516,7 +515,8 @@ static int send_audio_packet(Group_Chats *g_c, uint32_t groupnumber, uint8_t *pa | |||
|
|||
uint8_t data[MAX_CRYPTO_DATA_SIZE]; | |||
uint8_t *ptr = data; | |||
*ptr++ = GROUP_AUDIO_PACKET_ID; |
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.
dear god
|
||
uint16_t audio_sequnum; | ||
|
||
void (*audio_data)(Messenger *m, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, uint32_t samples, |
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 actually prefer this for its intuition
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.
The old stuff was actually so bad it blurs the line between style checks and bugfixing
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.
Reviewable status: complete! 1 of 1 approvals obtained
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.
Reviewed 3 of 3 files at r1.
Reviewable status: complete! 1 of 1 approvals obtained
* No anonymous structs. * No assignment expressions. * Only one declarator per struct member declaration. * Named callback types only, no inline types. * No `;` empty statements. * `++i` instead of `i++`. Avoiding a cast in toxav_old.c avoids some potential (and real) bugs.
;
empty statements.++i
instead ofi++
.Avoiding a cast in toxav_old.c avoids some potential (and real) bugs.
This change is