mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Update coding rule for enums to reflect actually used style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24885 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d216aacabf
commit
9799ff19db
@ -124,13 +124,13 @@ in C++.
|
|||||||
compiler ensure that all cases are exhausted.
|
compiler ensure that all cases are exhausted.
|
||||||
|
|
||||||
enum Foo {
|
enum Foo {
|
||||||
foo,
|
FOO_BAR1,
|
||||||
bar
|
FOO_BAR2
|
||||||
};
|
};
|
||||||
Foo f = ...;
|
Foo f = ...;
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case foo: ...; break;
|
case FOO_BAR1: ...; break;
|
||||||
case bar: ...; break;
|
case FOO_BAR2: ...; break;
|
||||||
default: ...; break; // not needed and would shadow a wrong use of Foo
|
default: ...; break; // not needed and would shadow a wrong use of Foo
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,18 +254,18 @@ Formatting
|
|||||||
void mangle () // wrong
|
void mangle () // wrong
|
||||||
|
|
||||||
* Enumerators
|
* Enumerators
|
||||||
enum {
|
enum Foo {
|
||||||
one = 1,
|
FOO_ONE = 1,
|
||||||
two = 2,
|
FOO_TWO = 2,
|
||||||
three = 3
|
FOO_THREE = 3
|
||||||
};
|
};
|
||||||
-NOT-
|
-NOT-
|
||||||
enum { one = 1, two = 2, three 3 }; // wrong
|
enum { one = 1, two = 2, three 3 }; // wrong
|
||||||
-NOT-
|
-NOT-
|
||||||
enum {
|
enum {
|
||||||
ONE = 1,
|
One = 1,
|
||||||
TWO = 2,
|
Two = 2,
|
||||||
THREE = 3
|
Three = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
* Naming rules for classes
|
* Naming rules for classes
|
||||||
|
Loading…
Reference in New Issue
Block a user