From 0d0e2e93e81a650898c1a5b332cef6db90f2dece Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 23 Mar 1998 14:46:03 +0000 Subject: [PATCH] test for "long long" and %lld in configure. --- configure.in | 6 ++++++ main.c | 7 +++++++ match.c | 8 +++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index cc161e7c..bd6384c2 100644 --- a/configure.in +++ b/configure.in @@ -52,6 +52,12 @@ main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }], echo yes;AC_DEFINE(HAVE_FNMATCH), echo no) +echo $ac_n "checking for long long... $ac_c" +AC_TRY_RUN([#include +main() { long long x = 1000000000000; char b[20]; sprintf(b,"%lld", x); exit(strcmp("1000000000000", b) == 0? 0: 1); }], +echo yes;AC_DEFINE(HAVE_LONGLONG), +echo no) + echo $ac_n "checking for utimbuf ... $ac_c" AC_TRY_COMPILE([#include #include ], diff --git a/main.c b/main.c index 08d09298..1af6771e 100644 --- a/main.c +++ b/main.c @@ -88,10 +88,17 @@ static void report(int f) tsize = read_longint(f); } +#if HAVE_LONGLONG + printf("wrote %lld bytes read %lld bytes %g bytes/sec\n", + (long long)out,(long long)in,(in+out)/(0.5 + (t-starttime))); + printf("total size is %lld speedup is %g\n", + (long long)tsize,(1.0*tsize)/(in+out)); +#else printf("wrote %ld bytes read %ld bytes %g bytes/sec\n", (long)out,(long)in,(in+out)/(0.5 + (t-starttime))); printf("total size is %ld speedup is %g\n", (long)tsize,(1.0*tsize)/(in+out)); +#endif } diff --git a/match.c b/match.c index d5ceba39..16779007 100644 --- a/match.c +++ b/match.c @@ -96,7 +96,7 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf, off_t n = offset - last_match; int j; - if (verbose > 2 && i != -1) + if (verbose > 2 && i >= 0) fprintf(FERROR,"match at %d last_match=%d j=%d len=%d n=%d\n", (int)offset,(int)last_match,i,(int)s->sums[i].len,(int)n); @@ -106,7 +106,7 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf, if (n > 0) write_flush(f); - if (i != -1) + if (i >= 0) n += s->sums[i].len; for (j=0;j= 0) last_match = offset + s->sums[i].len; + else + last_match = offset; } -- 2.34.1