1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

libDtSearch: Resolve 38 -Wformat warnings

This commit is contained in:
Peter Howkins 2012-11-12 16:26:11 +00:00
parent a10520c43c
commit 9040256676
8 changed files with 37 additions and 37 deletions

View file

@ -221,7 +221,7 @@ BAD_DBA:
if (debugging_boolsrch) { if (debugging_boolsrch) {
fprintf (aa_stderr, fprintf (aa_stderr,
PROGNAME"434 Invalid dba %ld. " PROGNAME"434 Invalid dba %ld. "
"recno=%ld bitvec[%d]=%02x db_status=%d.\n", "recno=%ld bitvec[%ld]=%02x db_status=%d.\n",
objrecdba, recno, recno>>3, 1<<(recno%8), db_status); objrecdba, recno, recno>>3, 1<<(recno%8), db_status);
fflush (aa_stderr); fflush (aa_stderr);
} }
@ -270,7 +270,7 @@ static void calculate_idfs (void)
if (debugging_boolsrch) if (debugging_boolsrch)
fprintf (aa_stderr, fprintf (aa_stderr,
PROGNAME"733 IDF[%d] numdocs=%5ld idf=%lf\n", PROGNAME"733 IDF[%d] numdocs=%5ld idf=%lf\n",
i, or_wordrecs[i].or_hwaddrs, idf[i]); i, (long) or_wordrecs[i].or_hwaddrs, idf[i]);
} }
} }
return; return;
@ -356,9 +356,9 @@ static int load_or_wordrecs (void)
} }
if (debugging_boolsrch) if (debugging_boolsrch)
fprintf (aa_stderr, "ofs=%ld addrs=%ld free=%ld\n", fprintf (aa_stderr, "ofs=%ld addrs=%ld free=%ld\n",
wordrec->or_hwoffset, (long) wordrec->or_hwoffset,
wordrec->or_hwaddrs, (long) wordrec->or_hwaddrs,
wordrec->or_hwfree); (long) wordrec->or_hwfree);
if (wordrec->or_hwaddrs > OE_words_hitlimit) { if (wordrec->or_hwaddrs > OE_words_hitlimit) {
sprintf (msgbuf, catgets (dtsearch_catd, MS_boolsrch, 14, sprintf (msgbuf, catgets (dtsearch_catd, MS_boolsrch, 14,
"%s '%s' has more than %ld hits.\n" "%s '%s' has more than %ld hits.\n"
@ -1373,7 +1373,7 @@ DONE_READING:
if (debugging_boolsrch) { if (debugging_boolsrch) {
int i; int i;
if (debugging_boolsrch) if (debugging_boolsrch)
fprintf (aa_stderr, PROGNAME"313 BITVEC[%ld]:\n", save_stemno); fprintf (aa_stderr, PROGNAME"313 BITVEC[%d]:\n", save_stemno);
for (i=0; i<bitveclen; i++) { for (i=0; i<bitveclen; i++) {
fprintf (aa_stderr, " %02x", bitvecs[save_stemno][i]); fprintf (aa_stderr, " %02x", bitvecs[save_stemno][i]);
if (i > 22) if (i > 22)
@ -1489,7 +1489,7 @@ void boolean_search (void)
,need_zero_permute ,need_zero_permute
,do_stat_sort ,do_stat_sort
,aa_maxhits ,aa_maxhits
,usrblk.dblk->dbrec.or_maxdba ,(long) usrblk.dblk->dbrec.or_maxdba
,or_reccount ,or_reccount
,or_recslots ,or_recslots
,tot_addr_count ,tot_addr_count
@ -1520,16 +1520,16 @@ void boolean_search (void)
allocsz_needed = bitveclen * (saveusr.stemcount + 1); allocsz_needed = bitveclen * (saveusr.stemcount + 1);
if (debugging_boolsrch) if (debugging_boolsrch)
fprintf (aa_stderr, PROGNAME"430 " fprintf (aa_stderr, PROGNAME"430 "
"bitvecs[] alloc needed=%ld (bvln=%ld stems=%d+1), have=%ld.\n", "bitvecs[] alloc needed=%lu (bvln=%ld stems=%d+1), have=%lu.\n",
allocsz_needed, bitveclen, saveusr.stemcount, bitvec_allocsz); (unsigned long) allocsz_needed, bitveclen, saveusr.stemcount, (unsigned long) bitvec_allocsz);
if (bitvec_allocsz < allocsz_needed) { if (bitvec_allocsz < allocsz_needed) {
if (bitvec_allocp) if (bitvec_allocp)
free (bitvec_allocp); free (bitvec_allocp);
bitvec_allocp = austext_malloc (allocsz_needed + 16, bitvec_allocp = austext_malloc (allocsz_needed + 16,
PROGNAME"508", NULL); PROGNAME"508", NULL);
if (debugging_boolsrch) if (debugging_boolsrch)
fprintf (aa_stderr, PROGNAME"432 bitvecs[] realloc %ld-->%ld.\n", fprintf (aa_stderr, PROGNAME"432 bitvecs[] realloc %lu-->%lu.\n",
bitvec_allocsz, allocsz_needed); (unsigned long) bitvec_allocsz, (unsigned long) allocsz_needed);
bitvec_allocsz = allocsz_needed; bitvec_allocsz = allocsz_needed;
} }

View file

@ -258,7 +258,7 @@ int oe_unblob (LLIST *bloblist)
if (usrblk.debug & USRDBG_RETRVL) if (usrblk.debug & USRDBG_RETRVL)
fprintf (aa_stderr, PROGNAME "256 " fprintf (aa_stderr, PROGNAME "256 "
"oe_unblob: actual decompressed length = %ld.\n", "oe_unblob: actual decompressed length = %ld.\n",
targ - (UCHAR *) usrblk.cleartext); (long) (targ - (UCHAR *) usrblk.cleartext));
return OE_OK; return OE_OK;
} /* oe_unblob() */ } /* oe_unblob() */
@ -816,7 +816,7 @@ NO_TEXT:
fprintf (aa_stderr, PROGNAME "1089 RECKEY2DBA: " fprintf (aa_stderr, PROGNAME "1089 RECKEY2DBA: "
"retncode=%d, reckey='%s' ->\tdba=%ld:%ld\n", "retncode=%d, reckey='%s' ->\tdba=%ld:%ld\n",
usrblk.retncode, usrblk.query, usrblk.retncode, usrblk.query,
(usrblk.dba) >> 24, (usrblk.dba) & 0xffffff); (long) ((usrblk.dba) >> 24), (long) ((usrblk.dba) & 0xffffff));
break; break;
case OE_DELETE_RECID: case OE_DELETE_RECID:

View file

@ -228,8 +228,8 @@ char *get_hitlist_text (int maxlen)
if (usrblk.debug & USRDBG_UTIL) if (usrblk.debug & USRDBG_UTIL)
fprintf (aa_stderr, PROGNAME "160 " fprintf (aa_stderr, PROGNAME "160 "
"get_hitlist_text(): mallocsz=%ld textlen=%ld\n", "get_hitlist_text(): mallocsz=%lu textlen=%lu\n",
mallocsz, strlen (text)); (unsigned long) mallocsz, (unsigned long) strlen (text));
return text; return text;
} /* get_hitlist_text() */ } /* get_hitlist_text() */

View file

@ -272,10 +272,10 @@ int ve_initialize (void)
fprintf (aa_stderr, fprintf (aa_stderr,
"\tvers='%s' reccount=%ld maxdba=%ld fzkeysz=%d\n" "\tvers='%s' reccount=%ld maxdba=%ld fzkeysz=%d\n"
"\tdbflags=x%lx maxwordsz=%d hufid=%ld abstrsz=%d\n", "\tdbflags=x%lx maxwordsz=%d hufid=%ld abstrsz=%d\n",
db->dbrec.or_version, db->dbrec.or_reccount, db->dbrec.or_version, (long) db->dbrec.or_reccount,
db->dbrec.or_maxdba, db->dbrec.or_fzkeysz, (long) db->dbrec.or_maxdba, db->dbrec.or_fzkeysz,
db->dbrec.or_dbflags, db->dbrec.or_maxwordsz, (unsigned long) db->dbrec.or_dbflags, db->dbrec.or_maxwordsz,
db->dbrec.or_hufid, db->dbrec.or_abstrsz); (long) db->dbrec.or_hufid, db->dbrec.or_abstrsz);
} }
/*-------------- OPEN D97 and D98 FILES ---------------- /*-------------- OPEN D97 and D98 FILES ----------------
@ -888,8 +888,8 @@ LLIST *ve_getblobs (DtSrINT32 dba, int vistano)
fprintf (aa_stderr, PROGNAME "792 ve_getblobs: " fprintf (aa_stderr, PROGNAME "792 ve_getblobs: "
"db='%s'[v#%d] dba=%ld:%ld v#=%d sz=%ld: '%s'\n", "db='%s'[v#%d] dba=%ld:%ld v#=%d sz=%ld: '%s'\n",
usrblk.dblk->name, usrblk.dblk->vistano, usrblk.dblk->name, usrblk.dblk->vistano,
dba >> 24, dba % 0xffffff, vistano, (long) (dba >> 24), (long) (dba % 0xffffff), vistano,
myobjbuf.or_objsize, myobjbuf.or_objkey); (long) myobjbuf.or_objsize, myobjbuf.or_objkey);
} }
/* Retrieve blobs and append to end of growing list. /* Retrieve blobs and append to end of growing list.

View file

@ -153,7 +153,7 @@ long hilite_cleartext (int parse_type, char *stems, int stemcount)
hitwords_size += hitwords_size >> 1; /* 1.5 times */ hitwords_size += hitwords_size >> 1; /* 1.5 times */
if (debugging_hilite || (usrblk.debug & USRDBG_RETRVL)) if (debugging_hilite || (usrblk.debug & USRDBG_RETRVL))
fprintf (aa_stderr, fprintf (aa_stderr,
PROGNAME"098 realloc for %ld hitwords.\n", PROGNAME"098 realloc for %d hitwords.\n",
hitwords_size); hitwords_size);
hitwords = realloc (hitwords, hitwords = realloc (hitwords,
hitwords_size * sizeof(DtSrHitword) + 16); hitwords_size * sizeof(DtSrHitword) + 16);

View file

@ -455,7 +455,7 @@ static UCHAR *kanji_compounder (void)
if (debugging_jpn) if (debugging_jpn)
fprintf (aa_stderr, fprintf (aa_stderr,
"knjcompdr: subofs=%2ld totofs=%3ld \"%s\"\n", "knjcompdr: subofs=%2ld totofs=%3ld \"%s\"\n",
mysubstrp - substrbuf, *offsetp, outbuf); (long) (mysubstrp - substrbuf), *offsetp, outbuf);
return outbuf; return outbuf;
} }
} }
@ -633,7 +633,7 @@ static UCHAR *parse_substring (void)
if (debugging_jpn) { if (debugging_jpn) {
int i; int i;
fprintf (aa_stderr, "jpnsubstr: js=%s len=%ld str='", fprintf (aa_stderr, "jpnsubstr: js=%s len=%ld str='",
display_jstate(last_jstate), substrlen); display_jstate(last_jstate), (long) substrlen);
for (i = 0; i < substrlen; i++) for (i = 0; i < substrlen; i++)
fputc ((substrbuf[i] < 32)? '~' : substrbuf[i], fputc ((substrbuf[i] < 32)? '~' : substrbuf[i],
aa_stderr); aa_stderr);
@ -824,7 +824,7 @@ char *jpn_parser (PARG *parg)
if (debugging_jpn) { if (debugging_jpn) {
fprintf (aa_stderr, fprintf (aa_stderr,
"jpnparser: start text block, substrbufsz=%ld.\n", "jpnparser: start text block, substrbufsz=%ld.\n",
substrbufsz); (long) substrbufsz);
fflush (aa_stderr); fflush (aa_stderr);
} }
@ -886,9 +886,9 @@ FILL_ANOTHER_SUBSTRING:
size_t curlen = substrp - substrbuf; size_t curlen = substrp - substrbuf;
if (debugging_jpn) { if (debugging_jpn) {
fprintf (aa_stderr, fprintf (aa_stderr,
"jpnparser: curr substr len %ld, " "jpnparser: curr substr len %lu, "
"new substrbufsz %ld.\n", "new substrbufsz %lu.\n",
curlen, substrbufsz<<1); (unsigned long) curlen, (unsigned long) substrbufsz<<1);
fflush (aa_stderr); fflush (aa_stderr);
} }
substrbufsz <<= 1; /* double its size */ substrbufsz <<= 1; /* double its size */

View file

@ -261,7 +261,7 @@ static int search_wordtree (WORDTREE *wordtree, UCHAR *wordstring)
/* Descend left or right depending on word */ /* Descend left or right depending on word */
if (debugging_search_wordtree) if (debugging_search_wordtree)
fprintf (aa_stderr, " %c '%s'\n", fprintf (aa_stderr, " %c '%s'\n",
(direction < 0) ? 'L' : 'R', node->word); (direction < 0) ? 'L' : 'R', (char *) node->word);
if (direction < 0) if (direction < 0)
node = node->llink; node = node->llink;
else else
@ -380,8 +380,8 @@ char *teskey_parser (PARG *parg)
endmaxword = outbuf + maxwordsz; endmaxword = outbuf + maxwordsz;
if (debugging_teskey) if (debugging_teskey)
fprintf (aa_stderr, fprintf (aa_stderr,
"teskey: start of text block, maxwsz=%ld outbufsz=%ld\n", "teskey: start of text block, maxwsz=%d outbufsz=%lu\n",
maxwordsz, outbufsz); maxwordsz, (unsigned long) outbufsz);
readcount = 0L; readcount = 0L;
} }

View file

@ -193,7 +193,7 @@ static int delete_addrs (void)
printf (PROGNAME "80 " printf (PROGNAME "80 "
"fseek failed on '%s%s.d99'. Offset=%ld. Word='%s'.\n", "fseek failed on '%s%s.d99'. Offset=%ld. Word='%s'.\n",
usrblk.dblk->path, usrblk.dblk->name, usrblk.dblk->path, usrblk.dblk->name,
got_hword.or_hwoffset, keyptr); (long) got_hword.or_hwoffset, keyptr);
DtSearchExit (99); DtSearchExit (99);
} }
write_offset = ftell (dtbs_addr_fp); write_offset = ftell (dtbs_addr_fp);
@ -276,9 +276,9 @@ static int delete_addrs (void)
ncopy, dtbs_addr_fp); ncopy, dtbs_addr_fp);
if (num_writes != ncopy) { if (num_writes != ncopy) {
printf (PROGNAME "283 fwrite at pos %ld failed on '%s%s.d99'.\n" printf (PROGNAME "283 fwrite at pos %ld failed on '%s%s.d99'.\n"
" Wrote %ld dba's instead of %ld dba's.\n", " Wrote %lu dba's instead of %lu dba's.\n",
write_offset, usrblk.dblk->path, usrblk.dblk->name, write_offset, usrblk.dblk->path, usrblk.dblk->name,
num_writes, ncopy); (unsigned long) num_writes, (unsigned long) ncopy);
DtSearchExit (99); DtSearchExit (99);
} }
write_offset = ftell (dtbs_addr_fp); write_offset = ftell (dtbs_addr_fp);
@ -496,7 +496,7 @@ NOTHING_TO_DO:
/*--------- Gendler's SWORD Loop ---------*/ /*--------- Gendler's SWORD Loop ---------*/
/* every database has short words */ /* every database has short words */
fprintf (aa_stderr, PROGNAME "368 " fprintf (aa_stderr, PROGNAME "368 "
"Entering SHORT word loop. Each dot = %ld words.\n", "Entering SHORT word loop. Each dot = %d words.\n",
WORDS_PER_DOT); WORDS_PER_DOT);
fflush (aa_stderr); fflush (aa_stderr);
word_count = 0; word_count = 0;
@ -530,7 +530,7 @@ NOTHING_TO_DO:
/*--------- Gendler's LWORD Loop ---------*/ /*--------- Gendler's LWORD Loop ---------*/
fprintf (aa_stderr, PROGNAME "398 " fprintf (aa_stderr, PROGNAME "398 "
"Entering LONG word loop. Each dot = %ld words.\n", "Entering LONG word loop. Each dot = %d words.\n",
WORDS_PER_DOT); WORDS_PER_DOT);
fflush (aa_stderr); fflush (aa_stderr);
word_count = 0; word_count = 0;
@ -562,7 +562,7 @@ NOTHING_TO_DO:
/*--------- Gendler's HWORD Loop --------- */ /*--------- Gendler's HWORD Loop --------- */
fprintf (aa_stderr, PROGNAME "429 " fprintf (aa_stderr, PROGNAME "429 "
"Entering HUGE word loop. Each dot = %ld words.\n", "Entering HUGE word loop. Each dot = %d words.\n",
WORDS_PER_DOT); WORDS_PER_DOT);
fflush (aa_stderr); fflush (aa_stderr);
word_count = 0; word_count = 0;