-/* $Id: cfile.c,v 1.28 2004-08-04 08:35:22 adam Exp $
+/* $Id: cfile.c,v 1.29 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static int write_head (CFile cf)
{
- int left = cf->head.hash_size * sizeof(int);
+ int left = cf->head.hash_size * sizeof(zint);
int bno = 1;
const char *tab = (char*) cf->array;
static int read_head (CFile cf)
{
- int left = cf->head.hash_size * sizeof(int);
+ int left = cf->head.hash_size * sizeof(zint);
int bno = 1;
char *tab = (char*) cf->array;
cf->head.state = 1;
cf->head.block_size = block_size;
cf->head.hash_size = 199;
- hash_bytes = cf->head.hash_size * sizeof(int);
+ hash_bytes = cf->head.hash_size * sizeof(zint);
cf->head.flat_bucket = cf->head.next_bucket = cf->head.first_bucket =
(hash_bytes+sizeof(cf->head))/HASH_BSIZE + 2;
cf->head.next_block = 1;
if (wflag)
mf_write (cf->hash_mf, 0, 0, sizeof(cf->head), &cf->head);
- cf->array = (int *) xmalloc (hash_bytes);
+ cf->array = (zint *) xmalloc (hash_bytes);
for (i = 0; i<cf->head.hash_size; i++)
cf->array[i] = 0;
if (wflag)
*firstp = 0;
assert (cf->head.block_size == block_size);
assert (cf->head.hash_size > 2);
- hash_bytes = cf->head.hash_size * sizeof(int);
+ hash_bytes = cf->head.hash_size * sizeof(zint);
assert (cf->head.next_bucket > 0);
assert (cf->head.next_block > 0);
if (cf->head.state == 1)
- cf->array = (int *) xmalloc (hash_bytes);
+ cf->array = (zint *) xmalloc (hash_bytes);
else
cf->array = NULL;
read_head (cf);
return cf;
}
-static int cf_hash (CFile cf, int no)
+static int cf_hash (CFile cf, zint no)
{
- return (no>>3) % cf->head.hash_size;
+ return (int) (((no >> 3) % cf->head.hash_size));
}
static void release_bucket (CFile cf, struct CFile_hash_bucket *p)
}
}
-static struct CFile_hash_bucket *alloc_bucket (CFile cf, int block_no, int hno)
+static struct CFile_hash_bucket *alloc_bucket (CFile cf, zint block_no, int hno)
{
struct CFile_hash_bucket *p, **pp;
return p;
}
-static struct CFile_hash_bucket *get_bucket (CFile cf, int block_no, int hno)
+static struct CFile_hash_bucket *get_bucket (CFile cf, zint block_no, int hno)
{
struct CFile_hash_bucket *p;
return p;
}
-static struct CFile_hash_bucket *new_bucket (CFile cf, int *block_nop, int hno)
+static struct CFile_hash_bucket *new_bucket (CFile cf, zint *block_nop, int hno)
{
struct CFile_hash_bucket *p;
- int i, block_no;
+ int i;
+ zint block_no;
block_no = *block_nop = cf->head.next_bucket++;
p = alloc_bucket (cf, block_no, hno);
return p;
}
-static int cf_lookup_flat (CFile cf, int no)
+static zint cf_lookup_flat (CFile cf, zint no)
{
- int hno = (no*sizeof(int))/HASH_BSIZE;
- int off = (no*sizeof(int)) - hno*HASH_BSIZE;
- int vno = 0;
+ zint hno = (no*sizeof(zint))/HASH_BSIZE;
+ int off = (int) ((no*sizeof(zint)) - hno*HASH_BSIZE);
+ zint vno = 0;
- mf_read (cf->hash_mf, hno+cf->head.next_bucket, off, sizeof(int), &vno);
+ mf_read (cf->hash_mf, hno+cf->head.next_bucket, off, sizeof(zint), &vno);
return vno;
}
-static int cf_lookup_hash (CFile cf, int no)
+static zint cf_lookup_hash (CFile cf, zint no)
{
int hno = cf_hash (cf, no);
struct CFile_hash_bucket *hb;
- int block_no, i;
+ zint block_no;
+ int i;
for (hb = cf->parray[hno]; hb; hb = hb->h_next)
{
return 0;
}
-static void cf_write_flat (CFile cf, int no, int vno)
+static void cf_write_flat (CFile cf, zint no, zint vno)
{
- int hno = (no*sizeof(int))/HASH_BSIZE;
- int off = (no*sizeof(int)) - hno*HASH_BSIZE;
+ zint hno = (no*sizeof(zint))/HASH_BSIZE;
+ int off = (int) ((no*sizeof(zint)) - hno*HASH_BSIZE);
hno += cf->head.next_bucket;
if (hno >= cf->head.flat_bucket)
cf->head.flat_bucket = hno+1;
cf->dirty = 1;
- mf_write (cf->hash_mf, hno, off, sizeof(int), &vno);
+ mf_write (cf->hash_mf, hno, off, sizeof(zint), &vno);
}
static void cf_moveto_flat (CFile cf)
{
struct CFile_hash_bucket *p;
- int i, j;
+ int j;
+ zint i;
logf (LOG_DEBUG, "cf: Moving to flat shadow: %s", cf->rmf->name);
logf (LOG_DEBUG, "cf: hits=%d miss=%d bucket_in_memory=" ZINT_FORMAT " total="
cf->dirty = 1;
}
-static int cf_lookup (CFile cf, int no)
+static zint cf_lookup (CFile cf, zint no)
{
if (cf->head.state > 1)
return cf_lookup_flat (cf, no);
return cf_lookup_hash (cf, no);
}
-static int cf_new_flat (CFile cf, int no)
+static zint cf_new_flat (CFile cf, zint no)
{
- int vno = (cf->head.next_block)++;
+ zint vno = (cf->head.next_block)++;
cf_write_flat (cf, no, vno);
return vno;
}
-static int cf_new_hash (CFile cf, int no)
+static zint cf_new_hash (CFile cf, zint no)
{
int hno = cf_hash (cf, no);
struct CFile_hash_bucket *hbprev = NULL, *hb = cf->parray[hno];
- int *bucketpp = &cf->array[hno];
- int i, vno = (cf->head.next_block)++;
+ zint *bucketpp = &cf->array[hno];
+ int i;
+ zint vno = (cf->head.next_block)++;
for (hb = cf->parray[hno]; hb; hb = hb->h_next)
if (!hb->ph.vno[HASH_BUCKET-1])
return vno;
}
-int cf_new (CFile cf, int no)
+zint cf_new (CFile cf, zint no)
{
if (cf->head.state > 1)
return cf_new_flat (cf, no);
int cf_read (CFile cf, zint no, int offset, int nbytes, void *buf)
{
- int block;
+ zint block;
assert (cf);
zebra_mutex_lock (&cf->mutex);
int cf_write (CFile cf, zint no, int offset, int nbytes, const void *buf)
{
- int block;
+ zint block;
assert (cf);
zebra_mutex_lock (&cf->mutex);
-/* $Id: cfile.h,v 1.15 2004-08-04 08:35:22 adam Exp $
+/* $Id: cfile.h,v 1.16 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
#define HASH_BUCKET 15
struct CFile_ph_bucket { /* structure on disc */
- int no[HASH_BUCKET]; /* block number in original file */
- int vno[HASH_BUCKET]; /* block number in shadow file */
- int this_bucket; /* this bucket number */
- int next_bucket; /* next bucket number */
+ zint no[HASH_BUCKET]; /* block number in original file */
+ zint vno[HASH_BUCKET]; /* block number in shadow file */
+ zint this_bucket; /* this bucket number */
+ zint next_bucket; /* next bucket number */
};
struct CFile_hash_bucket {
} head;
MFile block_mf;
MFile hash_mf;
- int *array;
+ zint *array;
struct CFile_hash_bucket **parray;
struct CFile_hash_bucket *bucket_lru_front, *bucket_lru_back;
int dirty;
-/* $Id: commit.c,v 1.17 2004-08-04 08:35:22 adam Exp $
+/* $Id: commit.c,v 1.18 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
static void cf_commit_hash (CFile cf)
{
- int i, bucket_no;
+ int i;
+ zint bucket_no;
int hash_bytes;
struct CFile_ph_bucket *p;
#if CF_OPTIMIZE_COMMIT
#endif
p = (struct CFile_ph_bucket *) xmalloc (sizeof(*p));
- hash_bytes = cf->head.hash_size * sizeof(int);
+ hash_bytes = cf->head.hash_size * sizeof(zint);
bucket_no = cf->head.first_bucket;
for (; bucket_no < cf->head.next_bucket; bucket_no++)
{
static void cf_commit_flat (CFile cf)
{
zint *fp;
- int hno;
+ zint hno;
int i;
zint vno = 0;
-/* $Id: mfile.c,v 1.53 2004-08-04 08:35:22 adam Exp $
+/* $Id: mfile.c,v 1.54 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
return 0;
}
-static int file_position(MFile mf, int pos, int offset)
+static zint file_position(MFile mf, zint pos, int offset)
{
- int off = 0, c = mf->cur_file, ps;
+ zint off = 0, ps;
+ int c = mf->cur_file;
if ((c > 0 && pos <= mf->files[c-1].top) ||
(c < mf->no_files -1 && pos > mf->files[c].top))
SEEK_SET) < 0)
{
logf (LOG_WARN|LOG_ERRNO, "Failed to seek in %s", mf->files[c].path);
- logf(LOG_WARN, "pos=%d off=%d blocksize=%d offset=%d",
+ logf(LOG_WARN, "pos=" ZINT_FORMAT " off=" ZINT_FORMAT " blocksize=%d offset=%d",
pos, off, mf->blocksize, offset);
return -1;
}
static int cmp_part_file(const void *p1, const void *p2)
{
- return ((part_file *)p1)->number - ((part_file *)p2)->number;
+ zint d = ((part_file *)p1)->number - ((part_file *)p2)->number;
+ if (d > 0)
+ return 1;
+ if (d < 0)
+ return -1;
+ return 0;
}
/*
*/
int mf_read(MFile mf, zint no, int offset, int nbytes, void *buf)
{
- int rd, toread;
+ zint rd;
+ int toread;
zebra_mutex_lock (&mf->mutex);
if ((rd = file_position(mf, no, offset)) < 0)
*/
int mf_write(MFile mf, zint no, int offset, int nbytes, const void *buf)
{
- int ps, nblocks, towrite;
+ zint ps;
+ zint nblocks;
+ int towrite;
mf_dir *dp;
char tmp[FILENAME_MAX+1];
unsigned char dummych = '\xff';
-/* $Id: isam-codec.h,v 1.1 2004-08-04 08:35:23 adam Exp $
+/* $Id: isam-codec.h,v 1.2 2004-08-06 12:28:22 adam Exp $
Copyright (C) 2004
Index Data Aps
#define ISAM_CODEC_H
typedef struct {
- void *(*start)(void);
+ void *(*start)();
void (*stop)(void *p);
void (*decode)(void *p, char **dst, const char **src);
void (*encode)(void *p, char **dst, const char **src);
-/* $Id: recctrl.h,v 1.40 2002-10-22 12:51:08 adam Exp $
+/* $Id: recctrl.h,v 1.41 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
oid_value input_format; /* Preferred record syntax */
Z_RecordComposition *comp; /* formatting instructions */
char *encoding; /* preferred character encoding */
- int localno; /* local id of record */
+ zint localno; /* local id of record */
int score; /* score 0-1000 or -1 if none */
int recordSize; /* size of record in bytes */
char *fname; /* name of file (or NULL if internal) */
-/* $Id: rset.h,v 1.26 2004-08-06 10:09:27 heikki Exp $
+/* $Id: rset.h,v 1.27 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
struct rset_term {
char *name;
- int nn;
+ zint nn;
char *flags;
int count;
int type;
-/* $Id: zebraver.h,v 1.39 2004-08-04 08:35:23 adam Exp $
+/* $Id: zebraver.h,v 1.40 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#define ZEBRAVER "1.4.0"
-#define ZEBRADATE "$Date: 2004-08-04 08:35:23 $"
+#define ZEBRADATE "$Date: 2004-08-06 12:28:22 $"
#ifdef __GNUC__
typedef long long int zint;
#else
#ifdef WIN32
typedef __int64 zint;
-#define ZINT_FORMAT "%lld"
-#define ZINT_FORMAT0 "lld"
-#error must define ZINT_FORMAT on Windows
+#define ZINT_FORMAT "%I64d"
+#define ZINT_FORMAT0 "I64d"
#else
typedef long zint;
#define ZINT_FORMAT "%ld"
-/* $Id: invstat.c,v 1.36 2004-08-04 08:35:23 adam Exp $
+/* $Id: invstat.c,v 1.37 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
struct inv_stat_info {
ZebraHandle zh;
- int no_isam_entries[9];
+ zint no_isam_entries[9];
int no_dict_entries;
int no_dict_bytes;
int isam_bounds[20];
#define SINGLETON_TYPE 8 /* the type to use for singletons that */
/* have no block and no block type */
-static void print_dict_item (ZebraMaps zm, const char *s, int count,
+static void print_dict_item (ZebraMaps zm, const char *s, zint count,
int firstsys, int firstseq, int lastsys, int lastseq )
{
int reg_type = s[1];
static int inv_stat_handle (char *name, const char *info, int pos,
void *client)
{
- int occur = 0;
+ zint occur = 0;
int i = 0;
struct inv_stat_info *stat_info = (struct inv_stat_info*) client;
ISAMS_P isam_p;
{
ISPT ispt;
- ispt = is_position (stat_info->zh->reg->isam, isam_p);
+ ispt = is_position (stat_info->zh->reg->isam, (int) isam_p);
occur = is_numkeys (ispt);
stat_info->no_isam_entries[is_type(isam_p)] += occur;
is_pt_free (ispt);
if (stat_info->zh->reg->isamc)
{
ISAMC_PP pp;
- int occurx = 0;
+ zint occurx = 0;
struct it_key key;
pp = isc_pp_open (stat_info->zh->reg->isamc, isam_p);
{
ISAMB_PP pp;
struct it_key key;
- int cat = isam_p & 3;
+ int cat = (int) (isam_p & 3);
int level;
int size;
int blocks;
{
int i, prev;
int before = 0;
- int occur;
+ zint occur;
int after = 1000000000;
struct inv_stat_info stat_info;
char term_dict[2*IT_MAX_WORD+2];
-/* $Id: kcompare.c,v 1.49 2004-08-06 09:37:37 adam Exp $
+/* $Id: kcompare.c,v 1.50 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct it_key k;
memcpy (&k, p, sizeof(k));
#if IT_KEY_NEW
- return k.mem[k.len-1];
+ return (int) k.mem[k.len-1];
#else
return k.seqno;
#endif
while (d > 127)
{
- *bp++ = 128 | (d & 127);
+ *bp++ = (unsigned) (128 | (d & 127));
d = d >> 7;
}
- *bp++ = d;
+ *bp++ = (unsigned) d;
*dst = (char *) bp;
}
#endif
#if IT_KEY_NEW
- int leader = iscz1_decode_int ((unsigned char **) src);
+ int leader = (int) iscz1_decode_int ((unsigned char **) src);
i = leader & 7;
if (leader & 64)
p->key.mem[i] += iscz1_decode_int ((unsigned char **) src);
-/* $Id: recindex.c,v 1.35 2004-08-04 08:35:23 adam Exp $
+/* $Id: recindex.c,v 1.36 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
int r;
zint pos = (sysno-1)*itemsize;
- r = bf_read (p->index_BFile, 1+pos/128, pos%128, itemsize, buf);
+ r = bf_read (p->index_BFile, 1+pos/128, (int) (pos%128), itemsize, buf);
if (r != 1 && !ignoreError)
{
logf (LOG_FATAL|LOG_ERRNO, "read in %s at pos %ld",
{
zint pos = (sysno-1)*itemsize;
- bf_write (p->index_BFile, 1+pos/128, pos%128, itemsize, buf);
+ bf_write (p->index_BFile, 1+pos/128, (int) (pos%128), itemsize, buf);
}
static void rec_release_blocks (Records p, SYSNO sysno)
freeblock = entry.next;
assert (freeblock > 0);
- dst_type = freeblock & 7;
+ dst_type = (int) (freeblock & 7);
assert (dst_type < REC_BLOCK_TYPES);
freeblock = freeblock / 8;
while (freeblock)
(*len) = 0;
while (n > 127)
{
- buf[*len] = 128 + (n & 127);
+ buf[*len] = (unsigned) (128 + (n & 127));
n = n >> 7;
(*len)++;
}
- buf[*len] = n;
+ buf[*len] = (unsigned) n;
(*len)++;
}
if (!entry.size)
return NULL; /* record is deleted */
- dst_type = entry.next & 7;
+ dst_type = (int) (entry.next & 7);
assert (dst_type < REC_BLOCK_TYPES);
freeblock = entry.next / 8;
-/* $Id: recindxp.h,v 1.13 2004-08-04 08:35:23 adam Exp $
+/* $Id: recindxp.h,v 1.14 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct records_head {
char magic[8];
char version[4];
- zint block_size[REC_BLOCK_TYPES];
+ int block_size[REC_BLOCK_TYPES];
zint block_free[REC_BLOCK_TYPES];
zint block_last[REC_BLOCK_TYPES];
zint block_used[REC_BLOCK_TYPES];
-/* $Id: trunc.c,v 1.29 2004-08-04 08:35:23 adam Exp $
+/* $Id: trunc.c,v 1.30 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
ISAMS_P i1 = *(ISAMS_P*) p1;
ISAMS_P i2 = *(ISAMS_P*) p2;
- return i1 - i2;
+ if (i1 > i2)
+ return 1;
+ if (i1 < i2)
+ return -1;
+ return 0;
}
static int isam_trunc_cmp (const void *p1, const void *p2)
ISAMC_P i2 = *(ISAMC_P*) p2;
int d;
- d = isc_type (i1) - isc_type (i2);
+ d = (int) (isc_type (i1) - isc_type (i2));
if (d)
return d;
- return isc_block (i1) - isc_block (i2);
+ d = isc_block (i1) - isc_block (i2);
+ if (d > 0)
+ return 1;
+ else if (d < 0)
+ return -1;
+ return 0;
}
RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no,
-/* $Id: zvrank.c,v 1.8 2004-08-04 08:35:24 adam Exp $
+/* $Id: zvrank.c,v 1.9 2004-08-06 12:28:22 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
char *name;
int *id;
/**/
- int gocc;
+ zint gocc;
int locc;
double tf;
double idf;
static void idf_tfidf(void *rsi, void *dsi) {
RS rs=(RS)rsi;
DS ds=(DS)dsi;
- int num_docs, gocc;
+ zint num_docs, gocc;
int i, veclen;
double idf;
/* normal tfidf weight */
if (gocc==0)
idf=0.0;
else
- idf=blog(num_docs/gocc);
+ idf=blog((double) (num_docs/gocc));
ds->terms[i].idf=idf;
}
return;
static void idf_prob(void *rsi, void *dsi) {
RS rs=(RS)rsi;
DS ds=(DS)dsi;
- int num_docs, gocc;
+ zint num_docs, gocc;
int i, veclen;
double idf;
/* probabilistic formulation */
if (gocc==0)
idf=0.0;
else
- idf=blog((num_docs-gocc)/gocc);
+ idf=blog((double) ((num_docs-gocc)/gocc));
ds->terms[i].idf=idf;
}
return;
static void idf_squared(void *rsi, void *dsi) {
RS rs=(RS)rsi;
DS ds=(DS)dsi;
- int num_docs, gocc;
+ zint num_docs, gocc;
int i, veclen;
double idf;
/* idf ^ 2 */
struct rs_info *rs=(struct rs_info *)xmalloc(sizeof(*rs));
struct rank_class_info *ci=(struct rank_class_info *)class_handle;
int i;
- int veclen, gocc;
+ int veclen;
+ zint gocc;
/**/
yaz_log(LOG_DEBUG, "zv_begin");
veclen=rset->no_rset_terms; /* smaller vector here */
(*rs->d_norm_fct)(rs, rs->rdoc);
dscore=rs->sim_fct(rs->qdoc, rs->rdoc);
}
- score = dscore * 1000;
+ score = (int) dscore * 1000;
yaz_log (LOG_LOG, "sysno=" ZINT_FORMAT " score=%d", sysno, score);
if (score > 1000) /* should not happen */
score = 1000;
- return score;
+ return (int) score;
}
/*
-/* $Id: isamb.c,v 1.51 2004-08-06 10:09:27 heikki Exp $
+/* $Id: isamb.c,v 1.52 2004-08-06 12:28:23 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
static int get_block (ISAMB b, ISAMC_P pos, char *userbuf, int wr)
{
- int cat = pos&CAT_MASK;
- int off = ((pos/CAT_MAX) &
+ int cat = (int) (pos&CAT_MASK);
+ int off = (int) (((pos/CAT_MAX) &
(ISAMB_CACHE_ENTRY_SIZE / b->file[cat].head.block_size - 1))
- * b->file[cat].head.block_size;
- int norm = pos / (CAT_MASK*ISAMB_CACHE_ENTRY_SIZE / b->file[cat].head.block_size);
+ * b->file[cat].head.block_size);
+ zint norm = pos / (CAT_MASK*ISAMB_CACHE_ENTRY_SIZE / b->file[cat].head.block_size);
int no = 0;
struct ISAMB_cache_entry **ce, *ce_this = 0, **ce_last = 0;
static struct ISAMB_block *open_block (ISAMB b, ISAMC_P pos)
{
- int cat = pos&CAT_MASK;
+ int cat = (int) (pos&CAT_MASK);
struct ISAMB_block *p;
if (!pos)
return 0;
p = xmalloc (sizeof(*p));
p->pos = pos;
- p->cat = pos & CAT_MASK;
+ p->cat = (int) (pos & CAT_MASK);
p->buf = xmalloc (b->file[cat].head.block_size);
p->cbuf = 0;
if (!b->file[cat].head.free_list)
{
- int block_no;
+ zint block_no;
block_no = b->file[cat].head.last_block++;
p->pos = block_no * CAT_MAX + cat;
}
while (src <= half)
{
decode_ptr (&src, &split_size_tmp);
- *split_size = split_size_tmp;
+ *split_size = (int) split_size_tmp;
src += *split_size;
decode_ptr (&src, &pos);
memcpy (p->bytes, dst_buf, p_new_size);
decode_ptr (&src, &split_size_tmp);
- *split_size = split_size_tmp;
+ *split_size = (int) split_size_tmp;
memcpy (split_item, src, *split_size);
src += *split_size;
void isamb_dump (ISAMB b, ISAMB_P pos, void (*pr)(const char *str))
{
- return isamb_dump_r(b, pos, pr, 0);
+ isamb_dump_r(b, pos, pr, 0);
}
#if 0
} /* climb_level */
-static int isamb_pp_forward_unode(ISAMB_PP pp, int pos, const void *untilbuf)
+static zint isamb_pp_forward_unode(ISAMB_PP pp, zint pos, const void *untilbuf)
{ /* scans a upper node until it finds a child <= untilbuf */
/* pp points to the key value, as always. pos is the child read from */
/* the buffer */
decode_ptr (&src, &child );
}
if (level>0)
- isamb_pp_upper_pos(pp, current, total, *total, level-1);
+ isamb_pp_upper_pos(pp, current, total, (zint) *total, level-1);
} /* upper_pos */
void isamb_pp_pos( ISAMB_PP pp, double *current, double *total )
assert(p->leaf);
isamb_pp_leaf_pos(pp,current, total, dummy);
if (pp->level>0)
- isamb_pp_upper_pos(pp, current, total, *total, pp->level-1);
+ isamb_pp_upper_pos(pp, current, total, (zint) *total, pp->level-1);
}
-/* $Id: isamc-p.h,v 1.10 2004-08-04 08:35:24 adam Exp $
+/* $Id: isamc-p.h,v 1.11 2004-08-06 12:28:23 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
int no_forward;
int no_backward;
- int sum_forward;
- int sum_backward;
+ zint sum_forward;
+ zint sum_backward;
int no_next;
int no_prev;
int alloc_entries_max;
int fc_max;
- int *fc_list;
+ zint *fc_list;
} *ISAMC_file;
struct ISAMC_s {
-/* $Id: isamc.c,v 1.25 2004-08-04 08:35:24 adam Exp $
+/* $Id: isamc.c,v 1.26 2004-08-06 12:28:23 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
int j = 100;
is->files[cat].fc_max = j;
- is->files[cat].fc_list = (int *)
+ is->files[cat].fc_list = (zint *)
xmalloc (sizeof(*is->files[0].fc_list) * j);
while (--j >= 0)
is->files[cat].fc_list[j] = 0;
static void release_fc (ISAMC is, int cat)
{
- int b, j = is->files[cat].fc_max;
+ int j = is->files[cat].fc_max;
+ zint b;
while (--j >= 0)
if ((b = is->files[cat].fc_list[j]))
ISAMC_PP pp = (ISAMC_PP) xmalloc (sizeof(*pp));
char *src;
- pp->cat = isc_type(ipos);
+ pp->cat = (int) isc_type(ipos);
pp->pos = isc_block(ipos);
src = pp->buf = (char *) xmalloc (is->method->filecat[pp->cat].bsize);
-/* $Id: merge.c,v 1.24 2004-08-04 08:35:24 adam Exp $
+/* $Id: merge.c,v 1.25 2004-08-06 12:28:23 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
}
}
-static int get_border (ISAMC is, struct isc_merge_block *mb, int ptr,
- int cat, int firstpos)
+static int get_border (ISAMC is, struct isc_merge_block *mb, zint ptr,
+ int cat, zint firstpos)
{
/* Border set to initial fill or block size depending on
whether we are creating a new one or updating and old one.
int r_offset = 0; /* current offset in r_buf */
int ptr = 0; /* pointer */
void *r_clientData; /* encode client data */
- int border;
+ zint border;
zint numKeys = 0;
r_clientData = (*is->method->codec.start)();
-/* $Id: rsbool.c,v 1.35 2004-08-06 10:09:28 heikki Exp $
+/* $Id: rsbool.c,v 1.36 2004-08-06 12:28:23 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
return;
}
r=1.0*(lcur+rcur)/(ltot+rtot); /* weighed average of l and r */
- *current=p->hits;
+ *current=(double) (p->hits);
*total=*current/r ;
#if RSET_DEBUG
yaz_log(LOG_DEBUG,"bool_pos: (%s/%s) %0.1f/%0.1f= %0.4f ",
-/* $Id: rstemp.c,v 1.40 2004-08-06 10:09:28 heikki Exp $
+/* $Id: rstemp.c,v 1.41 2004-08-06 12:28:23 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
static void r_pos (RSFD rfd, double *current, double *total)
{
struct rset_temp_rfd *mrfd = (struct rset_temp_rfd*) rfd;
- *current=mrfd->cur;
- *total=mrfd->info->hits;
+ *current=(double) mrfd->cur;
+ *total=(double) mrfd->info->hits;
}