+Fixed several compilation warnings. (gcc 4.1.2, -O3 -g -Wall)
+
+Fixed bug #710: Duplicate keys for CDATA in xelm/melm rules.
+
--- 1.3.44 2006/10/23
Fixed bug #529: multiple simultaneous updates by extended services trashes
-/* $Id: bfile.c,v 1.35.2.2 2006-10-04 09:07:19 adam Exp $
+/* $Id: bfile.c,v 1.35.2.3 2006-10-27 11:06:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
void bf_commitClean (BFiles bfs, const char *spec)
{
- FILE *inf;
- int block_size;
- char path[256];
- MFile mf;
- CFile cf;
int mustDisable = 0;
- int firstTime;
if (!bfs->commit_area)
{
-/* $Id: mfile.c,v 1.52.2.2 2006-10-04 09:07:19 adam Exp $
+/* $Id: mfile.c,v 1.52.2.3 2006-10-27 11:06:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
void mf_destroy(MFile_area ma)
{
mf_dir *dp;
- meta_file *meta_f;
if (!ma)
return;
-/* $Id: rsm_or.h,v 1.6.2.1 2006-08-14 10:38:56 adam Exp $
+/* $Id: rsm_or.h,v 1.6.2.2 2006-10-27 11:06:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
int (*cmp)(const void *p1, const void *p2);
ISAMC isc;
- ISAM_P *isam_positions;
+ ISAMC_P *isam_positions;
RSET_TERM rset_term;
int no_isam_positions;
-/* $Id: extract.c,v 1.157.2.4 2006-08-14 10:38:57 adam Exp $
+/* $Id: extract.c,v 1.157.2.5 2006-10-27 11:06:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
int set, use, slen;
- off += key_SU_decode(&set, sk->buf + off);
- off += key_SU_decode(&use, sk->buf + off);
- off += key_SU_decode(&slen, sk->buf + off);
+ off += key_SU_decode(&set, (const unsigned char *) sk->buf + off);
+ off += key_SU_decode(&use, (const unsigned char *) sk->buf + off);
+ off += key_SU_decode(&slen, (const unsigned char *) sk->buf + off);
off += slen;
if (p->attrSet == set && p->attrUse == use)
return;
{
int set, use, slen;
- off += key_SU_decode(&set, sk->buf + off);
- off += key_SU_decode(&use, sk->buf + off);
- off += key_SU_decode(&slen, sk->buf + off);
+ off += key_SU_decode(&set, (const unsigned char *) sk->buf + off);
+ off += key_SU_decode(&use, (const unsigned char *) sk->buf + off);
+ off += key_SU_decode(&slen, (const unsigned char *) sk->buf + off);
sortIdx_type(sortIdx, use);
if (cmd == 1)
Licensed under the Academic Free License version 1.1.
http://opensource.org/licenses/academic.php
-$Id: livcode.c,v 1.2 2004-08-04 08:35:23 adam Exp $
+$Id: livcode.c,v 1.1.2.1 2006-10-27 11:06:46 adam Exp $
*/
general->len = thisop->u.attributesPlusTerm->term->u.general->len ;
general->size = thisop->u.attributesPlusTerm->term->u.general->size ;
general->buf = malloc( general->size ) ;
- strcpy( general->buf,
- thisop->u.attributesPlusTerm->term->u.general->buf ) ;
+ strcpy( (char *) general->buf,
+ (const char *)
+ thisop->u.attributesPlusTerm->term->u.general->buf ) ;
return operand ;
}
* score should be between 0 and 1000. If score cannot be obtained
* -1 should be returned.
*/
-static int calc (void *set_handle, zint sysno)
+static int calc (void *set_handle, int sysno)
{
int i, lo, divisor, score = 0;
struct rank_set_info *si = (struct rank_set_info *) set_handle;
- logf (LOG_DEBUG, "livrank calc sysno=" ZINT_FORMAT, sysno);
+ logf (LOG_DEBUG, "livrank calc sysno=%d", sysno);
if (!si->no_rank_entries)
return -1;
-/* $Id: main.c,v 1.112.2.6 2006-08-14 10:38:59 adam Exp $
+/* $Id: main.c,v 1.112.2.7 2006-10-27 11:06:46 adam Exp $
Copyright (C) 1995-2005
Index Data Aps
#include <expat.h>
#endif
-#include <data1.h>
+#include <yaz/options.h>
#include "zebraapi.h"
char *prog;
-/* $Id: recindex.c,v 1.34.2.3 2006-08-14 10:38:59 adam Exp $
+/* $Id: recindex.c,v 1.34.2.4 2006-10-27 11:06:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
return p;
}
-static void rec_encode_unsigned (unsigned n, unsigned char *buf, int *len)
+static void rec_encode_unsigned (unsigned n, char *buf, int *len)
{
(*len) = 0;
while (n > 127)
(*len)++;
}
-static void rec_decode_unsigned(unsigned *np, unsigned char *buf, int *len)
+static void rec_decode_unsigned(unsigned *np, char *buf, int *len)
{
+ unsigned char *cp = (unsigned char *) buf;
unsigned n = 0;
unsigned w = 1;
(*len) = 0;
- while (buf[*len] > 127)
+ while (cp[*len] > 127)
{
- n += w*(buf[*len] & 127);
+ n += w*(cp[*len] & 127);
w = w << 7;
(*len)++;
}
- n += w * buf[*len];
+ n += w * cp[*len];
(*len)++;
*np = n;
}
*sysnop = -1;
if (ref_count)
{
- int csize = 0; /* indicate compression "not performed yet" */
+ unsigned int csize = 0; /* indicate compression "not performed yet" */
compression_method = p->compression_method;
switch (compression_method)
{
char *in_buf = 0;
char *bz_buf = 0;
#if HAVE_BZLIB_H
- int bz_size;
+ unsigned int bz_size;
#endif
char compression_method;
nptr = in_buf; /* skip ref count */
while (nptr < in_buf + in_size)
{
- int this_sysno;
+ unsigned int this_sysno;
int len;
rec_decode_unsigned (&this_sysno, nptr, &len);
nptr += len;
for (i = 0; i < REC_NO_INFO; i++)
{
- int this_size;
+ unsigned int this_size;
rec_decode_unsigned (&this_size, nptr, &len);
nptr += len;
-/* $Id: zebraapi.c,v 1.120.2.18 2006-10-26 23:46:25 adam Exp $
+/* $Id: zebraapi.c,v 1.120.2.19 2006-10-27 11:06:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
&sysno,
0, /* match */
0, /* fname */
- oct->buf, oct->len,
+ (char *) oct->buf, oct->len,
0);
}
}
-/* $Id: zrpn.c,v 1.141.2.15 2006-08-14 10:39:01 adam Exp $
+/* $Id: zrpn.c,v 1.141.2.16 2006-10-27 11:06:46 adam Exp $
Copyright (C) 1995-2005
Index Data Aps
int set, use;
char term_tmp[IT_MAX_WORD];
int su_code = 0;
- int len = key_SU_decode(&su_code, name);
+ int len = key_SU_decode(&su_code, (const unsigned char *) name);
term_untrans(p->zh, p->reg_type, term_tmp, name+len+1);
yaz_log(LOG_LOG, "grep: %d %c %s", su_code, name[len], term_tmp);
case Z_Term_general:
if (zh->iconv_to_utf8 != 0)
{
- char *inbuf = term->u.general->buf;
+ char *inbuf = (char *) term->u.general->buf;
size_t inleft = term->u.general->len;
char *outbuf = termz;
size_t outleft = IT_MAX_WORD-1;
int j, j0 = -1;
const char *mterm = NULL;
const char *tst;
- RSET rset;
+ RSET rset = 0;
int lo = i + pos-1; /* offset in result list */
for (j = 0; j < ord_no; j++)
-/* $Id: zserver.c,v 1.117.2.6 2006-08-14 10:39:01 adam Exp $
+/* $Id: zserver.c,v 1.117.2.7 2006-10-27 11:06:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
int r = zebra_admin_exchange_record (
zh,
- rec->u.octet_aligned->buf,
+ (const char *) rec->u.octet_aligned->buf,
rec->u.octet_aligned->len,
- opaque_recid->buf, opaque_recid->len,
+ (const char *) opaque_recid->buf,
+ opaque_recid->len,
action);
if (r)
{
&sysno,
0, /* match */
0, /* fname */
- rec->u.octet_aligned->buf,
+ (const char *) rec->u.octet_aligned->buf,
rec->u.octet_aligned->len,
0);
if (r)
&sysno,
0, /* match */
0, /* fname */
- rec->u.octet_aligned->buf,
+ (const char *) rec->u.octet_aligned->buf,
rec->u.octet_aligned->len,
1);
if (r)
&sysno,
0, /* match */
0, /* fname */
- rec->u.octet_aligned->buf,
+ (const char *) rec->u.octet_aligned->buf,
rec->u.octet_aligned->len,
0);
if (r)
-/* $Id: isamb.c,v 1.47.2.6 2006-08-14 17:14:08 adam Exp $
+/* $Id: isamb.c,v 1.47.2.7 2006-10-27 11:06:46 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)
+static int get_block (ISAMB b, ISAMC_P pos, unsigned char *ub, int wr)
{
+ char *userbuf = (char *) ub;
int cat = pos&CAT_MASK;
int off = ((pos/CAT_MAX) &
(ISAMB_CACHE_ENTRY_SIZE / b->file[cat].head.block_size - 1))
abort();
}
}
- p->bytes = p->buf + ISAMB_DATA_OFFSET;
+ p->bytes = (char *) p->buf + ISAMB_DATA_OFFSET;
p->leaf = p->buf[0];
p->size = (p->buf[1] + 256 * p->buf[2]) - ISAMB_DATA_OFFSET;
if (p->size < 0)
p->cat = cat;
b->file[cat].head_dirty = 1;
memset (p->buf, 0, b->file[cat].head.block_size);
- p->bytes = p->buf + ISAMB_DATA_OFFSET;
+ p->bytes = (char *) p->buf + ISAMB_DATA_OFFSET;
p->leaf = leaf;
p->size = 0;
p->dirty = 1;
-/* $Id: isamc.c,v 1.24.2.1 2006-08-14 10:39:10 adam Exp $
+/* $Id: isamc.c,v 1.24.2.2 2006-10-27 11:06:47 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
/* returns non-zero if item could be read; 0 otherwise */
int isc_pp_read (ISAMC_PP pp, void *buf)
{
- return isc_read_item (pp, (char **) &buf);
+ char *cp = buf;
+ return isc_read_item (pp, &cp);
}
/* read one item from file - decode and store it in *dst.
-/* $Id: isamd.c,v 1.27.2.1 2006-08-14 10:39:10 adam Exp $
+/* $Id: isamd.c,v 1.27.2.2 2006-10-27 11:06:47 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
/* returns non-zero if item could be read; 0 otherwise */
int isamd_pp_read (ISAMD_PP pp, void *buf)
{
-
- return isamd_read_item (pp, (char **) &buf);
+ char *cp = buf;
+ return isamd_read_item (pp, &cp);
/* note: isamd_read_item is in merge-d.c, because it is so */
/* convoluted with the merge process */
}
-/* $Id: merge-d.c,v 1.30.2.1 2006-08-14 10:39:11 adam Exp $
+/* $Id: merge-d.c,v 1.30.2.2 2006-10-27 11:06:47 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (pp->is->method->debug > 5)
logf(LOG_LOG,"isamd_getDiff[%d]:%d-%d %s",
i,diffidx-sizeof(int),pp->diffinfo[i].maxidx,
- hexdump((char *)&pp->diffbuf[diffidx-4],8,0) );
+ hexdump((unsigned char *)&pp->diffbuf[diffidx-4],8,0) );
diffidx=pp->diffinfo[i].maxidx;
if ( diffidx > pp->is->method->filecat[pp->cat].bsize )
return; /* whole block done */
assert ( (codelen<128) && (codelen>0));
if (pp->is->method->debug >7)
logf(LOG_LOG,"isamd:build: coded %s nk=%d,ofs=%d-%d",
- hexdump(codebuff, c_ptr-codebuff,hexbuff), firstpp->numKeys+1,
+ hexdump((unsigned char *) codebuff, c_ptr-codebuff,hexbuff), firstpp->numKeys+1,
pp->offset, pp->offset+codelen);
if (pp->offset + codelen > maxsize )
assert ( (codelen<128) && (codelen>0));
if (pp->is->method->debug >7)
logf(LOG_LOG,"isamd:build: recoded into %s (nk=%d)",
- hexdump(codebuff, c_ptr-codebuff,hexbuff), firstpp->numKeys+1);
+ hexdump((unsigned char *) codebuff, c_ptr-codebuff,hexbuff), firstpp->numKeys+1);
} /* block full */
assert (pp->offset + codelen <= maxsize );
if (pp->is->method->debug > 9)
logf(LOG_LOG,"isamd_read_item: dif[%d] at %d-%d: %s",
i,oldoffs, pp->diffinfo[i].diffidx,
- hexdump(pp->buf+oldoffs, pp->diffinfo[i].diffidx-oldoffs,0));
+ hexdump((unsigned char *) pp->buf+oldoffs, pp->diffinfo[i].diffidx-oldoffs,0));
if (pp->is->method->debug > 7)
logf(LOG_LOG,"isamd_read_item: rd dif[%d] %d.%d (%x.%x)",
i,
char *i_item = (char *) &i_key; /* same as chars */
char *i_ptr=i_item;
int i_more =1;
- int i_mode; /* 0 for delete, 1 for insert */
+ int i_mode = 1; /* 0 for delete, 1 for insert */
ISAMD_PP firstpp;
char hexbuff[64];
assert ( (codelen<128) && (codelen>0));
if (is->method->debug >7)
logf(LOG_LOG,"isamd_appd: coded %d: %s (nk=%d) (ix=%d)",
- codelen, hexdump(codebuff, codelen,hexbuff),
+ codelen, hexdump((unsigned char *) codebuff, codelen,hexbuff),
firstpp->numKeys,diffidx);
if (diffidx + codelen > maxsize )
/*
* $Log: merge-d.c,v $
- * Revision 1.30.2.1 2006-08-14 10:39:11 adam
+ * Revision 1.30.2.2 2006-10-27 11:06:47 adam
+ * Fixed several compilation warnings. (gcc 4.1.2, -O3 -g -Wall)
+ *
+ * Revision 1.30.2.1 2006/08/14 10:39:11 adam
* Update copyright year + FSF address
*
* Revision 1.30 2003/03/05 16:41:10 adam
-/* $Id: isams.c,v 1.5.2.1 2006-08-14 10:39:15 adam Exp $
+/* $Id: isams.c,v 1.5.2.2 2006-10-27 11:06:48 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
int isams_pp_read (ISAMS_PP pp, void *buf)
{
- return isams_read_item (pp, (char **) &buf);
+ char *buf_cp = buf;
+ return isams_read_item (pp, &buf_cp);
}
int isams_read_item (ISAMS_PP pp, char **dst)
-/* $Id: flock.c,v 1.4.2.4 2006-10-23 11:37:11 adam Exp $
+/* $Id: flock.c,v 1.4.2.5 2006-10-27 11:06:48 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
int zebra_lock_w(ZebraLockHandle h)
{
- int r;
+ int r = 0;
int do_lock = 0;
logf(log_level, "zebra_lock_w fd=%d p=%p fname=%s begin",
h->p->fd, h, h->p->fname);
int zebra_lock_r(ZebraLockHandle h)
{
- int r;
+ int r = 0;
int do_lock = 0;
logf(log_level, "zebra_lock_r fd=%d p=%p fname=%s begin",