From ffba1424067b04c9f6a8d75ae2786e0665f4c9c8 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 20 Dec 2018 14:30:30 -0800 Subject: [PATCH] fixed file identity detection in 32-bit mode also : some library decided to use `index` as a global variable declared in standard header shadowing the ones used in fastcover.c :( --- lib/dictBuilder/fastcover.c | 8 ++++---- programs/util.c | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/dictBuilder/fastcover.c b/lib/dictBuilder/fastcover.c index dfee45743..cf8eb50a1 100644 --- a/lib/dictBuilder/fastcover.c +++ b/lib/dictBuilder/fastcover.c @@ -159,15 +159,15 @@ static COVER_segment_t FASTCOVER_selectSegment(const FASTCOVER_ctx_t *ctx, */ while (activeSegment.end < end) { /* Get hash value of current dmer */ - const size_t index = FASTCOVER_hashPtrToIndex(ctx->samples + activeSegment.end, f, d); + const size_t idx = FASTCOVER_hashPtrToIndex(ctx->samples + activeSegment.end, f, d); /* Add frequency of this index to score if this is the first occurence of index in active segment */ - if (segmentFreqs[index] == 0) { - activeSegment.score += freqs[index]; + if (segmentFreqs[idx] == 0) { + activeSegment.score += freqs[idx]; } /* Increment end of segment and segmentFreqs*/ activeSegment.end += 1; - segmentFreqs[index] += 1; + segmentFreqs[idx] += 1; /* If the window is now too large, drop the first position */ if (activeSegment.end - activeSegment.begin == dmersInK + 1) { /* Get hash value of the dmer to be eliminated from active segment */ diff --git a/programs/util.c b/programs/util.c index 4a369c051..34634318c 100644 --- a/programs/util.c +++ b/programs/util.c @@ -16,11 +16,10 @@ extern "C" { /*-**************************************** * Dependencies ******************************************/ -#include /* strncmp */ +#include "util.h" /* note : ensure that platform.h is included first ! */ #include #include -#include "util.h" int UTIL_fileExist(const char* filename) {