Page MenuHomeFreeBSD

diff3: Code cleanup
ClosedPublic

Authored by des on Wed, Feb 25, 8:33 PM.
Tags
None
Referenced Files
F146606587: D55517.diff
Wed, Mar 4, 1:26 AM
Unknown Object (File)
Mon, Mar 2, 10:55 PM
Unknown Object (File)
Mon, Mar 2, 1:18 AM
Unknown Object (File)
Sun, Mar 1, 10:40 AM
Unknown Object (File)
Sun, Mar 1, 6:24 AM
Unknown Object (File)
Sun, Mar 1, 3:40 AM
Unknown Object (File)
Sun, Mar 1, 3:33 AM
Unknown Object (File)
Sun, Mar 1, 3:33 AM
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 Not Applicable
Unit
Tests Not Applicable

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.