diff --git a/C/c_interface.c b/C/c_interface.c index 06761d356..c3487e9e2 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -10,8 +10,11 @@ * File: c_interface.c * * comments: c_interface primitives definition * * * -* Last rev: $Date: 2007-03-22 11:12:20 $,$Author: vsc $ * +* Last rev: $Date: 2007-03-30 16:47:22 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.90 2007/03/22 11:12:20 vsc +* make sure that YAP_Restart does not restart a failed goal. +* * Revision 1.89 2007/01/28 14:26:36 vsc * WIN32 support * @@ -513,6 +516,7 @@ X_API void * YAP_BlobOfTerm(Term t) { MP_INT *src; + if (IsVarTerm(t)) return NULL; if (!IsBigIntTerm(t)) diff --git a/H/TermExt.h b/H/TermExt.h index 605953398..1681cc0f5 100644 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -10,7 +10,7 @@ * File: TermExt.h * * mods: * * comments: Extensions to standard terms for YAP * -* version: $Id: TermExt.h,v 1.12 2006-09-28 16:15:54 vsc Exp $ * +* version: $Id: TermExt.h,v 1.13 2007-03-30 16:47:22 vsc Exp $ * *************************************************************************/ #ifdef USE_SYSTEM_MALLOC @@ -270,17 +270,12 @@ IsLongIntTerm (Term t) typedef UInt mp_limb_t; typedef struct { - int _mp_size, _mp_alloc; + Int _mp_size, _mp_alloc; mp_limb_t *_mp_d; } MP_INT; #endif -#ifdef USE_GMP - -Term STD_PROTO (Yap_MkBigIntTerm, (MP_INT *)); -MP_INT *STD_PROTO (Yap_BigIntOfTerm, (Term)); - inline EXTERN int IsBigIntTerm (Term); inline EXTERN int @@ -289,6 +284,11 @@ IsBigIntTerm (Term t) return (int) (IsApplTerm (t) && FunctorOfTerm (t) == FunctorBigInt); } +#ifdef USE_GMP + +Term STD_PROTO (Yap_MkBigIntTerm, (MP_INT *)); +MP_INT *STD_PROTO (Yap_BigIntOfTerm, (Term)); + inline EXTERN void MPZ_SET (mpz_t, MP_INT *); inline EXTERN void @@ -325,16 +325,6 @@ Yap_SizeOfBigInt (Term t) #else -inline EXTERN int IsBigIntTerm (Term); - -inline EXTERN int -IsBigIntTerm (Term t) -{ - return (int) (FALSE); -} - - - inline EXTERN int IsLargeIntTerm (Term); diff --git a/H/absmi.h b/H/absmi.h index 0a233ca58..5c47a86bb 100644 --- a/H/absmi.h +++ b/H/absmi.h @@ -634,7 +634,7 @@ typedef CELL label; save_pc(); \ save_y() -#if BF_FREE +#if BP_FREE /* if we are using BP as a local register, we must save it whenever we leave absmi.c */ #define always_save_pc() save_pc() #define always_set_pc() set_pc() diff --git a/library/matrix/matrix.c b/library/matrix/matrix.c index fe71699a1..e823df692 100644 --- a/library/matrix/matrix.c +++ b/library/matrix/matrix.c @@ -136,7 +136,7 @@ new_int_matrix(int ndims, int dims[], long int data[]) static YAP_Term new_float_matrix(int ndims, int dims[], double data[]) { - unsigned int sz; + unsigned int sz; unsigned int i, nelems=1; YAP_Term blob; int *mat; @@ -145,7 +145,7 @@ new_float_matrix(int ndims, int dims[], double data[]) for (i=0;i< ndims;i++) { nelems *= dims[i]; } - sz = ((MAT_DIMS+1)*sizeof(int)+ndims*sizeof(int)+(nelems+1)*sizeof(double))/sizeof(YAP_CELL); + sz = ((MAT_DIMS+1)*sizeof(int)+ndims*sizeof(int)+(nelems+1)*sizeof(double)+(sizeof(YAP_CELL)-1))/sizeof(YAP_CELL); blob = YAP_MkBlobTerm(sz); if (blob == YAP_TermNil()) return FALSE; @@ -322,7 +322,6 @@ new_floats_matrix(void) int ndims = YAP_IntOfTerm(YAP_ARG1); YAP_Term tl = YAP_ARG2, out; int dims[MAX_DIMS]; - if (!scan_dims(ndims, tl, dims)) return FALSE; out = new_float_matrix(ndims, dims, NULL);