Skip to content
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 coding style in rtp module. #1083

Merged
merged 1 commit into from
Aug 13, 2018
Merged

Fix coding style in rtp module. #1083

merged 1 commit into from
Aug 13, 2018

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Aug 12, 2018

  • Named callback types only.
  • No anonymous enums or structs.
  • ++i instead of i++.
  • Don't use enums to specify integer constants. Enums should be
    enumerations. All values of an enum type should be listed[1].

[1] I don't know what to do about bit masks yet, but given that enums by
C standard can only go up to 32767 portably and 2^31 in reality, they are
probably not useful for 64 bit bit masks.


This change is Reviewable

@iphydf iphydf added this to the v0.2.x milestone Aug 12, 2018
@iphydf iphydf force-pushed the rtp-style branch 2 times, most recently from cc69f9b to 32cbfc7 Compare August 12, 2018 23:18
* Named callback types only.
* No anonymous enums or structs.
* `++i` instead of `i++`.
* Don't use enums to specify integer constants. Enums should be
  enumerations. All values of an enum type should be listed[1].

[1] I don't know what to do about bit masks yet, but given that enums by
C standard can only go up to 32767 portably and 2^31 in reality, they are
probably not useful for 64 bit bit masks.
@@ -586,12 +583,14 @@ static int handle_rtp_packet(Messenger *m, uint32_t friendnumber, const uint8_t
size_t rtp_header_pack(uint8_t *const rdata, const struct RTPHeader *header)
{
uint8_t *p = rdata;
*p++ = (header->ve & 3) << 6
Copy link
Member

Choose a reason for hiding this comment

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

Yikes

Copy link

Choose a reason for hiding this comment

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

zoink

Copy link
Member

@hugbubby hugbubby left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@iphydf iphydf merged commit df9033d into TokTok:master Aug 13, 2018
@iphydf iphydf deleted the rtp-style branch August 13, 2018 10:36
@robinlinden robinlinden modified the milestones: v0.2.x, v0.2.6 Aug 14, 2018
This pull request was closed.
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.

4 participants