a few fixes for 64 bit compiling.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1178 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-11-19 17:14:15 +00:00
parent 8d2cb067ec
commit 0070c26061
9 changed files with 36 additions and 15 deletions

View File

@ -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) {

View File

@ -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');

View File

@ -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 */

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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++;

View File

@ -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

View File

@ -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