Skip to content

Commit

Permalink
Swap flag definition order to match enum order
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Oct 10, 2014
1 parent fd21e9c commit e70e080
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/lsst/meas/base/SdssCentroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SdssCentroidAlgorithm {
* Inspect getFlagDefinitions() for more detailed explanations of each flag.
*/
enum FlagBits {
EDGE,
EDGE=0,
BAD_DATA,
N_FLAGS
};
Expand All @@ -81,8 +81,8 @@ class SdssCentroidAlgorithm {
*/
static boost::array<FlagDef,N_FLAGS> const & getFlagDefinitions() {
static boost::array<FlagDef,N_FLAGS> const flagDefs = {{
{"badData", "Algorithm could not measure this data"},
{"edge", "Object too close to edge"}
{"edge", "Object too close to edge"},
{"badData", "Algorithm could not measure this data"}
}};
return flagDefs;
}
Expand Down

2 comments on commit e70e080

@PaulPrice
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the reason for this merely cosmetic, or is the compiler complaining?

@TallJimbo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's that the enum above and the array below need to agree, so the enum can be used to index the array.

I know it's bad to have to have that order match in two places like this, but I think it's impossible to avoid without some truly horrible preprocessor macros.

Please sign in to comment.