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
Move MAX, MIN and ABS to contiki-macros #883
Conversation
This is a good move, but please prefix the names with But I'd suggest using a shorter name than |
Is it a good Idea to make these commonly used macros unnecessarily long? Especially as I can see no good reason to prefix them. The definitions are kind of a standard. |
Lets put them in |
...I still don't see any advantage of using |
Good point, lets use the existing |
Ok, that seems reasonable. Will do. |
9e9b187
to
988defe
Compare
Ok, fixed. While at it, I noticed a very inconsistent used of "" and <> when including files. This may lead to some very ugly side-effect. IMO we should used <> for all files from the contiki-tree and "" only for the files in the same folder. On the other side, using "" for everything would allow easy overrides of header files. (All in all I assume that very few codes actually know the difference. ;) ) |
The Contiki code uses So it should be |
3bda586
to
9abd760
Compare
This is a welcome addition of macros, but the suggested macro that initiated this discussion is not included here: IS_POWER_OF_TWO. Perhaps we want this too, but I'm happy with the change as it is also. When this collection of macros may grow a bit later, however, it may be necessary to put it into another file than |
@nvt My original idea was to introduce a new |
👍 |
Where are we on this one? I mean it would naturally need rebased, but it'd be great to get an update (?) |
It would be great to merge this one now (after rebasing if needed), and to create a new PR later for #878. |
9abd760
to
8c78180
Compare
Getting this merged rather soon would be nice. Had to fix two new files. |
Sorry, rebase needed. |
8c78180
to
0e655a6
Compare
There you go. Rebase seems fine. :) |
@@ -39,7 +39,8 @@ | |||
#include <stdio.h> | |||
#include <string.h> | |||
|
|||
#include "contiki.h" | |||
#include <contiki.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to what @adamdunkels said, double quotes should be used here, not angle brackets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one slipped through. I'll look into it
@adamdunkels: In the end, are you happy with the naming? You did not say if you finally agreed with @cmorty arguments. I vote for simplicity here: a prefix would bring no benefits. |
0e655a6
to
0dab692
Compare
👍 from me. |
and another 👍 |
👍 |
Move MAX, MIN and ABS to contiki-macros
Based on the discussion in #878 I started moving MIN, MAX and ABS macros to an extra file.