X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=isamc%2Fmerge-d.c;h=2912ecfaa7d7339dc9023dd5c7a02dbdc1888ebf;hb=ae2d0647bd3a555df77397b6c2f9c129fda0733a;hp=d73a459c4242688d63b8350530a5e7561cb6b383;hpb=896c0427df9d8eff5de6a1735dcd992e067df844;p=idzebra-moved-to-github.git diff --git a/isamc/merge-d.c b/isamc/merge-d.c index d73a459..2912ecf 100644 --- a/isamc/merge-d.c +++ b/isamc/merge-d.c @@ -1,4 +1,4 @@ -/* $Id: merge-d.c,v 1.28 2002-08-02 19:26:56 adam Exp $ +/* $Id: merge-d.c,v 1.30 2003-03-05 16:41:10 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -43,11 +43,11 @@ struct ISAMD_DIFF_s { int difftype; }; -#define DT_NONE 0 // no diff, marks end of sequence -#define DT_DIFF 1 // ordinarry diff -#define DT_MAIN 2 // main data -#define DT_INPU 3 // input data to be merged -#define DT_DONE 4 // done with all input here +#define DT_NONE 0 /* no diff, marks end of sequence */ +#define DT_DIFF 1 /* ordinarry diff */ +#define DT_MAIN 2 /* main data */ +#define DT_INPU 3 /* input data to be merged */ +#define DT_DONE 4 /* done with all input here */ @@ -156,16 +156,19 @@ static int filter_isempty(FILTER F) return ( (0 == F->r1) && (0 == F->r2)) ; } +#if 0 static int filter_only_one(FILTER F) { return ( (0 != F->r1) && (0 == F->r2)); } +#endif /* We may need backfilling, if we read a lonely key to make */ /* a singleton, but its bitw will not fit in. Then we need to */ /* process it normally, which means reading it again. So we */ /* need to unread it first. Luckily the filter is empty at that */ /* point */ +#if 0 static void filter_backfill(FILTER F, struct it_key *k, int mode) { assert(F->r1 == FILTER_NOTYET ); /* not overwriting data! */ @@ -173,7 +176,7 @@ static void filter_backfill(FILTER F, struct it_key *k, int mode) F->m1=mode; F->r1=1; /* ok read */ } - +#endif /*************************************************************** * Singleton encoding @@ -374,7 +377,7 @@ static void getDiffInfo(ISAMD_PP pp ) if (0==pp->diffinfo[i].maxidx) { - if (pp->is->method->debug > 5) //!!! 4 + if (pp->is->method->debug > 5) /* !!! 4 */ logf(LOG_LOG,"isamd_getDiffInfo:End mark at ix=%d n=%d", diffidx, i); return; /* end marker */ @@ -514,7 +517,7 @@ int isamd_read_item_merge ( ; /* find last diff */ if (p_key) { /* we have an extra item to inject into the merge */ - if (pp->is->method->debug >9) //!!!!! + if (pp->is->method->debug >9) /* !!!!! */ logf(LOG_LOG,"isamd_read_item: going to merge with %d.%d", p_key->sysno, p_key->seqno); pp->diffinfo[i].key = *p_key; /* the key merge could not handle */ @@ -737,8 +740,6 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ /* set up diffs as they should be for reading */ diffidx = ISAMD_BLOCK_OFFSET_1; - //readpp->diffbuf=readpp->buf; // diffinfo has to duplicate it! - //getDiffInfo(readpp); // first read will make the diffinfo, at init if (readpp->is->method->debug >4) logf(LOG_LOG,"isamd_merge: f=%d=%d:%d n=%d=%d:%d", @@ -805,9 +806,6 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ } /* while read */ -// firstpp->diffs=0; - - isamd_reduceblock(pp); /* reduce size if possible */ if (0==firstpp->next) firstpp->next = isamd_addr(pp->pos,pp->cat); @@ -907,7 +905,6 @@ static int append_diffs( diffidx+=sizeof(int); /* difflen will be stored here */ /* read first input */ - //i_ptr = i_item; //!!! i_more = filter_read(filt, &i_key, &i_mode); /* i_more = (*data->read_item)(data->clientData, &i_ptr, &i_mode); */ @@ -954,7 +951,7 @@ static int append_diffs( { /* max size - can't help, need to merge it */ if (is->method->debug >7) logf(LOG_LOG,"isamd_appd: need to merge"); - if (is->method->debug >9) //!!!!! + if (is->method->debug >9) /* !!!!! */ logf(LOG_LOG,"isamd_appd: going to merge with m=%d %d.%d", i_mode, i_key.sysno, i_key.seqno); merge_rc = merge (firstpp, &i_key, filt, dictentry, dictlen); @@ -1103,7 +1100,13 @@ int isamd_append (ISAMD is, char *dictentry, int dictlen, ISAMD_I data) /* * $Log: merge-d.c,v $ - * Revision 1.28 2002-08-02 19:26:56 adam + * Revision 1.30 2003-03-05 16:41:10 adam + * Fix GCC warnings + * + * Revision 1.29 2002/11/26 22:18:34 adam + * Remove // comments + * + * Revision 1.28 2002/08/02 19:26:56 adam * Towards GPL * * Revision 1.27 2002/07/12 18:12:21 heikki