FreeBSD/contrib/diff/src/context.c
/* Scan a (forward-ordered) edit script for the first place that more than
   2*CONTEXT unchanged lines appear, and return a pointer
   to the `struct change' for the last change before those lines.  */
Scan a (forward-ordered) edit script for the first place that more than
2*CONTEXT unchanged lines appear, and return a pointer
to the `struct change' for the last change before those lines.
Scan a ( forward - ordered ) edit script for the first place that more than 2 * CONTEXT unchanged lines appear and return a pointer to the ` struct change ' for the last change before those lines .
static struct change *
find_hunk (struct change *start)
{
  struct change *prev;
  lin top0, top1;
  lin thresh;
  lin non_ignorable_threshold =
    (LIN_MAX - 1) / 2 < context ? LIN_MAX : 2 * context + 1;
  lin ignorable_threshold = context;
  do
    {
      top0 = start->line0 + start->deleted;
      top1 = start->line1 + start->inserted;
      prev = start;
      start = start->link;
      thresh = (prev->ignore || (start && start->ignore)
		? ignorable_threshold
		: non_ignorable_threshold);
      if (start && start->line0 - top0 != start->line1 - top1)
	abort ();
    } while (start
	     && start->line0 - top0 < thresh);
  return prev;
}
static struct change * find_hunk ( struct change * start ) { struct change * prev ; lin top0 , top1 ; lin thresh ; lin non_ignorable_threshold = ( LIN_MAX - 1 ) / 2 < context ? LIN_MAX : 2 * context + 1 ; lin ignorable_threshold = context ; do { top0 = start -> line0 + start -> deleted ; top1 = start -> line1 + start -> inserted ; prev = start ; start = start -> link ; thresh = ( prev -> ignore || ( start && start -> ignore ) ? ignorable_threshold : non_ignorable_threshold ) ; if ( start && start -> line0 - top0 != start -> line1 - top1 ) abort ( ) ; } while ( start && start -> line0 - top0 < thresh ) ; return prev ; }
Scan a (forward-ordered) edit script for the first place that more than
2*CONTEXT unchanged lines appear, and return a pointer
to the `struct change' for the last change before those lines.
Scan a ( forward - ordered ) edit script for the first place that more than 2 * CONTEXT unchanged lines appear and return a pointer to the ` struct change ' for the last change before those lines .
/* Threshold distance is 2 * CONTEXT + 1 between two non-ignorable
     changes, but only CONTEXT if one is ignorable.  Watch out for
     integer overflow, though.  */ /* Compute number of first line in each file beyond this changed.  */ /* It is not supposed to matter which file we check in the end-test.
	 If it would matter, crash.  */ /* Keep going if less than THRESH lines
		elapse before the affected line.  */