toxcore icon indicating copy to clipboard operation
toxcore copied to clipboard

Avoiding conditional directives that split up parts of statements.

Open marciomribeiro opened this issue 9 years ago • 10 comments

A suggestion to compile entire statements and expressions, as suggested by code style guidelines from the Linux Kernel and practitioners.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/CodingStyle#n892
https://www.cqse.eu/en/blog/living-in-the-ifdef-hell/

It might improve code understanding, maintainability and error-proneness.

marciomribeiro avatar Dec 04 '15 13:12 marciomribeiro

@marciomribeiro can you indent the #ifdefs as well?

GrayHatter avatar Jan 02 '16 21:01 GrayHatter

I've attached 2 files. Do you prefer Option1 or Option2?

Option 1: option1

Option 2: option2

marciomribeiro avatar Mar 08 '16 13:03 marciomribeiro

I like option 2

GrayHatter avatar Mar 08 '16 15:03 GrayHatter

Don't know why the CI build has failed. I didn't change anything but the indentation...

marciomribeiro avatar Mar 08 '16 19:03 marciomribeiro

that's normal, the tests are broken

On Tue, Mar 8, 2016 at 11:24 AM, Márcio Ribeiro [email protected] wrote:

Don't know why the CI build has failed. I didn't change anything but the indentation...

— Reply to this email directly or view it on GitHub https://github.com/irungentoo/toxcore/pull/1480#issuecomment-193930944.

GrayHatter avatar Mar 08 '16 19:03 GrayHatter

Is the pull request now ready to be accepted?!

marciomribeiro avatar Mar 08 '16 21:03 marciomribeiro

once I or someone else can review it yeah! thanks!

GrayHatter avatar Mar 08 '16 22:03 GrayHatter

@marciomribeiro you may want to reopen this on https://github.com/TokTok/toxcore

GrayHatter avatar Jul 09 '16 19:07 GrayHatter

Is this going to be merged or continued?

iphydf avatar Sep 22 '16 20:09 iphydf

Done.

marciomribeiro avatar Jan 12 '17 18:01 marciomribeiro