• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // We warn when xxxLAST constants aren't last.
6 enum BadOne {
7   kBadOneInvalid = -1,
8   kBadOneRed,
9   kBadOneGreen,
10   kBadOneBlue,
11   kBadOneLast = kBadOneGreen
12 };
13 
14 // We don't handle this case when called from C due to sign mismatch issues.
15 // No matter; we're not looking for this issue outside of C++.
16 enum FailOne {
17   FAIL_ONE_INVALID,
18   FAIL_ONE_RED,
19   FAIL_ONE_GREEN,
20   FAIL_ONE_BLUE = 0xfffffffc,
21   FAIL_ONE_LAST = FAIL_ONE_GREEN
22 };
23 
24 // We don't warn when xxxLAST constants are last.
25 enum GoodOne {
26   kGoodOneInvalid = -1,
27   kGoodOneRed,
28   kGoodOneGreen,
29   kGoodOneBlue,
30   kGoodOneLast = kGoodOneBlue
31 };
32 
33 // We don't warn when xxx_LAST constants are last.
34 enum GoodTwo {
35   GOOD_TWO_INVALID,
36   GOOD_TWO_RED,
37   GOOD_TWO_GREEN,
38   GOOD_TWO_BLUE = 0xfffffffc,
39   GOOD_TWO_LAST = GOOD_TWO_BLUE
40 };
41