Stasinos noticed that _YAP_ breaks C standard: use Yap_ instead.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@691 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
46
C/eval.c
46
C/eval.c
@@ -27,7 +27,7 @@ static char SccsId[] = "%W% %G%";
|
||||
#include "Heap.h"
|
||||
#include "eval.h"
|
||||
|
||||
yap_error_number _YAP_matherror = YAP_NO_ERROR;
|
||||
yap_error_number Yap_matherror = YAP_NO_ERROR;
|
||||
|
||||
#define E_FUNC blob_type
|
||||
#define E_ARGS arith_retptr o
|
||||
@@ -48,7 +48,7 @@ EvalToTerm(blob_type bt, union arith_ret *res)
|
||||
return(MkFloatTerm(res->dbl));
|
||||
#ifdef USE_GMP
|
||||
case big_int_e:
|
||||
return(_YAP_MkBigIntTerm(res->big));
|
||||
return(Yap_MkBigIntTerm(res->big));
|
||||
#endif
|
||||
default:
|
||||
return(TermNil);
|
||||
@@ -59,7 +59,7 @@ static E_FUNC
|
||||
Eval(Term t, E_ARGS)
|
||||
{
|
||||
if (IsVarTerm(t)) {
|
||||
_YAP_Error(INSTANTIATION_ERROR,TermNil,"in arithmetic");
|
||||
Yap_Error(INSTANTIATION_ERROR,TermNil,"in arithmetic");
|
||||
P = (yamop *)FAILCODE;
|
||||
RERROR();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ Eval(Term t, E_ARGS)
|
||||
RFLOAT(FloatOfTerm(t));
|
||||
#ifdef USE_GMP
|
||||
case (CELL)FunctorBigInt:
|
||||
RBIG(_YAP_BigIntOfTerm(t));
|
||||
RBIG(Yap_BigIntOfTerm(t));
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
@@ -80,14 +80,14 @@ Eval(Term t, E_ARGS)
|
||||
Atom name = NameOfFunctor(fun);
|
||||
ExpEntry *p;
|
||||
|
||||
if (EndOfPAEntr(p = RepExpProp(_YAP_GetExpProp(name, n)))) {
|
||||
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, n)))) {
|
||||
Term ti[2];
|
||||
|
||||
/* error */
|
||||
ti[0] = t;
|
||||
ti[1] = MkIntegerTerm(n);
|
||||
t = _YAP_MkApplTerm(_YAP_MkFunctor(_YAP_LookupAtom("/"),2), 2, ti);
|
||||
_YAP_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
t = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("/"),2), 2, ti);
|
||||
Yap_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
"functor %s/%d for arithmetic expression",
|
||||
RepAtom(name)->StrOfAE,n);
|
||||
P = (yamop *)FAILCODE;
|
||||
@@ -106,9 +106,9 @@ Eval(Term t, E_ARGS)
|
||||
Atom name = AtomOfTerm(t);
|
||||
ExpEntry *p;
|
||||
|
||||
if (EndOfPAEntr(p = RepExpProp(_YAP_GetExpProp(name, 0)))) {
|
||||
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 0)))) {
|
||||
/* error */
|
||||
_YAP_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
Yap_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
"atom %s for arithmetic expression",
|
||||
RepAtom(name)->StrOfAE);
|
||||
P = (yamop *)FAILCODE;
|
||||
@@ -119,10 +119,10 @@ Eval(Term t, E_ARGS)
|
||||
}
|
||||
|
||||
E_FUNC
|
||||
_YAP_Eval(Term t, E_ARGS)
|
||||
Yap_Eval(Term t, E_ARGS)
|
||||
{
|
||||
if (IsVarTerm(t)) {
|
||||
_YAP_Error(INSTANTIATION_ERROR,TermNil,"in arithmetic");
|
||||
Yap_Error(INSTANTIATION_ERROR,TermNil,"in arithmetic");
|
||||
P = (yamop *)FAILCODE;
|
||||
RERROR();
|
||||
}
|
||||
@@ -135,7 +135,7 @@ _YAP_Eval(Term t, E_ARGS)
|
||||
RFLOAT(FloatOfTerm(t));
|
||||
#ifdef USE_GMP
|
||||
case (CELL)FunctorBigInt:
|
||||
RBIG(_YAP_BigIntOfTerm(t));
|
||||
RBIG(Yap_BigIntOfTerm(t));
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
@@ -143,14 +143,14 @@ _YAP_Eval(Term t, E_ARGS)
|
||||
Atom name = NameOfFunctor(fun);
|
||||
ExpEntry *p;
|
||||
|
||||
if (EndOfPAEntr(p = RepExpProp(_YAP_GetExpProp(name, n)))) {
|
||||
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, n)))) {
|
||||
Term ti[2];
|
||||
|
||||
/* error */
|
||||
ti[0] = t;
|
||||
ti[1] = MkIntegerTerm(n);
|
||||
t = _YAP_MkApplTerm(_YAP_MkFunctor(_YAP_LookupAtom("/"),2), 2, ti);
|
||||
_YAP_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
t = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("/"),2), 2, ti);
|
||||
Yap_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
"functor %s/%d for arithmetic expression",
|
||||
RepAtom(name)->StrOfAE,n);
|
||||
P = (yamop *)FAILCODE;
|
||||
@@ -169,9 +169,9 @@ _YAP_Eval(Term t, E_ARGS)
|
||||
Atom name = AtomOfTerm(t);
|
||||
ExpEntry *p;
|
||||
|
||||
if (EndOfPAEntr(p = RepExpProp(_YAP_GetExpProp(name, 0)))) {
|
||||
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 0)))) {
|
||||
/* error */
|
||||
_YAP_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
Yap_Error(TYPE_ERROR_EVALUABLE, t,
|
||||
"atom %s for arithmetic expression",
|
||||
RepAtom(name)->StrOfAE);
|
||||
P = (yamop *)FAILCODE;
|
||||
@@ -188,16 +188,16 @@ p_is(void)
|
||||
blob_type bt;
|
||||
|
||||
bt = Eval(Deref(ARG2), &res);
|
||||
return (_YAP_unify_constant(ARG1,EvalToTerm(bt,&res)));
|
||||
return (Yap_unify_constant(ARG1,EvalToTerm(bt,&res)));
|
||||
}
|
||||
|
||||
void
|
||||
_YAP_InitEval(void)
|
||||
Yap_InitEval(void)
|
||||
{
|
||||
/* here are the arithmetical predicates */
|
||||
_YAP_InitConstExps();
|
||||
_YAP_InitUnaryExps();
|
||||
_YAP_InitBinaryExps();
|
||||
_YAP_InitCPred("is", 2, p_is, TestPredFlag | SafePredFlag);
|
||||
Yap_InitConstExps();
|
||||
Yap_InitUnaryExps();
|
||||
Yap_InitBinaryExps();
|
||||
Yap_InitCPred("is", 2, p_is, TestPredFlag | SafePredFlag);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user