From 06366852581ea843e8fc12fb461654e931512026 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 12 Feb 2013 17:37:14 -0500 Subject: [PATCH] bugfix: 2nd best score not set because I was comparing (uint32_t)-1 with a positive integer... --- ksw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ksw.c b/ksw.c index 4599c6b..8d741a6 100644 --- a/ksw.c +++ b/ksw.c @@ -211,7 +211,7 @@ end_loop16: low = te - i; high = te + i; for (i = 0; i < n_b; ++i) { int e = (int32_t)b[i]; - if ((e < low || e > high) && b[i]>>32 > (uint32_t)r.score2) + if ((e < low || e > high) && (int)(b[i]>>32) > r.score2) r.score2 = b[i]>>32, r.te2 = e; } } @@ -311,7 +311,7 @@ end_loop8: low = te - i; high = te + i; for (i = 0; i < n_b; ++i) { int e = (int32_t)b[i]; - if ((e < low || e > high) && b[i]>>32 > (uint32_t)r.score2) + if ((e < low || e > high) && (int)(b[i]>>32) > r.score2) r.score2 = b[i]>>32, r.te2 = e; } } @@ -587,7 +587,7 @@ int main(int argc, char *argv[]) return 1; } if (minsc > 0xffff) minsc = 0xffff; - if (minsc > 0) xtra |= KSW_XSUBO | minsc; + xtra |= KSW_XSUBO | minsc; // initialize scoring matrix for (i = k = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) -- 2.47.3