cleanup: typecast to yamop * instead of CODEADDR wherever possible.
Fix integer(233333833838383) fails bug (Roberto Bagnara). git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@733 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
37
C/inlines.c
37
C/inlines.c
@@ -85,10 +85,24 @@ p_integer(void)
|
||||
d0 = ARG1;
|
||||
deref_head(d0, integer_unk);
|
||||
integer_nvar:
|
||||
if (IsIntegerTerm(d0)) {
|
||||
if (IsIntTerm(d0)) {
|
||||
return(TRUE);
|
||||
}
|
||||
else {
|
||||
if (IsApplTerm(d0)) {
|
||||
Functor f0 = FunctorOfTerm(d0);
|
||||
if (IsExtensionFunctor(f0)) {
|
||||
switch ((CELL)f0) {
|
||||
case (CELL)FunctorLongInt:
|
||||
#ifdef USE_GMP
|
||||
case (CELL)FunctorBigInt:
|
||||
#endif
|
||||
return(TRUE);
|
||||
default:
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
return(FALSE);
|
||||
} else {
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
@@ -106,10 +120,25 @@ p_number(void)
|
||||
d0 = ARG1;
|
||||
deref_head(d0, number_unk);
|
||||
number_nvar:
|
||||
if (IsNumTerm(d0)) {
|
||||
if (IsIntTerm(d0)) {
|
||||
return(TRUE);
|
||||
}
|
||||
else {
|
||||
if (IsApplTerm(d0)) {
|
||||
Functor f0 = FunctorOfTerm(d0);
|
||||
if (IsExtensionFunctor(f0)) {
|
||||
switch ((CELL)f0) {
|
||||
case (CELL)FunctorLongInt:
|
||||
case (CELL)FunctorDouble:
|
||||
#ifdef USE_GMP
|
||||
case (CELL)FunctorBigInt:
|
||||
#endif
|
||||
return(TRUE);
|
||||
default:
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
return(FALSE);
|
||||
} else {
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user