From: Adam Dickmeiss Date: Fri, 6 Aug 2004 13:36:22 +0000 (+0000) Subject: More type casts due to zint. X-Git-Tag: snippet.version.1~431 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=2b99f08490d3bd763bb086693044a6db10c0bcf9;p=idzebra-moved-to-github.git More type casts due to zint. --- diff --git a/include/zebraapi.h b/include/zebraapi.h index 4488047..1a53175 100644 --- a/include/zebraapi.h +++ b/include/zebraapi.h @@ -1,4 +1,4 @@ -/* $Id: zebraapi.h,v 1.14 2004-08-04 08:35:23 adam Exp $ +/* $Id: zebraapi.h,v 1.15 2004-08-06 13:36:22 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -225,7 +225,7 @@ int zebra_delete_record (ZebraHandle zh, int force_update); YAZ_EXPORT int zebra_resultSetTerms (ZebraHandle zh, const char *setname, - int no, int *count, + int no, zint *count, int *type, char *out, size_t *len); YAZ_EXPORT int zebra_sort (ZebraHandle zh, ODR stream, diff --git a/index/extract.c b/index/extract.c index 9561c6e..3a01c1b 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.158 2004-08-04 08:35:23 adam Exp $ +/* $Id: extract.c,v 1.159 2004-08-06 13:36:22 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -114,9 +114,9 @@ static const char **searchRecordKey (ZebraHandle zh, iscz1_decode(decode_handle, &dst, &src); assert(key.len < 4 && key.len > 2); - attrSet = key.mem[0]; - attrUse = key.mem[1]; - seqno = key.mem[2]; + attrSet = (int) key.mem[0]; + attrUse = (int) key.mem[1]; + seqno = (int) key.mem[2]; if (attrUseS == attrUse && attrSetS == attrSet) { @@ -1331,8 +1331,8 @@ void extract_flushRecordKeys (ZebraHandle zh, SYSNO sysno, iscz1_decode(decode_handle, &dst, &src); assert(key.len < 4 && key.len > 2); - attrSet = key.mem[0]; - attrUse = key.mem[1]; /* sequence in mem[2] */ + attrSet = (int) key.mem[0]; + attrUse = (int) key.mem[1]; /* sequence in mem[2] */ if (zh->reg->key_buf_used + 1024 > (zh->reg->ptr_top -zh->reg->ptr_i)*sizeof(char*)) diff --git a/index/index.h b/index/index.h index 2c38a58..8a67b85 100644 --- a/index/index.h +++ b/index/index.h @@ -1,4 +1,4 @@ -/* $Id: index.h,v 1.111 2004-08-06 13:14:46 adam Exp $ +/* $Id: index.h,v 1.112 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -201,7 +201,7 @@ void encode_key_flush (struct encode_info *i, FILE *outf); typedef struct { char *term; char *db; - int sysno; + zint sysno; int score; } *ZebraPosSet; diff --git a/index/rank1.c b/index/rank1.c index b4de2dd..2117704 100644 --- a/index/rank1.c +++ b/index/rank1.c @@ -1,4 +1,4 @@ -/* $Id: rank1.c,v 1.15 2004-08-04 08:35:23 adam Exp $ +/* $Id: rank1.c,v 1.16 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -40,7 +40,7 @@ struct rank_class_info { struct rank_term_info { int local_occur; - int global_occur; + zint global_occur; int global_inv; int rank_flag; int rank_weight; @@ -107,7 +107,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) xmalloc (sizeof(*si->entries)*si->no_entries); for (i = 0; i < si->no_entries; i++) { - int g = rset->rset_terms[i]->nn; + zint g = rset->rset_terms[i]->nn; #if DEBUG_RANK yaz_log(LOG_LOG, "i=%d flags=%s", i, rset->rset_terms[i]->flags); #endif @@ -130,7 +130,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) si->entries[i].local_occur = 0; si->entries[i].global_occur = g; si->entries[i].global_inv = 32 - log2_int (g); - yaz_log (LOG_DEBUG, " global_inv = %d g = %d", 32 - log2_int (g), g); + yaz_log (LOG_DEBUG, " global_inv = %d g = " ZINT_FORMAT, (int) (32-log2_int (g)), g); } return si; } diff --git a/index/trunc.c b/index/trunc.c index 261685e..d85c002 100644 --- a/index/trunc.c +++ b/index/trunc.c @@ -1,4 +1,4 @@ -/* $Id: trunc.c,v 1.31 2004-08-06 13:14:46 adam Exp $ +/* $Id: trunc.c,v 1.32 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -393,12 +393,11 @@ static int isamc_trunc_cmp (const void *p1, const void *p2) { ISAMC_P i1 = *(ISAMC_P*) p1; ISAMC_P i2 = *(ISAMC_P*) p2; - int d; + zint d; - d = (int) (isc_type (i1) - isc_type (i2)); - if (d) - return d; - d = isc_block (i1) - isc_block (i2); + d = (isc_type (i1) - isc_type (i2)); + if (d == 0) + d = isc_block (i1) - isc_block (i2); if (d > 0) return 1; else if (d < 0) diff --git a/index/zinfo.c b/index/zinfo.c index d40fbc3..91e05d1 100644 --- a/index/zinfo.c +++ b/index/zinfo.c @@ -1,4 +1,4 @@ -/* $Id: zinfo.c,v 1.38 2004-08-04 08:35:23 adam Exp $ +/* $Id: zinfo.c,v 1.39 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -1430,7 +1430,7 @@ void zebraExplain_recordCountIncrement (ZebraExplainInfo zei, int adjust_num) } } -int zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num) +zint zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num) { if (adjust_num) { diff --git a/index/zinfo.h b/index/zinfo.h index 25b9c4f..ee9bfcb 100644 --- a/index/zinfo.h +++ b/index/zinfo.h @@ -1,4 +1,4 @@ -/* $Id: zinfo.h,v 1.16 2003-06-30 19:37:12 adam Exp $ +/* $Id: zinfo.h,v 1.17 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -48,7 +48,7 @@ int zebraExplain_addSU (ZebraExplainInfo zei, int set, int use); void zebraExplain_addSchema (ZebraExplainInfo zei, Odr_oid *oid); void zebraExplain_recordCountIncrement (ZebraExplainInfo zei, int adjust_num); void zebraExplain_recordBytesIncrement (ZebraExplainInfo zei, int adjust_num); -int zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num); +zint zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num); void zebraExplain_loadAttsets (data1_handle dh, Res res); void zebraExplain_flush (ZebraExplainInfo zei, void *updateHandle); diff --git a/index/zrpn.c b/index/zrpn.c index 7fefb9b..ca0cb09 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.142 2004-08-04 08:35:23 adam Exp $ +/* $Id: zrpn.c,v 1.143 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -2463,7 +2463,7 @@ static void scan_term_untrans (ZebraHandle zh, NMEM stream, int reg_type, static void count_set (RSET r, int *count) { - int psysno = 0; + zint psysno = 0; int kno = 0; struct it_key key; RSFD rfd; diff --git a/index/zserver.c b/index/zserver.c index 4a44d06..088cf50 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,4 +1,4 @@ -/* $Id: zserver.c,v 1.118 2004-08-04 08:35:24 adam Exp $ +/* $Id: zserver.c,v 1.119 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -170,7 +170,7 @@ bend_initresult *bend_init (bend_initrequest *q) static void search_terms (ZebraHandle zh, bend_search_rr *r) { - int count; + zint count; int no_terms; int i; int type; @@ -246,7 +246,9 @@ static void search_terms (ZebraHandle zh, bend_search_rr *r) sr->elements[i]->subqueryExpression->u.term->termComment = 0; sr->elements[i]->subqueryInterpretation = 0; sr->elements[i]->subqueryRecommendation = 0; - sr->elements[i]->subqueryCount = odr_intdup (r->stream, count); + if (count > 2000000000) + count = 2000000000; + sr->elements[i]->subqueryCount = odr_intdup (r->stream, (int) count); sr->elements[i]->subqueryWeight = 0; sr->elements[i]->resultsByDB = 0; } diff --git a/index/zsets.c b/index/zsets.c index 1c9d085..1d24d9b 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -1,4 +1,4 @@ -/* $Id: zsets.c,v 1.53 2004-08-06 12:55:01 adam Exp $ +/* $Id: zsets.c,v 1.54 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -136,7 +136,7 @@ void resultSetAddTerm (ZebraHandle zh, ZebraSet s, int reg_type, int zebra_resultSetTerms (ZebraHandle zh, const char *setname, - int no, int *count, + int no, zint *count, int *type, char *out, size_t *len) { ZebraSet s = resultSetGet (zh, setname); diff --git a/isams/isams.c b/isams/isams.c index 44c4a33..5e4bbce 100644 --- a/isams/isams.c +++ b/isams/isams.c @@ -1,4 +1,4 @@ -/* $Id: isams.c,v 1.6 2004-08-04 08:35:24 adam Exp $ +/* $Id: isams.c,v 1.7 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -194,8 +194,8 @@ ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P pos) pp->numKeys = 0; pp->numRead = 0; pp->buf = (char *) xmalloc(is->block_size*2); - pp->block_no = pos/is->block_size; - pp->block_offset = pos - pp->block_no * is->block_size; + pp->block_no = (int) (pos/is->block_size); + pp->block_offset = (int) (pos - pp->block_no * is->block_size); if (is->debug) logf (LOG_LOG, "isams: isams_pp_open off=%d no=%d", pp->block_offset, pp->block_no); diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index d0774b0..2e3a3a1 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -1,4 +1,4 @@ -/* $Id: recgrs.c,v 1.87 2004-08-06 12:55:03 adam Exp $ +/* $Id: recgrs.c,v 1.88 2004-08-06 13:36:23 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -959,7 +959,7 @@ static void zebra_xml_metadata (struct recRetrieveCtrl *p, data1_node *top, data1_mk_tag_data_int (p->dh, n, "score", p->score, mem); } data1_mk_text (p->dh, mem, i4, n); - data1_mk_tag_data_int (p->dh, n, "localnumber", p->localno, mem); + data1_mk_tag_data_zint (p->dh, n, "localnumber", p->localno, mem); if (p->fname) { data1_mk_text (p->dh, mem, i4, n); diff --git a/rset/rsprox.c b/rset/rsprox.c index 60f80ab..2eb7866 100644 --- a/rset/rsprox.c +++ b/rset/rsprox.c @@ -1,4 +1,4 @@ -/* $Id: rsprox.c,v 1.6 2004-08-04 09:59:03 heikki Exp $ +/* $Id: rsprox.c,v 1.7 2004-08-06 13:36:24 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -80,7 +80,7 @@ static void *r_create (RSET ct, const struct rset_control *sel, void *parms) int i; char prox_term[512]; int length_prox_term = 0; - int min_nn = 10000000; + zint min_nn = 10000000; const char *flags = NULL; int term_type = 0;