From: Heng Li Date: Tue, 12 Feb 2013 22:37:14 +0000 (-0500) Subject: bugfix: 2nd best score not set X-Git-Tag: spawn-final~31 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=06366852581ea843e8fc12fb461654e931512026;p=klib.git bugfix: 2nd best score not set because I was comparing (uint32_t)-1 with a positive integer... --- 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)