mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Update C++ style guide:
- Allow unsigned types where defined overflow behavior is desired - Clarify that a function-closing } is permitted on the same line as an opening { for one-line functions Set svn:eol-style = native on google-c-style.el
This commit is contained in:
parent
219b1a61fd
commit
db0be8e44d
10
cppguide.xml
10
cppguide.xml
|
@ -2149,8 +2149,9 @@ Tashana Landray
|
||||||
You should not use the unsigned integer types such as
|
You should not use the unsigned integer types such as
|
||||||
<code>uint32_t</code>,
|
<code>uint32_t</code>,
|
||||||
unless the quantity you are representing is really a bit pattern
|
unless the quantity you are representing is really a bit pattern
|
||||||
rather than a number. In particular, do not use unsigned types to
|
rather than a number, or unless you need defined
|
||||||
say a number will never be negative. Instead, use
|
twos-complement overflow. In particular, do not use unsigned
|
||||||
|
types to say a number will never be negative. Instead, use
|
||||||
|
|
||||||
assertions for this.
|
assertions for this.
|
||||||
</p>
|
</p>
|
||||||
|
@ -3472,8 +3473,9 @@ Tashana Landray
|
||||||
<li> The open curly brace is always at the end of the same
|
<li> The open curly brace is always at the end of the same
|
||||||
line as the last parameter.
|
line as the last parameter.
|
||||||
</li>
|
</li>
|
||||||
<li> The close curly brace is always on the last line by
|
<li> The close curly brace is either on the last line by itself
|
||||||
itself.
|
or (if other style rules permit) on the same line as the
|
||||||
|
open curly brace.
|
||||||
</li>
|
</li>
|
||||||
<li> There should be a space between the close parenthesis and
|
<li> There should be a space between the close parenthesis and
|
||||||
the open curly brace.
|
the open curly brace.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user