The middle argument to RB_NEXT (specifying the head) has not been used
for several years and has never been used for RB_PREV. Use a trick
with VA_ARGS to permit macro overloading to add a 2 argument
version of these macros that omits the unused argument.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 45081 Build 41969: arc lint + arc unit
Event Timeline
If we aren't completely revolted by this approach, I have other Plans (tm) such as a CTR() wrapper for KTR traces that takes a variable number of arguments (already written, not yet tested), but a bigger fish I want to fry: making the mostly useless 'devclass' argument to DRIVER_MODULE optional.
Some consensus on IRC is that this might be a bit overkill compared to just working around the warning in pf(4).
Will this trick make it possible to collapse TAILQ_LAST and TAILQ_LAST_FAST into single macro that runs fast if has all 3 arguments?
It would perhaps let you have TAILQ_LAST take either 2 or 3 arguments and call the fast variant when given 3 arguments. However, that particular use case seems a bit more odd as the 3 arguments aren't just an additional argument to the 2, but different arguments, so overloading TAILQ_LAST in that way may be a bit less obvious.