diff --git a/C/absmi.c b/C/absmi.c index f8652898e..25ffbb1cc 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -10,8 +10,12 @@ * * * File: absmi.c * * comments: Portable abstract machine interpreter * -* Last rev: $Date: 2004-11-04 18:22:28 $,$Author: vsc $ * +* Last rev: $Date: 2004-11-19 17:14:12 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.151 2004/11/04 18:22:28 vsc +* don't ever use memory that has been freed (that was done by LU). +* generic fixes for WIN32 libraries +* * Revision 1.150 2004/10/26 20:15:36 vsc * More bug fixes for overflow handling * @@ -235,7 +239,7 @@ void prof_alrm(int signo, siginfo_t *si, ucontext_t *sc); void prof_alrm(int signo, siginfo_t *si, ucontext_t *sc) { -#if __linux__ +#if __linux__ && defined(i386) void * oldpc=(void *) sc->uc_mcontext.gregs[14]; /* 14= REG_EIP */ if (Yap_PrologMode & TestMode) { diff --git a/C/computils.c b/C/computils.c index 04fa1a20b..1faf0d572 100644 --- a/C/computils.c +++ b/C/computils.c @@ -11,8 +11,11 @@ * File: computils.c * * comments: some useful routines for YAP's compiler * * * -* Last rev: $Date: 2004-04-16 19:27:31 $ * +* Last rev: $Date: 2004-11-19 17:14:13 $ * * $Log: not supported by cvs2svn $ +* Revision 1.24 2004/04/16 19:27:31 vsc +* more bug fixes +* * Revision 1.23 2004/03/10 14:59:55 vsc * optimise -> for type tests * * @@ -281,9 +284,9 @@ write_address(CELL address) char buf[32], *p = buf; #if HAVE_SNPRINTF - snprintf(buf,32,"%x",address); + snprintf(buf,32,"%p",(void *)address); #else - snprintf(buf,"%x",address); + snprintf(buf,"%p",(void *)address); #endif p[31] = '\0'; /* so that I don't have to worry */ Yap_DebugPutc(Yap_c_error_stream,'0'); diff --git a/C/dbase.c b/C/dbase.c index 91a89cf06..8098d938b 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -644,9 +644,9 @@ copy_double(CELL *st, CELL *pt) #endif /* GC_NO_TAGS */ #else #if GC_NO_TAGS - st[2] = ((2*sizeof(CELL)+EndSpecials)|MBIT); -#else st[2] = 2*sizeof(CELL)+EndSpecials; +#else + st[2] = ((2*sizeof(CELL)+EndSpecials)|MBIT); #endif /* GC_NO_TAGS */ #endif /* now reserve space */ diff --git a/C/index.c b/C/index.c index f78799d31..76261932b 100644 --- a/C/index.c +++ b/C/index.c @@ -11,8 +11,13 @@ * File: index.c * * comments: Indexing a Prolog predicate * * * -* Last rev: $Date: 2004-11-18 22:32:36 $,$Author: vsc $ * +* Last rev: $Date: 2004-11-19 17:14:14 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.106 2004/11/18 22:32:36 vsc +* fix situation where we might assume nonextsing double initialisation of C predicates (use +* Hidden Pred Flag). +* $host_type was double initialised. +* * Revision 1.105 2004/11/04 18:22:32 vsc * don't ever use memory that has been freed (that was done by LU). * generic fixes for WIN32 libraries @@ -3568,7 +3573,7 @@ purge_pvar(GroupDef *group) { static UInt * -do_nonvar_group(GroupDef *grp, Term t, int compound_term, CELL *sreg, UInt arity, UInt labl, struct intermediates *cint, UInt argno, int first, int last_arg, UInt nxtlbl, int clleft, CELL *top) { +do_nonvar_group(GroupDef *grp, Term t, UInt compound_term, CELL *sreg, UInt arity, UInt labl, struct intermediates *cint, UInt argno, int first, int last_arg, UInt nxtlbl, int clleft, CELL *top) { TypeSwitch *type_sw; PredEntry *ap = cint->CurrentPred; diff --git a/C/iopreds.c b/C/iopreds.c index d3ad646c7..07b308ea0 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -3851,7 +3851,7 @@ format(volatile Term otail, volatile Term oargs, int sno) while ((ch = *fptr++)) { Term t = TermNil; int has_repeats = FALSE; - Int repeats = 0; + int repeats = 0; if (ch == '~') { /* start command */ diff --git a/C/parser.c b/C/parser.c index 217606088..de195b31e 100644 --- a/C/parser.c +++ b/C/parser.c @@ -311,7 +311,7 @@ ParseArgs(Atom a, JMPBUFF *FailBuff) FAIL; } *tp++ = Unsigned(ParseTerm(999, FailBuff)); - ParserAuxSp = tp; + ParserAuxSp = (char *)tp; ++nargs; if (Yap_tokptr->Tok != Ord(Ponctuation_tok)) break; diff --git a/C/stdpreds.c b/C/stdpreds.c index 1183999f0..28e0b3263 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -11,8 +11,13 @@ * File: stdpreds.c * * comments: General-purpose C implemented system predicates * * * -* Last rev: $Date: 2004-11-18 22:32:37 $,$Author: vsc $ * +* Last rev: $Date: 2004-11-19 17:14:14 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.72 2004/11/18 22:32:37 vsc +* fix situation where we might assume nonextsing double initialisation of C predicates (use +* Hidden Pred Flag). +* $host_type was double initialised. +* * Revision 1.71 2004/07/23 21:08:44 vsc * windows fixes * @@ -139,7 +144,7 @@ static Int order=0; Int temp; order++; if (index_code) temp=-order; else temp=order; - fprintf(FPreds,"+%p %p %p %d",code_start,code_end, pe, temp); + fprintf(FPreds,"+%p %p %p %l",code_start,code_end, pe, (long int)temp); #if MORE_INFO_FILE if (pe->FunctorOfPred->KindOfPE==47872) { if (pe->ArityOfPE) { @@ -242,7 +247,7 @@ showprofres(UInt type) { ProfPreds=0; pr=(clauseentry *) TR; - while (fscanf(FPreds,"+%p %p %p %d",&(pr->beg),&(pr->end),&(pr->pp),&(pr->ts)) > 0){ + while (fscanf(FPreds,"+%p %p %p %l",&(pr->beg),&(pr->end),&(pr->pp),&(pr->ts)) > 0){ int c; pr->pcs = 0L; pr++; diff --git a/C/utilpreds.c b/C/utilpreds.c index 2335fd7a8..1a536434d 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -1315,7 +1315,7 @@ GvNTermHash(void) i3 = GvNht[2]; i2 ^= i3; i1 ^= i2; i1 = (((i3 << 7) + i2) << 7) + i1; result = MkIntegerTerm(i1 % size); - return(Yap_unify(ARG4,result)); + return Yap_unify(ARG4,result); } static int variant_complex(register CELL *pt0, register CELL *pt0_end, register diff --git a/H/heapgc.h b/H/heapgc.h index a98873ad2..c4cdbe246 100644 --- a/H/heapgc.h +++ b/H/heapgc.h @@ -20,8 +20,12 @@ /* macros used by garbage collection */ #if TAG_64BITS +#if GC_NO_TAGS +#define MaskAdr (~0x7L) +#else #define MaskAdr (~(MBIT|RBIT|0x7L)) #endif +#endif /* return pointer from object pointed to by ptr (remove tag & mark) */ #ifdef TAGS_FAST_OPS