diff options
author | Jan Engelhardt <jengelh@inai.de> | 2014-06-28 00:49:12 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-06-28 00:06:31 -0400 |
commit | 45df8656ebb1b0559a75993d1508fc61c2d39829 (patch) | |
tree | 4ed625eade1c8ac27ea85269eb889adb848a9e0e /CODING_STYLE | |
parent | 8d0e0ddda6501479eb69164687c83c1a7667b33a (diff) | |
download | systemd-45df8656ebb1b0559a75993d1508fc61c2d39829.tar.gz |
doc: typographical improvements and choice of words
Diffstat (limited to 'CODING_STYLE')
-rw-r--r-- | CODING_STYLE | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CODING_STYLE b/CODING_STYLE index cb8d96c4cb..e192944124 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -41,11 +41,11 @@ - Don't synchronously talk to any other service from PID 1, due to risk of deadlocks -- Avoid fixed sized string buffers, unless you really know the maximum +- Avoid fixed-size string buffers, unless you really know the maximum size and that maximum size is small. They are a source of errors, - since they possibly result in truncated strings. Often it is nicer - to use dynamic memory, alloca() or VLAs. If you do allocate fixed - size strings on the stack, then it's probably only OK if you either + since they possibly result in truncated strings. It is often nicer + to use dynamic memory, alloca() or VLAs. If you do allocate fixed-size + strings on the stack, then it's probably only OK if you either use a maximum size such as LINE_MAX, or count in detail the maximum size a string can have. (DECIMAL_STR_MAX and DECIMAL_STR_WIDTH macros are your friends for this!) @@ -99,7 +99,7 @@ - Unless you allocate an array, "double" is always the better choice than "float". Processors speak "double" natively anyway, so this is - no speed benefit, and on calls like printf() "float"s get upgraded + no speed benefit, and on calls like printf() "float"s get promoted to "double"s anyway, so there is no point. - Don't invoke functions when you allocate variables on the stack. Wrong: |