diff options
author | Daniel Mack <github@zonque.org> | 2015-11-10 21:01:35 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-11-10 21:01:35 +0100 |
commit | e3c4a681db0b7004904b95d55fd1a443161c9397 (patch) | |
tree | a5b08abba6a533a3c4fc2a8f1bb9097957580c46 /CODING_STYLE | |
parent | 092b6e188b6b75be4450c6f20fc82599dcaf9552 (diff) | |
parent | de7399eb7427da46c5cd355181080274f69567a2 (diff) |
Merge pull request #1835 from poettering/grabbag-of-stuff
Lots of small fixes
Diffstat (limited to 'CODING_STYLE')
-rw-r--r-- | CODING_STYLE | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/CODING_STYLE b/CODING_STYLE index 8b945cd3c1..0064303203 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -145,11 +145,15 @@ - Think about the types you use. If a value cannot sensibly be negative, do not use "int", but use "unsigned". -- Do not use types like "short". They *never* make sense. Use ints, - longs, long longs, all in unsigned+signed fashion, and the fixed - size types uint32_t and so on, as well as size_t, but nothing - else. Do not use kernel types like u32 and so on, leave that to the - kernel. +- Use "char" only for actual characters. Use "uint8_t" or "int8_t" + when you actually mean a byte-sized signed or unsigned + integers. When referring to a generic byte, we generally prefer the + unsigned variant "uint8_t". Do not use types based on "short". They + *never* make sense. Use ints, longs, long longs, all in + unsigned+signed fashion, and the fixed size types + uint8_t/uint16_t/uint32_t/uint64_t/int8_t/int16_t/int32_t and so on, + as well as size_t, but nothing else. Do not use kernel types like + u32 and so on, leave that to the kernel. - Public API calls (i.e. functions exported by our shared libraries) must be marked "_public_" and need to be prefixed with "sd_". No |