-
Notifications
You must be signed in to change notification settings - Fork 203
Use enums/More explicit types #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
minad
commented
May 13, 2019
- Makes the API more obvious
- Allows us to catch a few implicit conversions
- 100% API/ABI backwards compatible
72089c5
to
7d3d34d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MP_RANGE
is not used in LTM and should either go or get its own value. Both would get rid of the necessity to number all entries explicitly instead of just the first one but also kills your promise of "100% API/ABI backwards compatible"
But otherwise…
@czurnieden We could just remove MP_RANGE from the enum. Defining MP_USE_ENUM somehow selects the "modernised" API. Furthermore I will make MP_RANGE deprecated then. |
2f78b4a
to
6f4952a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MP_FREE_BUFFER can be improved, see comment there
* MP_USE_ENUMS enables enums * Wc++-compat catches some implicit conversions if MP_USE_ENUMS is defined * 100% backwards compatible API/ABI if MP_USE_ENUMS is not defined
6f4952a
to
668cda0
Compare
Thx @nijtmans! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you did now what I struggled with for a long time... I'm still not sure if I prefer a generic int as return value or an enum... but I like it now that it's there
also I appreciate that @fperrad immediately linted the PR, I like that way a lot better and IMO we could keep doing this approach :-)
ah lol, @minad simply rebased on top of #259 also fine by me, but @fperrad how about doing this for future PR's? as soon as they're good to go you put your linting commits on top |