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 style in DHT.c. #994

Merged
merged 1 commit into from
Jul 12, 2018
Merged

Fix style in DHT.c. #994

merged 1 commit into from
Jul 12, 2018

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jul 9, 2018

  • Removed ARRAY_SIZE and use NULL markers for end of array, instead.
    The alternative is + size, but for these arrays, NULL markers made
    sense, since they are arrays of non-null pointers.
  • Made INDEX_OF_PK a self-contained macro, not dependent upon the
    naming inside its call site. This is a minor change but makes the code
    more local and reviews easier.
  • No nested structs.
  • Use only named function types ending in _cb for callbacks.
  • Replaced two macros with functions.
  • ++i instead of i++.
  • struct member names start with lowercase letters.
  • It takes a bit of work to support /**/ comments in preprocessor
    macros, so I've decided not to support these. If a macro is complex
    enough to need comments inside it, it's too complex. // comments are
    allowed at the end of macro definitions.

This change is Reviewable

@iphydf iphydf added this to the v0.2.x milestone Jul 9, 2018
@iphydf iphydf force-pushed the dht-style-fixes branch 3 times, most recently from 4285769 to 0e231a1 Compare July 10, 2018 15:24
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 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained

* Removed `ARRAY_SIZE` and use NULL markers for end of array, instead.
  The alternative is + size, but for these arrays, NULL markers made
  sense, since they are arrays of non-null pointers.
* Made `INDEX_OF_PK` a self-contained macro, not dependent upon the
  naming inside its call site. This is a minor change but makes the code
  more local and reviews easier.
* No nested structs.
* Use only named function types ending in `_cb` for callbacks.
* Replaced two macros with functions.
* `++i` instead of `i++`.
* struct member names start with lowercase letters.
* It takes a bit of work to support `/**/` comments in preprocessor
  macros, so I've decided not to support these. If a macro is complex
  enough to need comments inside it, it's too complex. `//` comments are
  allowed at the end of macro definitions.
* Callback typedefs must name their parameters.
@iphydf iphydf merged commit cbda010 into TokTok:master Jul 12, 2018
@iphydf iphydf deleted the dht-style-fixes branch July 12, 2018 09:53
@iphydf iphydf modified the milestones: v0.2.x, v0.2.4 Jul 16, 2018
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.

None yet

2 participants