From a62e1aa5f76fc2634f8be00a5e2f5f3e991ed680 Mon Sep 17 00:00:00 2001 From: Moinak Ghosh Date: Mon, 5 May 2014 19:40:53 +0530 Subject: [PATCH] Config script option to disable AVX. Fix compiler (Gcc 4.9) warnings. --- bsdiff/bscommon.h | 5 ++++- config | 3 +++ rabin/rabin_dedup.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bsdiff/bscommon.h b/bsdiff/bscommon.h index 948a83b..9e865b6 100644 --- a/bsdiff/bscommon.h +++ b/bsdiff/bscommon.h @@ -62,9 +62,12 @@ static bsize_t BUFREAD(bufio_t *bio, uchar_t *buf, bsize_t len) { bsize_t actual; + unsigned int tot; actual = len; - if (bio->pos + len > bio->buflen) { + tot = len; + tot += bio->pos; + if (tot > bio->buflen) { actual = bio->buflen - bio->pos; } if (actual == 0) return (0); diff --git a/config b/config index 7021fff..f5de671 100755 --- a/config +++ b/config @@ -200,6 +200,9 @@ do sse_detect=0 avx_detect=0 ;; + --no-avx-detect) + avx_detect=0 + ;; --no-1.3-archive-compat) crypto_compat_objs="" crypto_compat_flags="" diff --git a/rabin/rabin_dedup.c b/rabin/rabin_dedup.c index 04f95b5..ec8b775 100755 --- a/rabin/rabin_dedup.c +++ b/rabin/rabin_dedup.c @@ -181,7 +181,7 @@ create_dedupe_context(uint64_t chunksize, uint64_t real_chunksize, int rab_blk_s */ pthread_mutex_lock(&init_lock); if (!inited) { - int term, pow, j; + unsigned int term, pow, j; uint64_t val, poly_pow; poly_pow = 1;