core: Provide functions for different byte orders#1699
core: Provide functions for different byte orders#1699miri64 merged 3 commits intoRIOT-OS:masterfrom Kijewski:issue-1586
Conversation
|
|
|
I'll try to do some testing now. |
|
And s/code/core/ again. |
|
Typo in title fixed. Typos in code fixed, too. |
|
Unit tests added. |
core/include/byteorder.h
Outdated
There was a problem hiding this comment.
In the network stack those are always above the type
typedef union __attribute__((packed)) {
…
} …;
I get that this might be better to not confuse coding-style tools (I'm looking at you astyle ಠ_ಠ), but can we discuss this please? I think a uniform code is always better.
There was a problem hiding this comment.
Your unicode is too strong for my font.
There was a problem hiding this comment.
I have no problem with
typedef union __attribute__((packed)) {
…
} …;will change.
|
I second @authmillenon concerning the style, but say ACK otherwise. |
|
@N8Fear, separated. |
There was a problem hiding this comment.
Some of these builtins seems to create warnings in other toolchains, too. E.g. with older versions of the CodeSourcery toolchain for ARM.
There was a problem hiding this comment.
E.g. with older versions of the CodeSourcery toolchain for ARM.
Then the user has to update.
There was a problem hiding this comment.
I thought if there's an ifdef anyway we could find a solution for vintage-lovers, too.
There was a problem hiding this comment.
Yes, of course we could. I was happy that I found that __builtin_bswapN() works for all platforms (well, for all but MSP with N=16), because the generated code for the fallback solution is extremely ugly. What do the warning messages read? If it works, then I would rather use a pragma to silence the warnings.
There was a problem hiding this comment.
I see. I'll check as soon I can access a computer with this toolchain installed again. But it's not a blocker anyway.
|
Anything left to discuss? |
|
Looks good to me. ACK |
|
I am not 100% sure if this is a core change. It adds a new file in |
|
I jump in: ACK & go |
core: Provide functions for different byte orders
Rationale: see #1586.