diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-15 01:26:01 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2016-06-15 01:26:01 +0200 |
commit | 8e38570ebed346c00e58c3fcc998a4b305e83a36 (patch) | |
tree | e1c56e0c9b1ff621fb53cd98f48649f3fd999119 /CODING_STYLE | |
parent | util-lib: rework get_process_cmdline() (#3529) (diff) | |
download | systemd-8e38570ebed346c00e58c3fcc998a4b305e83a36.tar.gz systemd-8e38570ebed346c00e58c3fcc998a4b305e83a36.tar.bz2 systemd-8e38570ebed346c00e58c3fcc998a4b305e83a36.zip |
tree-wide: htonl() is weird, let's use htobe32() instead (#3538)
Super-important change, yeah!
Diffstat (limited to 'CODING_STYLE')
-rw-r--r-- | CODING_STYLE | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CODING_STYLE b/CODING_STYLE index e762d42ed..f31d76f8c 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -399,3 +399,10 @@ least initially), but it needs to be there. This is particularly important for objects that unprivileged users may allocate, but also matters for everything else any user may allocated. + +- htonl()/ntohl() and htons()/ntohs() are weird. Please use htobe32() and + htobe16() instead, it's much more descriptive, and actually says what really + is happening, after all htonl() and htons() don't operation on longs and + shorts as their name would suggest, but on uint32_t and uint16_t. Also, + "network byte order" is just a weird name for "big endian", hence we might + want to call it "big endian" right-away. |