diff --git a/C/cdmgr.c b/C/cdmgr.c index c5f7e9e02..954ce3513 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -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 diff --git a/C/index.c b/C/index.c index 34c1d6db4..1ffe60d7c 100644 --- a/C/index.c +++ b/C/index.c @@ -1124,7 +1124,11 @@ add_info(ClauseDef *clause, UInt regno) case _get_bigint: if (regcopy_in(myregs, nofregs, cl->u.xc.x)) { clause->WorkPC = cl; +#ifdef USE_GMP clause->Tag = AbsAppl((CELL *)FunctorBigInt); +#else + clause->Tag = AbsAppl((CELL *)FunctorLongInt); +#endif return; } else { cl = NEXTOP(cl,xc); @@ -1673,7 +1677,11 @@ add_arg_info(ClauseDef *clause, UInt argno) case _unify_bigint: case _unify_l_bigint: if (argno == 1) { +#ifdef USE_GMP clause->Tag = AbsAppl((CELL *)FunctorBigInt); +#else + clause->Tag = AbsAppl((CELL *)FunctorLongInt); +#endif return; } argno--;