-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-tidyconfirmedVerified by a second partyVerified by a second partyenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature
Description
Bugzilla Link | 27034 |
Version | unspecified |
OS | All |
CC | @EugeneZelenko,@Trass3r |
Extended Description
Consider the following code:
#define RED 0
#define GREEN 1
#define BLUE 2
struct RGBColor { /* ... */ };
extern float getChannel(const RGBColor &color, int channel);
RGBColor blue;
float red = getChannel(blue, RED);
The macros are being used as an enumeration. This is best done by explicitly using an enumeration instead of int and a bunch of macros.
Create a check that identifies such macros disguised as enumerations and replaces them with an actual enum.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-tidyconfirmedVerified by a second partyVerified by a second partyenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature