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 * * File: absmi.c *
* comments: Portable abstract machine interpreter * * 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 $ * $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 * Revision 1.150 2004/10/26 20:15:36 vsc
* More bug fixes for overflow handling * 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) 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 */ void * oldpc=(void *) sc->uc_mcontext.gregs[14]; /* 14= REG_EIP */
if (Yap_PrologMode & TestMode) { if (Yap_PrologMode & TestMode) {

View File

@ -11,8 +11,11 @@
* File: computils.c * * File: computils.c *
* comments: some useful routines for YAP's compiler * * 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 $ * $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 * Revision 1.23 2004/03/10 14:59:55 vsc
* optimise -> for type tests * optimise -> for type tests
* * * *
@ -281,9 +284,9 @@ write_address(CELL address)
char buf[32], *p = buf; char buf[32], *p = buf;
#if HAVE_SNPRINTF #if HAVE_SNPRINTF
snprintf(buf,32,"%x",address); snprintf(buf,32,"%p",(void *)address);
#else #else
snprintf(buf,"%x",address); snprintf(buf,"%p",(void *)address);
#endif #endif
p[31] = '\0'; /* so that I don't have to worry */ p[31] = '\0'; /* so that I don't have to worry */
Yap_DebugPutc(Yap_c_error_stream,'0'); Yap_DebugPutc(Yap_c_error_stream,'0');

View File

@ -644,9 +644,9 @@ copy_double(CELL *st, CELL *pt)
#endif /* GC_NO_TAGS */ #endif /* GC_NO_TAGS */
#else #else
#if GC_NO_TAGS #if GC_NO_TAGS
st[2] = ((2*sizeof(CELL)+EndSpecials)|MBIT);
#else
st[2] = 2*sizeof(CELL)+EndSpecials; st[2] = 2*sizeof(CELL)+EndSpecials;
#else
st[2] = ((2*sizeof(CELL)+EndSpecials)|MBIT);
#endif /* GC_NO_TAGS */ #endif /* GC_NO_TAGS */
#endif #endif
/* now reserve space */ /* now reserve space */

View File

@ -11,8 +11,13 @@
* File: index.c * * File: index.c *
* comments: Indexing a Prolog predicate * * 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 $ * $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 * Revision 1.105 2004/11/04 18:22:32 vsc
* don't ever use memory that has been freed (that was done by LU). * don't ever use memory that has been freed (that was done by LU).
* generic fixes for WIN32 libraries * generic fixes for WIN32 libraries
@ -3568,7 +3573,7 @@ purge_pvar(GroupDef *group) {
static UInt * 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; TypeSwitch *type_sw;
PredEntry *ap = cint->CurrentPred; PredEntry *ap = cint->CurrentPred;

View File

@ -3851,7 +3851,7 @@ format(volatile Term otail, volatile Term oargs, int sno)
while ((ch = *fptr++)) { while ((ch = *fptr++)) {
Term t = TermNil; Term t = TermNil;
int has_repeats = FALSE; int has_repeats = FALSE;
Int repeats = 0; int repeats = 0;
if (ch == '~') { if (ch == '~') {
/* start command */ /* start command */

View File

@ -311,7 +311,7 @@ ParseArgs(Atom a, JMPBUFF *FailBuff)
FAIL; FAIL;
} }
*tp++ = Unsigned(ParseTerm(999, FailBuff)); *tp++ = Unsigned(ParseTerm(999, FailBuff));
ParserAuxSp = tp; ParserAuxSp = (char *)tp;
++nargs; ++nargs;
if (Yap_tokptr->Tok != Ord(Ponctuation_tok)) if (Yap_tokptr->Tok != Ord(Ponctuation_tok))
break; break;

View File

@ -11,8 +11,13 @@
* File: stdpreds.c * * File: stdpreds.c *
* comments: General-purpose C implemented system predicates * * 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 $ * $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 * Revision 1.71 2004/07/23 21:08:44 vsc
* windows fixes * windows fixes
* *
@ -139,7 +144,7 @@ static Int order=0;
Int temp; Int temp;
order++; order++;
if (index_code) temp=-order; else 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 MORE_INFO_FILE
if (pe->FunctorOfPred->KindOfPE==47872) { if (pe->FunctorOfPred->KindOfPE==47872) {
if (pe->ArityOfPE) { if (pe->ArityOfPE) {
@ -242,7 +247,7 @@ showprofres(UInt type) {
ProfPreds=0; ProfPreds=0;
pr=(clauseentry *) TR; 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; int c;
pr->pcs = 0L; pr->pcs = 0L;
pr++; pr++;

View File

@ -1315,7 +1315,7 @@ GvNTermHash(void)
i3 = GvNht[2]; i3 = GvNht[2];
i2 ^= i3; i1 ^= i2; i1 = (((i3 << 7) + i2) << 7) + i1; i2 ^= i3; i1 ^= i2; i1 = (((i3 << 7) + i2) << 7) + i1;
result = MkIntegerTerm(i1 % size); 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 static int variant_complex(register CELL *pt0, register CELL *pt0_end, register

View File

@ -20,8 +20,12 @@
/* macros used by garbage collection */ /* macros used by garbage collection */
#if TAG_64BITS #if TAG_64BITS
#if GC_NO_TAGS
#define MaskAdr (~0x7L)
#else
#define MaskAdr (~(MBIT|RBIT|0x7L)) #define MaskAdr (~(MBIT|RBIT|0x7L))
#endif #endif
#endif
/* return pointer from object pointed to by ptr (remove tag & mark) */ /* return pointer from object pointed to by ptr (remove tag & mark) */
#ifdef TAGS_FAST_OPS #ifdef TAGS_FAST_OPS