Page MenuHomeFreeBSD

diff3: Code cleanup
ClosedPublic

Authored by des on Wed, Feb 25, 8:33 PM.
Tags
None
Referenced Files
F146165503: D55517.id.diff
Sat, Feb 28, 9:27 AM
F146156178: D55517.id.diff
Sat, Feb 28, 7:31 AM
Unknown Object (File)
Fri, Feb 27, 4:58 AM
Unknown Object (File)
Fri, Feb 27, 4:58 AM
Unknown Object (File)
Fri, Feb 27, 2:20 AM
Unknown Object (File)
Thu, Feb 26, 11:24 PM
Unknown Object (File)
Thu, Feb 26, 8:06 PM
Subscribers

Details

Reviewers
bapt
thj
Group Reviewers
Klara
Commits
rGc2dee7786bf3: diff3: Code cleanup
Summary
  • Order includes.
  • Turn the diff type into an enum.
  • Turn an unreachable error message into an assertion.
  • Remove unused debugging code.
  • Remove some dead assignments.
  • Consistently use 1 instead of EXIT_FAILURE.
  • Turn a return from main() into an exit().

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71007
Build 67890: arc lint + arc unit

Event Timeline

des requested review of this revision.Wed, Feb 25, 8:33 PM
usr.bin/diff3/diff3.c
870

Note that this is unreachable. Perhaps we should just assert that.

des retitled this revision from diff3: More consistent error handling to diff3: Code cleanup.Wed, Feb 25, 9:09 PM
des edited the summary of this revision. (Show Details)
des edited the summary of this revision. (Show Details)
markj added inline comments.
usr.bin/diff3/diff3.c
92

Why introduce DIFF_NONE?

usr.bin/diff3/diff3.c
92

I don't want DIFF_TYPE1 to be 0 in case a bug lets an uninitialized struct diff through. Adding DIFF_NONE seemed cleaner than manually assigning values.

This revision is now accepted and ready to land.Sat, Feb 28, 5:46 PM
This revision was automatically updated to reflect the committed changes.