From a8b86c35a39ce9eb5279c46dd99ef7e91b83fb7b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 6 Aug 2004 12:55:01 +0000 Subject: [PATCH] Fix term counters to be of type zint. Fix several printfs of zint. --- bfile/cfile.c | 7 ++++--- bfile/commit.c | 7 ++++--- bfile/mfile.c | 6 +++--- include/rset.h | 4 ++-- index/invstat.c | 14 ++++++++------ index/recstat.c | 4 ++-- index/zsets.c | 6 +++--- isamc/merge.c | 8 +++++--- recctrl/recgrs.c | 4 ++-- recctrl/rectext.c | 5 +++-- rset/rsisamb.c | 4 ++-- rset/rsisamc.c | 4 ++-- rset/rsm_or.c | 4 ++-- rset/rstemp.c | 4 ++-- 14 files changed, 44 insertions(+), 37 deletions(-) diff --git a/bfile/cfile.c b/bfile/cfile.c index 3023ec5..82f84f4 100644 --- a/bfile/cfile.c +++ b/bfile/cfile.c @@ -1,4 +1,4 @@ -/* $Id: cfile.c,v 1.29 2004-08-06 12:28:22 adam Exp $ +/* $Id: cfile.c,v 1.30 2004-08-06 12:55:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -466,7 +466,7 @@ int cf_read (CFile cf, zint no, int offset, int nbytes, void *buf) zebra_mutex_unlock (&cf->mutex); if (!mf_read (cf->block_mf, block, offset, nbytes, buf)) { - logf (LOG_FATAL|LOG_ERRNO, "cf_read no=" ZINT_FORMAT ", block=%d", no, block); + logf (LOG_FATAL|LOG_ERRNO, "cf_read no=" ZINT_FORMAT " block=" ZINT_FORMAT, no, block); exit (1); } return 1; @@ -493,7 +493,8 @@ int cf_write (CFile cf, zint no, int offset, int nbytes, const void *buf) zebra_mutex_unlock (&cf->mutex); if (mf_write (cf->block_mf, block, offset, nbytes, buf)) { - logf (LOG_FATAL|LOG_ERRNO, "cf_write no=" ZINT_FORMAT ", block=%d", no, block); + logf (LOG_FATAL|LOG_ERRNO, "cf_write no=" ZINT_FORMAT + " block=" ZINT_FORMAT, no, block); exit (1); } return 0; diff --git a/bfile/commit.c b/bfile/commit.c index 29a7312..94c31c1 100644 --- a/bfile/commit.c +++ b/bfile/commit.c @@ -1,4 +1,4 @@ -/* $Id: commit.c,v 1.18 2004-08-06 12:28:22 adam Exp $ +/* $Id: commit.c,v 1.19 2004-08-06 12:55:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -202,7 +202,8 @@ static void cf_commit_flat (CFile cf) if (!mf_read (cf->hash_mf, hno, 0, 0, fp) && hno != cf->head.flat_bucket-1) { - logf (LOG_FATAL, "read index block hno=%d (" ZINT_FORMAT "-" ZINT_FORMAT ") commit", + logf (LOG_FATAL, "read index block hno=" ZINT_FORMAT + " (" ZINT_FORMAT "-" ZINT_FORMAT ") commit", hno, cf->head.next_bucket, cf->head.flat_bucket-1); } for (i = 0; i < (int) (HASH_BSIZE/sizeof(int)); i++) @@ -214,7 +215,7 @@ static void cf_commit_flat (CFile cf) #else if (!mf_read (cf->block_mf, fp[i], 0, 0, cf->iobuf)) { - logf (LOG_FATAL, "read data block hno=%d (" ZINT_FORMAT "-" ZINT_FORMAT ") " + logf (LOG_FATAL, "read data block hno=" ZINT_FORMAT " (" ZINT_FORMAT "-" ZINT_FORMAT ") " "i=%d commit block at " ZINT_FORMAT " (->" ZINT_FORMAT")", hno, cf->head.next_bucket, cf->head.flat_bucket-1, i, fp[i], vno); diff --git a/bfile/mfile.c b/bfile/mfile.c index 9ea9201..3993e34 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -1,4 +1,4 @@ -/* $Id: mfile.c,v 1.54 2004-08-06 12:28:22 adam Exp $ +/* $Id: mfile.c,v 1.55 2004-08-06 12:55:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -521,7 +521,7 @@ int mf_write(MFile mf, zint no, int offset, int nbytes, const void *buf) if ((nblocks = (int) (mf->files[mf->cur_file].dir->avail_bytes / mf->blocksize)) > 0) { - logf (LOG_DEBUG, "Capping off file %s at pos %d", + logf (LOG_DEBUG, "Capping off file %s at pos " ZINT_FORMAT, mf->files[mf->cur_file].path, nblocks); if ((ps = file_position(mf, (mf->cur_file ? mf->files[mf->cur_file-1].top : 0) + @@ -531,7 +531,7 @@ int mf_write(MFile mf, zint no, int offset, int nbytes, const void *buf) mf->name); exit(1); } - logf (LOG_DEBUG, "ps = %d", ps); + logf (LOG_DEBUG, "ps = " ZINT_FORMAT, ps); if (write(mf->files[mf->cur_file].fd, &dummych, 1) < 1) { logf (LOG_ERRNO|LOG_FATAL, "mf_write %s internal error (3)", diff --git a/include/rset.h b/include/rset.h index b6da795..e83870b 100644 --- a/include/rset.h +++ b/include/rset.h @@ -1,4 +1,4 @@ -/* $Id: rset.h,v 1.27 2004-08-06 12:28:22 adam Exp $ +/* $Id: rset.h,v 1.28 2004-08-06 12:55:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -61,7 +61,7 @@ struct rset_term { char *name; zint nn; char *flags; - int count; + zint count; int type; }; diff --git a/index/invstat.c b/index/invstat.c index a29be66..a02a1a6 100644 --- a/index/invstat.c +++ b/index/invstat.c @@ -1,5 +1,5 @@ -/* $Id: invstat.c,v 1.37 2004-08-06 12:28:22 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: invstat.c,v 1.38 2004-08-06 12:55:01 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps This file is part of the Zebra server. @@ -64,7 +64,7 @@ static void print_dict_item (ZebraMaps zm, const char *s, zint count, } *to = '\0'; /* yaz_log (LOG_LOG, "%s", keybuf); */ - printf("%10d %s %d.%d - %d.%d\n",count, keybuf, + printf("%10" ZINT_FORMAT0 " %s %d.%d - %d.%d\n", count, keybuf, firstsys,firstseq, lastsys,lastseq); } @@ -260,7 +260,8 @@ int zebra_register_statistics (ZebraHandle zh, int dumpdict) fprintf (stdout, " Blocks Occur Size KB Bytes/Entry\n"); for (i = 0; isc_block_used (zh->reg->isamc, i) >= 0; i++) { - fprintf (stdout, " %8" ZINT_FORMAT0 " %8d", isc_block_used (zh->reg->isamc, i), + fprintf (stdout, " %8" ZINT_FORMAT0 " %8" ZINT_FORMAT0, + isc_block_used (zh->reg->isamc, i), stat_info.no_isam_entries[i]); if (stat_info.no_isam_entries[i]) @@ -287,7 +288,8 @@ int zebra_register_statistics (ZebraHandle zh, int dumpdict) fprintf (stdout, "Block size %d\n", bsize); fprintf (stdout, "Blocks: %d\n", stat_info.isamb_blocks[i]); fprintf (stdout, "Size: %d\n", stat_info.isamb_sizes[i]); - fprintf (stdout, "Entries: %d\n", stat_info.no_isam_entries[i]); + fprintf (stdout, "Entries: " ZINT_FORMAT "\n", + stat_info.no_isam_entries[i]); fprintf (stdout, "Total %d\n", stat_info.isamb_blocks[i]* bsize); for (j = 0; j<5; j++) @@ -303,7 +305,7 @@ int zebra_register_statistics (ZebraHandle zh, int dumpdict) occur = 0; for (i = 0; i<9; i++) occur += stat_info.no_isam_entries[i]; - fprintf (stdout, "Word pos %d\n", occur); + fprintf (stdout, "Word pos " ZINT_FORMAT "\n", occur); fprintf (stdout, " Occurrences Words\n"); prev = 1; for (i = 0; stat_info.isam_bounds[i]; i++) diff --git a/index/recstat.c b/index/recstat.c index b14f5a2..e452d7a 100644 --- a/index/recstat.c +++ b/index/recstat.c @@ -1,4 +1,4 @@ -/* $Id: recstat.c,v 1.9 2004-08-04 08:35:23 adam Exp $ +/* $Id: recstat.c,v 1.10 2004-08-06 12:55:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -41,7 +41,7 @@ void rec_prstat (Records records) for (i = 0; i< REC_BLOCK_TYPES; i++) { - logf (LOG_LOG, "Record blocks of size " ZINT_FORMAT, + logf (LOG_LOG, "Record blocks of size %d", records->head.block_size[i]); logf (LOG_LOG, " Used/Total/Bytes used " diff --git a/index/zsets.c b/index/zsets.c index 15fa83c..1c9d085 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -1,4 +1,4 @@ -/* $Id: zsets.c,v 1.52 2004-08-06 10:09:27 heikki Exp $ +/* $Id: zsets.c,v 1.53 2004-08-06 12:55:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -697,7 +697,7 @@ void resultSetSortSingle (ZebraHandle zh, NMEM nmem, rset_close (rset, rfd); for (i = 0; i < rset->no_rset_terms; i++) - yaz_log (LOG_LOG, "term=\"%s\" nn=%d type=%s count=%d", + yaz_log (LOG_LOG, "term=\"%s\" nn=" ZINT_FORMAT " type=%s count=" ZINT_FORMAT, rset->rset_terms[i]->name, rset->rset_terms[i]->nn, rset->rset_terms[i]->flags, @@ -802,7 +802,7 @@ void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset) rset_close (rset, rfd); for (i = 0; i < rset->no_rset_terms; i++) - yaz_log (LOG_LOG, "term=\"%s\" nn=%d type=%s count=%d", + yaz_log (LOG_LOG, "term=\"%s\" nn=" ZINT_FORMAT " type=%s count=" ZINT_FORMAT, rset->rset_terms[i]->name, rset->rset_terms[i]->nn, rset->rset_terms[i]->flags, diff --git a/isamc/merge.c b/isamc/merge.c index 9f010c5..c816766 100644 --- a/isamc/merge.c +++ b/isamc/merge.c @@ -1,4 +1,4 @@ -/* $Id: merge.c,v 1.25 2004-08-06 12:28:23 adam Exp $ +/* $Id: merge.c,v 1.26 2004-08-06 12:55:02 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -345,7 +345,8 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) if (border < new_offset && border >= r_offset) { if (debug > 2) - logf (LOG_LOG, "isc: border %d %d", ptr, border); + logf (LOG_LOG, "isc: border %d " ZINT_FORMAT, + ptr, border); /* Max size of current block category reached ... make new virtual block entry */ mb[++ptr].block = 0; @@ -421,7 +422,8 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) ptr = j; border = get_border (is, mb, ptr, cat, firstpos); if (debug > 3) - logf (LOG_LOG, "isc: border=%d r_offset=%d", border, r_offset); + logf (LOG_LOG, "isc: border=" ZINT_FORMAT " r_offset=%d", + border, r_offset); } } if (mb[ptr].offset < r_offset) diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index 4a0f045..d0774b0 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -1,4 +1,4 @@ -/* $Id: recgrs.c,v 1.86 2004-05-21 11:58:56 adam Exp $ +/* $Id: recgrs.c,v 1.87 2004-08-06 12:55:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -1046,7 +1046,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) dnew->u.data.what = DATA1I_text; dnew->u.data.data = dnew->lbuf; - sprintf(dnew->u.data.data, "%d", p->localno); + sprintf(dnew->u.data.data, ZINT_FORMAT, p->localno); dnew->u.data.len = strlen(dnew->u.data.data); } #if 0 diff --git a/recctrl/rectext.c b/recctrl/rectext.c index de72fdb..fd7f38d 100644 --- a/recctrl/rectext.c +++ b/recctrl/rectext.c @@ -1,4 +1,4 @@ -/* $Id: rectext.c,v 1.18 2004-06-16 20:32:41 adam Exp $ +/* $Id: rectext.c,v 1.19 2004-08-06 12:55:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -183,7 +183,8 @@ static int text_retrieve (void *clientData, struct recRetrieveCtrl *p) sprintf (text_buf, "Rank: %d\n", p->score); text_ptr = strlen(text_buf); } - sprintf (text_buf + text_ptr, "Local Number: %d\n", p->localno); + sprintf (text_buf + text_ptr, "Local Number: " ZINT_FORMAT "\n", + p->localno); text_ptr = strlen(text_buf); if (p->fname) { diff --git a/rset/rsisamb.c b/rset/rsisamb.c index d3f8399..7965ece 100644 --- a/rset/rsisamb.c +++ b/rset/rsisamb.c @@ -1,4 +1,4 @@ -/* $Id: rsisamb.c,v 1.13 2004-08-06 10:09:28 heikki Exp $ +/* $Id: rsisamb.c,v 1.14 2004-08-06 12:55:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -63,7 +63,7 @@ struct rset_pp_info { ISAMB_PP pt; struct rset_pp_info *next; struct rset_isamb_info *info; - int *countp; + zint *countp; void *buf; }; diff --git a/rset/rsisamc.c b/rset/rsisamc.c index d9f85db..d005fb9 100644 --- a/rset/rsisamc.c +++ b/rset/rsisamc.c @@ -1,4 +1,4 @@ -/* $Id: rsisamc.c,v 1.16 2004-08-03 14:54:41 heikki Exp $ +/* $Id: rsisamc.c,v 1.17 2004-08-06 12:55:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -57,7 +57,7 @@ struct rset_pp_info { ISAMC_PP pt; struct rset_pp_info *next; struct rset_isamc_info *info; - int *countp; + zint *countp; void *buf; }; diff --git a/rset/rsm_or.c b/rset/rsm_or.c index 0569d83..953c9f8 100644 --- a/rset/rsm_or.c +++ b/rset/rsm_or.c @@ -1,4 +1,4 @@ -/* $Id: rsm_or.c,v 1.16 2004-08-03 14:54:41 heikki Exp $ +/* $Id: rsm_or.c,v 1.17 2004-08-06 12:55:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -89,7 +89,7 @@ struct rset_mor_rfd { struct rset_mor_rfd *next; struct rset_mor_info *info; struct trunc_info *ti; - int *countp; + zint *countp; char *pbuf; }; diff --git a/rset/rstemp.c b/rset/rstemp.c index 0df8f16..b06a1fa 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -1,4 +1,4 @@ -/* $Id: rstemp.c,v 1.41 2004-08-06 12:28:23 adam Exp $ +/* $Id: rstemp.c,v 1.42 2004-08-06 12:55:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -79,7 +79,7 @@ struct rset_temp_info { struct rset_temp_rfd { struct rset_temp_info *info; struct rset_temp_rfd *next; - int *countp; + zint *countp; void *buf; size_t pos_cur; /* current position in set */ zint cur; /* number of the current hit */ -- 1.7.10.4