Page MenuHomeFreeBSD

tree: remove unused argument from RB_NEXT()/RB_PREV()
AbandonedPublic

Authored by kp on Apr 8 2022, 12:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 19 2024, 4:14 AM
Unknown Object (File)
May 17 2024, 6:09 AM
Unknown Object (File)
May 14 2024, 10:20 AM
Unknown Object (File)
May 8 2024, 3:04 PM
Unknown Object (File)
Feb 26 2024, 11:03 AM
Unknown Object (File)
Jan 14 2024, 8:24 AM
Unknown Object (File)
Dec 28 2023, 12:05 PM
Unknown Object (File)
Dec 20 2023, 7:47 AM

Details

Reviewers
jhb
Group Reviewers
manpages
transport
Summary

5fce408cc44c737267aaaf0dcecd3454ba9089cd stopped using the middle
argument to these macros. Remove it entirely and update all users of it,
to make it easier to deal with 'unused parameter' warnings.

The bulk of this change is a mechanical substitution (with Coccinelle):

@@ expression A,B,C; @@
(

  • RB_NEXT(A, B, C)

+ RB_NEXT(A, C)
)
@@ expression A,B,C; @@
(

  • RB_PREV(A, B, C)

+ RB_PREV(A, C)
)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45075
Build 41963: arc lint + arc unit

Event Timeline

kp requested review of this revision.Apr 8 2022, 12:08 PM

Thinking about this again, it's probably not the right way to go because there may be out-of-tree (userspace) consumers of RB_NEXT/RB_PREV, and they'd break.

Request an exp-run and see if any ports are affected?

Manual page question/correction

share/man/man3/tree.3
165

Currently, the rendered tree(3) has

struct TYPE *
RB_NEXT(NAME, RB_HEAD *head, struct TYPE *elm);

So this looks like you're removing the last argument, not the middle one.

167

Same as above.