1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-12 19:22:41 +00:00

libdtsearch: Resolve uninitialized warnings

This commit is contained in:
Peter Howkins 2021-12-20 23:54:40 +00:00 committed by Jon Trulson
parent 320576e069
commit 182aa9fe5a
5 changed files with 27 additions and 27 deletions

View file

@ -94,7 +94,7 @@ long hilite_cleartext (int parse_type, char *stems, int stemcount)
PARG parg; PARG parg;
char * (*parser)() = usrblk.dblk->parser; char * (*parser)() = usrblk.dblk->parser;
char * (*stemmer)() = usrblk.dblk->stemmer; char * (*stemmer)() = usrblk.dblk->stemmer;
DtSrHitword *hitwords; DtSrHitword *hitwords = NULL;
size_t hitwords_size = 0; size_t hitwords_size = 0;
long hitwcount = 0; long hitwcount = 0;
long offset; long offset;
@ -158,11 +158,11 @@ long hilite_cleartext (int parse_type, char *stems, int stemcount)
hitwords = realloc (hitwords, hitwords = realloc (hitwords,
hitwords_size * sizeof(DtSrHitword) + 16); hitwords_size * sizeof(DtSrHitword) + 16);
} }
}
if (!hitwords) { if (!hitwords) {
fputs (PROGNAME"091 Out of Memory!\n", aa_stderr); fputs (PROGNAME"091 Out of Memory!\n", aa_stderr);
DtSearchExit (91); DtSearchExit (91);
} }
}
hitwords[hitwcount].offset = offset; hitwords[hitwcount].offset = offset;
hitwords[hitwcount].length = wordlen; hitwords[hitwcount].length = wordlen;
hitwcount++; hitwcount++;

View file

@ -84,8 +84,8 @@ int dbn /* Database number */
char *orec; /* ptr to current owner record contents in cache */ char *orec; /* ptr to current owner record contents in cache */
char *mrec; /* ptr to current member record contents in cache */ char *mrec; /* ptr to current member record contents in cache */
char *nrec; /* ptr to next member record contents in cache */ char *nrec; /* ptr to next member record contents in cache */
DB_ADDR mdba; /* db address of current member record */ DB_ADDR mdba = NULL; /* db address of current member record */
DB_ADDR ndba; /* db address of next member record */ DB_ADDR ndba = NULL; /* db address of next member record */
INT ordering; /* set order control variable */ INT ordering; /* set order control variable */
int stat, compare; /* status code & sort comparison result */ int stat, compare; /* status code & sort comparison result */
SET_ENTRY *set_ptr; SET_ENTRY *set_ptr;

View file

@ -811,10 +811,10 @@ LOOKUP_ENTRY * *xlu_ptr /* pointer to lookup table slot for found page*/
{ {
LOOKUP_ENTRY *lookup; /* = db_lookup or ix_lookup */ LOOKUP_ENTRY *lookup; /* = db_lookup or ix_lookup */
int pgtab_sz; /* = db_pgtab_sz or ix_pgtab_sz */ int pgtab_sz; /* = db_pgtab_sz or ix_pgtab_sz */
long cmp; long cmp = 0;
int cnt; int cnt;
int lu_slot, l, u; int lu_slot = 0, l, u;
LOOKUP_ENTRY *lu_ptr, *replu_ptr; LOOKUP_ENTRY *lu_ptr = NULL, *replu_ptr;
PAGE_ENTRY *pg_ptr; PAGE_ENTRY *pg_ptr;
int *lru_ptr; int *lru_ptr;
int pg_slot; int pg_slot;

View file

@ -380,8 +380,8 @@ int *slot_offset, /* slot position offset */
F_ADDR *child /* child ptr of located key */ F_ADDR *child /* child ptr of located key */
) )
{ {
int cmp, i, l, u, slot_pos; int cmp = 0, i = 0, l, u, slot_pos = 0;
char *node_slot_ptr; char *node_slot_ptr = NULL;
/* perform binary search on node */ /* perform binary search on node */
l = 0; l = 0;

View file

@ -303,7 +303,7 @@ DB_ADDR *db_addr
char *fptr; char *fptr;
const char *tfptr; const char *tfptr;
int s, i, strfld; int s, i, strfld;
FIELD_ENTRY *sfld_ptr; FIELD_ENTRY *sfld_ptr = NULL;
SORT_ENTRY *srt_ptr; SORT_ENTRY *srt_ptr;
DB_ADDR *co_ptr, *cm_ptr; DB_ADDR *co_ptr, *cm_ptr;
@ -402,7 +402,7 @@ DB_ADDR *db_addr
} }
} }
} }
if ( strfld >= 0 ) { if ( strfld >= 0 && sfld_ptr) {
/* insert the new struct key */ /* insert the new struct key */
if ( key_insert( strfld, rec + sfld_ptr->fd_ptr, dba ) != S_OKAY ) if ( key_insert( strfld, rec + sfld_ptr->fd_ptr, dba ) != S_OKAY )
return( db_status ); return( db_status );