More type casts due to zint.
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 6 Aug 2004 13:36:22 +0000 (13:36 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 6 Aug 2004 13:36:22 +0000 (13:36 +0000)
13 files changed:
include/zebraapi.h
index/extract.c
index/index.h
index/rank1.c
index/trunc.c
index/zinfo.c
index/zinfo.h
index/zrpn.c
index/zserver.c
index/zsets.c
isams/isams.c
recctrl/recgrs.c
rset/rsprox.c

index 4488047..1a53175 100644 (file)
@@ -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
 
    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 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,
                                      int *type, char *out, size_t *len);
 
 YAZ_EXPORT int zebra_sort (ZebraHandle zh, ODR stream,
index 9561c6e..3a01c1b 100644 (file)
@@ -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
 
    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);
 
        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)
         {
 
        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);
 
        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*))
 
         if (zh->reg->key_buf_used + 1024 > 
             (zh->reg->ptr_top -zh->reg->ptr_i)*sizeof(char*))
index 2c38a58..8a67b85 100644 (file)
@@ -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
 
    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;
 typedef struct {
     char *term;
     char *db;
-    int sysno;
+    zint sysno;
     int score;
 } *ZebraPosSet;
 
     int score;
 } *ZebraPosSet;
 
index b4de2dd..2117704 100644 (file)
@@ -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
 
    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;
 
 struct rank_term_info {
     int local_occur;
-    int global_occur;
+    zint global_occur;
     int global_inv;
     int rank_flag;
     int rank_weight;
     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++)
     {
        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
 #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);
        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;
 }
     }
     return si;
 }
index 261685e..d85c002 100644 (file)
@@ -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
 
    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;
 {
     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)
     if (d > 0)
        return 1;
     else if (d < 0)
index d40fbc3..91e05d1 100644 (file)
@@ -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
 
    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)
     {
 {
     if (adjust_num)
     {
index 25b9c4f..ee9bfcb 100644 (file)
@@ -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
 
    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);
 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);
 
 void zebraExplain_loadAttsets (data1_handle dh, Res res);
 void zebraExplain_flush (ZebraExplainInfo zei, void *updateHandle);
 
index 7fefb9b..ca0cb09 100644 (file)
@@ -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
 
    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)
 {
 
 static void count_set (RSET r, int *count)
 {
-    int psysno = 0;
+    zint psysno = 0;
     int kno = 0;
     struct it_key key;
     RSFD rfd;
     int kno = 0;
     struct it_key key;
     RSFD rfd;
index 4a44d06..088cf50 100644 (file)
@@ -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
 
    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)
 {
 
 static void search_terms (ZebraHandle zh, bend_search_rr *r)
 {
-    int count;
+    zint count;
     int no_terms;
     int i;
     int type;
     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]->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;
     }
         sr->elements[i]->subqueryWeight = 0;
         sr->elements[i]->resultsByDB = 0;
     }
index 1c9d085..1d24d9b 100644 (file)
@@ -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
 
    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 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);
                           int *type, char *out, size_t *len)
 {
     ZebraSet s = resultSetGet (zh, setname);
index 44c4a33..5e4bbce 100644 (file)
@@ -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
 
    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->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);
     if (is->debug)
         logf (LOG_LOG, "isams: isams_pp_open off=%d no=%d",
               pp->block_offset, pp->block_no);
index d0774b0..2e3a3a1 100644 (file)
@@ -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
 
    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, "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);
     if (p->fname)
     {
         data1_mk_text (p->dh, mem, i4, n);
index 60f80ab..2eb7866 100644 (file)
@@ -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
 
    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 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;
 
     const char *flags = NULL;
     int term_type = 0;