Skip to content

Fix style in msi.c.#1078

Merged
iphydf merged 1 commit into
TokTok:masterfrom
iphydf:msi-style
Aug 12, 2018
Merged

Fix style in msi.c.#1078
iphydf merged 1 commit into
TokTok:masterfrom
iphydf:msi-style

Conversation

@iphydf
Copy link
Copy Markdown
Member

@iphydf iphydf commented Aug 12, 2018

  • Don't use anonymous enums (typedef enum { ... } Name;).
  • Don't use macros to generate structs (too magical, hard to grep).
  • Assign output parameter once, and don't access it a lot in the
    function body.
  • Don't pass type names as parameters to macros (this is C, we don't have
    templates, sorry).
  • All function-like macros must be do-while(0).
  • ++i instead of i++.
  • No assignment-expressions.
  • No void-casts.

This change is Reviewable

@iphydf iphydf added this to the v0.2.x milestone Aug 12, 2018
* Don't use anonymous enums (`typedef enum { ... } Name;`).
* Don't use macros to generate structs (too magical, hard to grep).
* Assign output parameter once, and don't access it a lot in the
  function body.
* Don't pass type names as parameters to macros (this is C, we don't have
  templates, sorry).
* All function-like macros must be do-while(0).
* `++i` instead of `i++`.
* No assignment-expressions.
* No void-casts.
@iphydf iphydf merged commit 04d894e into TokTok:master Aug 12, 2018
@iphydf iphydf deleted the msi-style branch August 12, 2018 21: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.

3 participants