From 4dc2670c4c6c898a392a9cf0e3068b36192a8ad7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 13 May 2011 11:15:29 +0200 Subject: [PATCH] Avoid truncating hit counts because Odr_int is 64-bit Hit counts were represented as an int in YAZ 3 and earlier; no longer the case. --- index/zebrasrv.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/index/zebrasrv.c b/index/zebrasrv.c index 6a0efdc..8707531 100644 --- a/index/zebrasrv.c +++ b/index/zebrasrv.c @@ -253,9 +253,7 @@ static void search_terms(ZebraHandle zh, bend_search_rr *r) se->subqueryExpression->u.term->termComment = 0; se->subqueryInterpretation = 0; se->subqueryRecommendation = 0; - if (count > 2147483646) - count = 2147483647; - se->subqueryCount = odr_intdup(r->stream, CAST_ZINT_TO_INT(count)); + se->subqueryCount = odr_intdup(r->stream, count); se->subqueryWeight = 0; se->resultsByDB = 0; } @@ -296,9 +294,7 @@ int bend_search(void *handle, bend_search_rr *r) zebra_result(zh, &r->errcode, &r->errstring); else { - if (zhits > 2147483646) - zhits = 2147483647; - r->hits = CAST_ZINT_TO_INT(zhits); + r->hits = zhits; search_terms(zh, r); } break; @@ -382,8 +378,7 @@ static int bend_scan(void *handle, bend_scan_rr *r) { r->entries[i].term = entries[i].term; r->entries[i].display_term = entries[i].display_term; - r->entries[i].occurrences = - CAST_ZINT_TO_INT(entries[i].occurrences); + r->entries[i].occurrences = entries[i].occurrences; } } else -- 1.7.10.4