fix bad casts

This commit is contained in:
Vitor Santos Costa 2011-01-20 12:01:18 -06:00
parent d024e9f0ae
commit 4e90d68748

View File

@ -2430,18 +2430,15 @@ count_consts(GroupDef *grp)
static UInt static UInt
count_blobs(GroupDef *grp) count_blobs(GroupDef *grp)
{ {
Term current = MkAtomTerm(AtomFoundVar); UInt i = 1;
UInt i = 0; ClauseDef *cl = grp->FirstClause+1;
ClauseDef *cl = grp->FirstClause; Term current = grp->FirstClause->Tag;
while (TRUE) { while (cl <= grp->LastClause) {
if (current != cl->Tag) { if (current != cl->Tag) {
i++; i++;
current = cl->Tag; current = cl->Tag;
} }
if (cl == grp->LastClause) {
return i;
}
cl++; cl++;
} }
return i; return i;
@ -2653,9 +2650,13 @@ do_consts(GroupDef *grp, Term t, struct intermediates *cint, int compound_term,
return lbl; return lbl;
} }
int vsc_n;
static void static void
do_blobs(GroupDef *grp, Term t, struct intermediates *cint, UInt argno, int first, UInt nxtlbl, int clleft, CELL *top) do_blobs(GroupDef *grp, Term t, struct intermediates *cint, UInt argno, int first, UInt nxtlbl, int clleft, CELL *top)
{ {
vsc_n++;
if (vsc_n == 112205) jmp_deb(1);
COUNT n; COUNT n;
ClauseDef *min = grp->FirstClause; ClauseDef *min = grp->FirstClause;
COUNT i; COUNT i;
@ -3224,7 +3225,7 @@ do_dbref_index(ClauseDef *min, ClauseDef* max, Term t, struct intermediates *cin
Yap_emit(label_op, labl, Zero, cint); Yap_emit(label_op, labl, Zero, cint);
Yap_emit(index_dbref_op, Zero, Zero, cint); Yap_emit(index_dbref_op, Zero, Zero, cint);
sort_group(group,(CELL *)(group+1),cint); sort_group(group,(CELL *)(group+1),cint);
do_blobs(group, t, cint, argno, first, fail_l, clleft, (CELL *)group+1); do_blobs(group, t, cint, argno, first, fail_l, clleft, (CELL *)(group+1));
return labl; return labl;
} }
} }
@ -3261,7 +3262,7 @@ do_blob_index(ClauseDef *min, ClauseDef* max, Term t, struct intermediates *cint
else else
Yap_emit(index_long_op, Zero, Zero, cint); Yap_emit(index_long_op, Zero, Zero, cint);
sort_group(group,(CELL *)(group+1),cint); sort_group(group,(CELL *)(group+1),cint);
do_blobs(group, t, cint, argno, first, fail_l, clleft, (CELL *)group+1); do_blobs(group, t, cint, argno, first, fail_l, clleft, (CELL *)(group+1));
return labl; return labl;
} }
} }