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

Use named function types for group callbacks. #998

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jul 12, 2018

Also some other cleanups. This PR means that future PRs, i.e. the PGC PR,
must not break the rules established here.


This change is Reviewable

* Moved PAIR to toxav, where it's used (but really this should die).
* Replace most MIN calls with typed `min_*` calls. Didn't replace the
  ones where the desired semantics are unclear. Moved the MIN macro to
  the one place where it's still used.
* Avoid assignments in `while` loops. Instead, factored out the loop body
  into a separate `bool`-returning function.
* Use named types for callbacks (`_cb` types).
* Avoid assignments in `if` conditions.
* Removed `MAKE_REALLOC` and expanded its two calls. We can't have
  templates in C, and this fake templating is ugly and hard to analyse
  and debug (it expands on a single line).
* Moved epoll system include to the .c file, out of the .h file.
* Avoid assignments in expressions (`a = b = c;`).
* Avoid multiple declarators per struct member declaration.
* Fix naming inconsistencies.
* Replace `net_to_host` macro with function.
Copy link

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

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

@iphydf iphydf force-pushed the group-named-cb branch 2 times, most recently from 7efbaed to f602848 Compare July 12, 2018 21:14
Also some other cleanups. This PR means that future PRs, i.e. the PGC PR,
must not break the rules established here.
@iphydf iphydf merged commit 2377cac into TokTok:master Jul 12, 2018
@iphydf iphydf deleted the group-named-cb branch July 12, 2018 21:23
@iphydf iphydf modified the milestones: v0.2.x, v0.2.4 Jul 16, 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.

2 participants