From 0c645895118899cb3ad365bd6d7a9ee2b06f0baf Mon Sep 17 00:00:00 2001 From: Benjamin Buchfink Date: Mon, 4 Oct 2021 17:00:55 +0200 Subject: [PATCH] Fixed warnings. --- src/data/frequent_seeds.cpp | 2 +- src/data/seed_histogram.h | 18 +++++++++--------- src/search/stage0.cpp | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/data/frequent_seeds.cpp b/src/data/frequent_seeds.cpp index 94e9b526..fcccaa22 100644 --- a/src/data/frequent_seeds.cpp +++ b/src/data/frequent_seeds.cpp @@ -36,7 +36,7 @@ Frequent_seeds frequent_seeds; static void compute_sd(atomic *seedp, DoubleArray *query_seed_hits, DoubleArray *ref_seed_hits, vector *ref_out, vector *query_out) { - unsigned p; + int p; while ((p = (*seedp)++) < current_range.end()) { Sd ref_sd, query_sd; for (auto it = JoinIterator(query_seed_hits[p].begin(), ref_seed_hits[p].begin()); it; ++it) { diff --git a/src/data/seed_histogram.h b/src/data/seed_histogram.h index 23c063d1..52a2e272 100644 --- a/src/data/seed_histogram.h +++ b/src/data/seed_histogram.h @@ -35,21 +35,21 @@ struct SeedPartitionRange begin_ (0), end_ (0) { } - SeedPartitionRange(unsigned begin, unsigned end): + SeedPartitionRange(int begin, int end): begin_ (begin), end_ (end) { } - bool contains(unsigned i) const + bool contains(int i) const { return i >= begin_ && i < end_; } - unsigned begin() const + int begin() const { return begin_; } - unsigned end() const + int end() const { return end_; } - bool lower(unsigned i) const + bool lower(int i) const { return i < begin_; } - bool lower_or_equal(unsigned i) const + bool lower_or_equal(int i) const { return i < end_; } - unsigned size() const + int size() const { return end_ - begin_; } @@ -58,7 +58,7 @@ struct SeedPartitionRange return SeedPartitionRange(0, Const::seedp); } private: - unsigned begin_, end_; + int begin_, end_; }; extern SeedPartitionRange current_range; @@ -74,7 +74,7 @@ inline size_t partition_size(const ShapeHistogram &hst, size_t p) inline size_t hst_size(const ShapeHistogram &hst, const SeedPartitionRange &range) { size_t s = 0; - for(unsigned i=range.begin();i *query_seed_hits, DoubleArray *ref_seeds_hits) { - unsigned p; + int p; const unsigned bits = query_seeds->key_bits; if (bits != ref_seeds->key_bits) throw std::runtime_error("Joining seed arrays with different key lengths."); @@ -78,7 +78,7 @@ static void search_worker(atomic *seedp, const SeedPartitionRange *see #else unique_ptr work_set(new Search::WorkSet{ *context, *cfg, shape, {}, writer.get(), {}, {}, {} }); #endif - unsigned p; + int p; while ((p = (*seedp)++) < seedp_range->end()) for (auto it = JoinIterator(query_seed_hits[p].begin(), ref_seed_hits[p].begin()); it; ++it) Search::stage1(it.r->begin(), it.r->size(), it.s->begin(), it.s->size(), *work_set);