fix count clauses

fix bigint in index.c


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@824 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2003-05-01 21:07:11 +00:00
parent 9a498e00f3
commit 6e17ac0070
2 changed files with 12 additions and 11 deletions

View File

@@ -1445,7 +1445,6 @@ p_number_of_clauses(void)
Term t2 = Deref(ARG2);
int ncl = 0;
Prop pe;
yamop *q;
int mod;
if (IsVarTerm(t2) || !IsAtomTerm(t2)) {
@@ -1458,19 +1457,13 @@ p_number_of_clauses(void)
} else if (IsApplTerm(t)) {
register Functor f = FunctorOfTerm(t);
pe = PredPropByFunc(f, mod);
} else
} else {
return (FALSE);
q = RepPredProp(pe)->cs.p_code.FirstClause;
READ_LOCK(RepPredProp(pe)->PRWLock);
if (q != NIL) {
while (q != RepPredProp(pe)->cs.p_code.LastClause) {
ncl++;
q = NextClause(q);
}
}
READ_LOCK(RepPredProp(pe)->PRWLock);
ncl = RepPredProp(pe)->cs.p_code.NOfClauses;
READ_UNLOCK(RepPredProp(pe)->PRWLock);
t = MkIntegerTerm(ncl);
return (Yap_unify_constant(ARG3, t));
return (Yap_unify_constant(ARG3, MkIntegerTerm(ncl)));
}
static Int