Page MenuHomeFreeBSD

Use nitems and make few small clean ups.
ClosedPublic

Authored by araujo on Aug 12 2015, 12:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 13, 3:41 PM
Unknown Object (File)
Mon, Nov 10, 10:01 PM
Unknown Object (File)
Thu, Oct 30, 1:37 AM
Unknown Object (File)
Thu, Oct 30, 1:37 AM
Unknown Object (File)
Thu, Oct 30, 1:37 AM
Unknown Object (File)
Thu, Oct 30, 1:37 AM
Unknown Object (File)
Wed, Oct 29, 5:40 PM
Unknown Object (File)
Oct 16 2025, 4:59 AM
Subscribers

Details

Summary
  • Use nitems instead of "sizeof ypaliases/sizeof ypaliases[0]".
  • Prefer more expressive statement like: if (notrans == 0).
  • Also remove the brakets around !notrans inside the for().

Diff Detail

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

Event Timeline

araujo retitled this revision from to Use nitems and make few small clean ups..
araujo updated this object.
araujo edited the test plan for this revision. (Show Details)
araujo added reviewers: rodrigc, bapt, ed.
usr.bin/ypwhich/ypwhich.c
209

This should also be notrans == 0 then as well, right?

But that said, in this case we only use notrans as a boolean. If you want, we could just #include <stdbool.h> and turn it into a bool. :-)

Address @ed suggestion, a little bit in a different way.

usr.bin/ypwhich/ypwhich.c
208–211

In this case here, it could be changed to a bool. Other yp(8) tools use the same approach, but, I will add it in my todo list. I do believe it would be good maybe move notrans to a bool.

But I would like to do it in a next step.

bapt edited edge metadata.
This revision is now accepted and ready to land.Aug 12 2015, 1:59 PM
ed edited edge metadata.
usr.bin/ypwhich/ypwhich.c
172

This doesn't look right. Can you check the logic here?

usr.bin/ypwhich/ypwhich.c
172

Never mind, I read it wrong, this logic is right.

rodrigc edited edge metadata.