-/* $Id: api.h,v 1.13 2005-01-24 14:44:23 adam Exp $
+/* $Id: api.h,v 1.14 2005-03-08 14:02:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
\param hits of hits is returned
*/
YAZ_EXPORT int zebra_search_PQF(ZebraHandle zh, const char *pqf_query,
- const char *setname, int *hits);
+ const char *setname, zint *hits);
/** \fn int zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query,
- const char *setname, int *hits)
+ const char *setname, zint *hits)
\brief Search using RPN Query
\param zh session handle
\param o ODR handle
\param hits number of hits is returned
*/
YAZ_EXPORT int zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query,
- const char *setname, int *hits);
+ const char *setname, zint *hits);
/**
\fn int zebra_records_retrieve(ZebraHandle zh, ODR stream,
-/* $Id: isamb.h,v 1.3 2005-01-15 19:38:24 adam Exp $
+/* $Id: isamb.h,v 1.4 2005-03-08 14:02:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
YAZ_EXPORT
ISAMB_PP isamb_pp_open_x(ISAMB isamb, ISAMB_P pos, int *level, int scope);
YAZ_EXPORT
-void isamb_pp_close_x(ISAMB_PP pp, int *size, int *blocks);
+void isamb_pp_close_x(ISAMB_PP pp, zint *size, zint *blocks);
YAZ_EXPORT
int isamb_block_info(ISAMB isamb, int cat);
-/* $Id: zebrautl.h,v 1.13 2005-01-15 19:38:24 adam Exp $
+/* $Id: zebrautl.h,v 1.14 2005-03-08 14:02:08 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
zint atoi_zn (const char *buf, zint len);
YAZ_END_CDECL
+#define CAST_ZINT_TO_INT(x) (int)(x)
+#define CAST_ZINT_TO_DOUBLE(x) (double)(x)
+
#endif
-/* $Id: extract.c,v 1.172 2005-03-05 09:19:14 adam Exp $
+/* $Id: extract.c,v 1.173 2005-03-08 14:02:09 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
(zh->reg->key_buf)[zh->reg->ptr_top - zh->reg->ptr_i] =
(char*)zh->reg->key_buf + zh->reg->key_buf_used;
- ch = key.mem[0]; /* ordinal for field/use/attribute */
+ ch = (int) key.mem[0]; /* ordinal for field/use/attribute */
zh->reg->key_buf_used +=
key_SU_encode (ch,((char*)zh->reg->key_buf) +
-/* $Id: invstat.c,v 1.43 2005-01-15 19:38:25 adam Exp $
+/* $Id: invstat.c,v 1.44 2005-03-08 14:02:09 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
int isam_occurrences[20];
char tmp[128];
int isamb_levels[10][5];
- int isamb_sizes[10];
- int isamb_blocks[10];
+ zint isamb_sizes[10];
+ zint isamb_blocks[10];
unsigned long cksum;
int dumpwords;
};
struct it_key key;
int cat = (int) (isam_p & 3);
int level;
- int size;
- int blocks;
+ zint size;
+ zint blocks;
pp = isamb_pp_open_x(stat_info->zh->reg->isamb, isam_p, &level, 0);
-/* $Id: rank1.c,v 1.22 2005-01-15 19:38:26 adam Exp $
+/* $Id: rank1.c,v 1.23 2005-03-08 14:02:12 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
NMEM nmem;
};
-static int log2_int (unsigned g)
+static int log2_int (zint g)
{
int n = 0;
while ((g = g>>1))
-/* $Id: zebraapi.c,v 1.152 2005-01-23 12:36:27 adam Exp $
+/* $Id: zebraapi.c,v 1.153 2005-03-08 14:02:12 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
}
int zebra_search_RPN (ZebraHandle zh, ODR o,
- Z_RPNQuery *query, const char *setname, int *hits)
+ Z_RPNQuery *query, const char *setname, zint *hits)
{
const char *max;
zint maxhits;
zh->records_processed, zh->records_inserted,
zh->records_updated, zh->records_deleted);
- status->processed = zh->records_processed;
- status->inserted = zh->records_inserted;
- status->updated = zh->records_updated;
- status->deleted = zh->records_deleted;
+ status->processed = (int) zh->records_processed;
+ status->inserted = (int) zh->records_inserted;
+ status->updated = (int) zh->records_updated;
+ status->deleted = (int) zh->records_deleted;
zebra_get_state (zh, &val, &seqno);
if (val != 'd')
*/
int zebra_search_PQF (ZebraHandle zh, const char *pqf_query,
- const char *setname, int *numhits)
+ const char *setname, zint *numhits)
{
- int hits = 0;
+ zint hits = 0;
int res = -1;
Z_RPNQuery *query;
ODR odr = odr_createmem(ODR_ENCODE);
-/* $Id: zinfo.h,v 1.22 2005-03-05 09:19:15 adam Exp $
+/* $Id: zinfo.h,v 1.23 2005-03-08 14:02:12 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
typedef struct {
int recordSize;
off_t recordOffset;
- int runNumber;
+ zint runNumber;
} RecordAttr;
RecordAttr *rec_init_attr (ZebraExplainInfo zei, Record rec);
-/* $Id: zserver.c,v 1.129 2005-01-21 18:41:19 adam Exp $
+/* $Id: zserver.c,v 1.130 2005-03-08 14:02:12 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
int bend_search (void *handle, bend_search_rr *r)
{
ZebraHandle zh = (ZebraHandle) handle;
+ zint zhits = 0;
r->hits = 0;
r->errcode = 0;
{
case Z_Query_type_1: case Z_Query_type_101:
zebra_search_RPN (zh, r->stream, r->query->u.type_1,
- r->setname, &r->hits);
+ r->setname, &zhits);
+ if (zhits > 2147483646)
+ r->hits = 2147483647;
+ else
+ r->hits = (int) zhits;
zebra_result (zh, &r->errcode, &r->errstring);
if (!r->errcode)
search_terms (zh, r);
-/* $Id: zsets.c,v 1.77 2005-01-15 19:38:30 adam Exp $
+/* $Id: zsets.c,v 1.78 2005-03-08 14:02:15 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
(zebraSet->hits)++;
psysno = this_sys;
}
- (*rc->add) (handle, seqno, termid);
+ (*rc->add) (handle, CAST_ZINT_TO_INT(seqno), termid);
if ((est==-2) && (zebraSet->hits==esthits))
{ /* time to estimate the hits */
-/* $Id: zvrank.c,v 1.15 2005-01-15 19:38:30 adam Exp $
+/* $Id: zvrank.c,v 1.16 2005-03-08 14:02:15 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
if (gocc==0)
idf=0.0;
else
- idf=blog(num_docs/gocc);
+ idf=blog(CAST_ZINT_TO_DOUBLE(num_docs/gocc));
idf=idf*idf;
ds->terms[i].idf=idf;
}
-/* $Id: isamb.c,v 1.72 2005-03-05 09:19:15 adam Exp $
+/* $Id: isamb.c,v 1.73 2005-03-08 14:02:15 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
while (pos > 127)
{
- *bp++ = 128 | (pos & 127);
+ *bp++ = (unsigned char) (128 | (pos & 127));
pos = pos >> 7;
}
- *bp++ = pos;
+ *bp++ = (unsigned char) pos;
*dst = (char *) bp;
}
#else
decode_ptr(&src, &isamb->file[i].head.first_block);
decode_ptr(&src, &isamb->file[i].head.last_block);
decode_ptr(&src, &zint_tmp);
- isamb->file[i].head.block_size = zint_tmp;
+ isamb->file[i].head.block_size = (int) zint_tmp;
decode_ptr(&src, &zint_tmp);
- isamb->file[i].head.block_max = zint_tmp;
+ isamb->file[i].head.block_max = (int) zint_tmp;
decode_ptr(&src, &isamb->file[i].head.free_list);
}
assert (isamb->file[i].head.block_size >= isamb->file[i].head.block_offset);
return isamb_pp_open_x(isamb, pos, 0, scope);
}
-void isamb_pp_close_x(ISAMB_PP pp, int *size, int *blocks)
+void isamb_pp_close_x(ISAMB_PP pp, zint *size, zint *blocks)
{
int i;
if (!pp)
assert(current);
assert(p->leaf);
- *total = pp->block[0]->no_items;
+ *total = (double) (pp->block[0]->no_items);
*current = (double) pp->returned_numbers;
#if ISAMB_DEBUG
yaz_log(YLOG_LOG, "isamb_pp_pos returning: cur= %0.1f tot=%0.1f rn="
-/* $Id: rsmultiandor.c,v 1.13 2005-01-15 20:47:16 adam Exp $
+/* $Id: rsmultiandor.c,v 1.14 2005-03-08 14:02:15 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
}
else
{
- *current = mrfd->hits;
+ *current = (double) (mrfd->hits);
*total = *current*stot/scur;
yaz_log(log_level, "r_pos: = %0.1f %0.1f", *current, *total);
}
-/* $Id: rsprox.c,v 1.24 2005-01-17 01:16:37 adam Exp $
+/* $Id: rsprox.c,v 1.25 2005-03-08 14:02:15 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
for (i = 0; i<n; i++)
{
- int diff = (*kctrl->getseq)(p->buf[1]) - seqno[i];
+ zint diff = (*kctrl->getseq)(p->buf[1]) - seqno[i];
int excl = info->exclusion;
if (!info->ordered && diff < 0)
diff = -diff;
*total = 0;
} else {
r = scur/stot;
- *current = p->hits;
+ *current = (double) p->hits;
*total=*current/r ;
}
yaz_log(YLOG_DEBUG,"prox_pos: [%d] %0.1f/%0.1f= %0.4f ",