Page MenuHomeFreeBSD

pctrie: avoid typecast
ClosedPublic

Authored by dougm on Thu, Jun 13, 7:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 11:16 AM
Unknown Object (File)
Tue, Jun 25, 6:45 AM
Unknown Object (File)
Sun, Jun 16, 5:34 PM
Unknown Object (File)
Sat, Jun 15, 6:45 AM
Unknown Object (File)
Sat, Jun 15, 6:44 AM
Unknown Object (File)
Sat, Jun 15, 6:44 AM
Unknown Object (File)
Sat, Jun 15, 6:43 AM
Unknown Object (File)
Sat, Jun 15, 6:17 AM
Subscribers

Details

Summary

Have PCTRIE_RECLAIM_CALLBACK typecast one function pointer type to another, to relieve the writer of the call back function from having to cast its first argument from void* to member type.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Thu, Jun 13, 7:22 PM
dougm created this revision.

Get rid of a callback function pointer type that would only create a namespace collision someday when somebody used two pctries in the same compilation unit.

LGTM. Did you check that clang and gcc don't produce warnings? I don't think they should. I can try applying and checking this evening if you haven't already.

This revision is now accepted and ready to land.Fri, Jun 14, 1:41 AM

LGTM. Did you check that clang and gcc don't produce warnings? I don't think they should. I can try applying and checking this evening if you haven't already.

I did not. Please check it out.

I checked for warnings, nothing new in subr_pctrie.c, subr_rangeset.c, or swap_pager.c. Good to go.

gcc13 is producing a few warnings for subr_pctrie.c, but I don't think any are actual problems. meta file here:
https://people.freebsd.org/~rlibby/gcc13-subr_pctrie.o.meta

  • The -Wcast-qual stuff is due to atomic_load_ptr, nothing to be done about that here for pctrie.
  • The -Wmaybe-uninitialized I'm pretty sure is a false positive. It could be silenced with a NULL initialization though.
  • The -Wattributes I think are harmless... Not sure if there's a nice way to silence those.
This revision was automatically updated to reflect the committed changes.