X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/c55a77db55ebf46a399f136eeb3a928b1e862772..31d87352f9508ba8e570d2462667907d8979b93d:/test/src/cf.c diff --git a/test/src/cf.c b/test/src/cf.c index 4dc3dc00f..2b982f10f 100644 --- a/test/src/cf.c +++ b/test/src/cf.c @@ -1,5 +1,3 @@ -/* $Cambridge: exim/test/src/cf.c,v 1.1 2006/02/06 16:24:05 ph10 Exp $ */ - /************************************************ * PH-Compare * ************************************************/ @@ -31,6 +29,11 @@ Translated back into C, March 1990! */ #ifdef __STDC__ #include #include +#include +#endif + +#ifndef intptr_t +# define intptr_t long long int #endif /* ----- parameters ----- */ @@ -38,6 +41,7 @@ Translated back into C, March 1990! */ #define version 8 #define defaultstore 100000 /* default recovery buffer size */ #define minstore 500 /* minimum recovery buffer size */ +#define SHOWMAX 20 /* maximum number of diff lines to display */ /* ----- misc defines ----- */ @@ -255,11 +259,11 @@ else if (t1 < 0 && t2 < 0) if (echo) { rule('-', 10); - if (-t1-s1 < 21) write_lines(rootline_one, tline_one); - else fprintf(f_out, "... ...\n"); + if (-t1-s1 < SHOWMAX+1) write_lines(rootline_one, tline_one); + else fprintf(f_out, "... ...\n", SHOWMAX); rule('-', 10); - if (-t2-s2 < 21) write_lines(rootline_two, tline_two); - else fprintf(f_out, "... ...\n"); + if (-t2-s2 < SHOWMAX+1) write_lines(rootline_two, tline_two); + else fprintf(f_out, "... ...\n", SHOWMAX); } } @@ -354,7 +358,7 @@ if (lastline_one != NULL) lastline_one->next = nextline; lastline_one = nextline; pline_one = nextline; -bufnext_one = (char *) (((int)bufnext_one+3) & (-4)); +bufnext_one = (char *) (((intptr_t)bufnext_one+ sizeof (intptr_t) - 1) & (-(sizeof (intptr_t)))); } @@ -403,7 +407,7 @@ if (lastline_two != NULL) lastline_two->next = nextline; lastline_two = nextline; pline_two = nextline; -bufnext_two = (char *) (((int)bufnext_two+3) & (-4)); +bufnext_two = (char *) (((intptr_t)bufnext_two+ sizeof (intptr_t) - 1) & (-(sizeof (intptr_t)))); }