Skip to content

Fix coding style in rtp module. - #1083

Merged
iphydf merged 1 commit into
TokTok:masterfrom
iphydf:rtp-style
Aug 13, 2018
Merged

Fix coding style in rtp module.#1083
iphydf merged 1 commit into
TokTok:masterfrom
iphydf:rtp-style

Conversation

@iphydf

@iphydf iphydf commented Aug 12, 2018

Copy link
Copy Markdown
Member
  • 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.
Comment thread toxav/rtp.c
size_t rtp_header_pack(uint8_t *const rdata, const struct RTPHeader *header)
{
uint8_t *p = rdata;
*p++ = (header->ve & 3) << 6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yikes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

zoink

@hugbubby hugbubby left a comment

Copy link
Copy Markdown
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants