-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix enums using assignment operators (#175)
Previously the enumerator parsing logic utilized the same logic as the macro parsing logic. These are actually disparate logic. Now the enumerator logic uses the common base logic, with dedicated handling for the format_name() to only return the enumerator's name.
1 parent
af6ab9e
commit 3415f50
Showing
3 changed files
with
92 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Test case example of the issue that was reported in | ||
// https://github.com/speedyleion/sphinx-c-autodoc/issues/174 | ||
|
||
/** | ||
* My Define | ||
*/ | ||
#define MY_BITMASK 0x8000U | ||
|
||
/** | ||
* My Define mask | ||
*/ | ||
#define MY_MASKED( base_enum ) ((base_enum) | MY_BITMASK ) | ||
|
||
/** | ||
* My enum | ||
*/ | ||
typedef enum { | ||
VALUE_0, /**< my value 0*/ | ||
VALUE_1, /**< my value 1*/ | ||
VALUE_2 = MY_MASKED( VALUE_0 ), /**< my value 2*/ | ||
VALUE_3 = MY_MASKED( VALUE_1 ), /**< my value 3*/ | ||
} my_value_e; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters