fix some icc warnings

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2165 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2008-03-25 22:03:14 +00:00
parent b2274186bd
commit 0c0826b938
23 changed files with 125 additions and 117 deletions

13
C/agc.c
View File

@ -155,16 +155,9 @@ AtomAdjust(Atom a)
#define YAdjust(P) (P) #define YAdjust(P) (P)
#define HoldEntryAdjust(P) (P) #define HoldEntryAdjust(P) (P)
static void #define recompute_mask(dbr)
recompute_mask(DBRef dbr)
{
return;
}
static void #define rehash(oldcode, NOfE, KindOfEntries)
rehash(CELL *oldcode, int NOfE, int KindOfEntries)
{
}
#include "rheap.h" #include "rheap.h"
@ -280,7 +273,7 @@ mark_local(void)
if (!IsVarTerm(reg)) { if (!IsVarTerm(reg)) {
if (IsAtomTerm(reg) if (IsAtomTerm(reg)
#if TABLING #ifdef TABLING
/* assume we cannot have atoms on first page, /* assume we cannot have atoms on first page,
so this must be an arity so this must be an arity
*/ */

View File

@ -156,7 +156,7 @@ char emacs_tmp[256], emacs_tmp2[256];
/********* Prolog State ********************************************/ /********* Prolog State ********************************************/
prolog_exec_mode Yap_PrologMode = BootMode; Int Yap_PrologMode = BootMode;
int Yap_CritLocks = 0; int Yap_CritLocks = 0;

View File

@ -61,7 +61,7 @@ AtomEntry;
/* Props and Atoms are stored in chains, ending with a NIL */ /* Props and Atoms are stored in chains, ending with a NIL */
#if USE_OFFSETS #ifdef USE_OFFSETS
# define EndOfPAEntr(P) ( Addr(P) == AtomBase) # define EndOfPAEntr(P) ( Addr(P) == AtomBase)
#else #else
# define EndOfPAEntr(P) ( Addr(P) == NIL ) # define EndOfPAEntr(P) ( Addr(P) == NIL )
@ -72,7 +72,7 @@ AtomEntry;
/* ********************** Properties **********************************/ /* ********************** Properties **********************************/
#if USE_OFFSETS #if defined(USE_OFFSETS)
#define USE_OFFSETS_IN_PROPS 1 #define USE_OFFSETS_IN_PROPS 1
#else #else
#define USE_OFFSETS_IN_PROPS 0 #define USE_OFFSETS_IN_PROPS 0

View File

@ -71,7 +71,7 @@
#define LOAD_SHL 1 #define LOAD_SHL 1
#endif #endif
#if HAVE_NSLINKMODULE #ifdef HAVE_NSLINKMODULE
#ifdef NO_DYN #ifdef NO_DYN
#undef NO_DYN #undef NO_DYN
#endif #endif

View File

@ -10,7 +10,7 @@
* File: Heap.h * * File: Heap.h *
* mods: * * mods: *
* comments: Heap Init Structure * * comments: Heap Init Structure *
* version: $Id: Heap.h,v 1.126 2008-03-25 16:45:53 vsc Exp $ * * version: $Id: Heap.h,v 1.127 2008-03-25 22:03:13 vsc Exp $ *
*************************************************************************/ *************************************************************************/
/* information that can be stored in Code Space */ /* information that can be stored in Code Space */
@ -50,7 +50,7 @@ typedef struct memory_hole {
typedef struct gc_ma_hash_entry_struct { typedef struct gc_ma_hash_entry_struct {
UInt timestmp; UInt timestmp;
#if TABLING #ifdef TABLING
tr_fr_ptr loc; tr_fr_ptr loc;
struct gc_ma_hash_entry_struct *more; struct gc_ma_hash_entry_struct *more;
#endif #endif
@ -1024,13 +1024,13 @@ struct various_codes *Yap_heap_regs;
#endif #endif
#if (USE_SYSTEM_MALLOC && HAVE_MALLINFO)||USE_DL_MALLOC #if (defined(USE_SYSTEM_MALLOC) && HAVE_MALLINFO)||USE_DL_MALLOC
UInt STD_PROTO(Yap_givemallinfo, (void)); UInt STD_PROTO(Yap_givemallinfo, (void));
#endif #endif
ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *)); ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *));
#define Yap_ReleasePreAllocCodeSpace(x) #define Yap_ReleasePreAllocCodeSpace(x)
#if USE_SYSTEM_MALLOC||USE_DL_MALLOC #if defined(USE_SYSTEM_MALLOC)||USE_DL_MALLOC
ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void)); ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void));
EXTERN inline ADDR EXTERN inline ADDR
Yap_PreAllocCodeSpace(void) Yap_PreAllocCodeSpace(void)
@ -1047,7 +1047,7 @@ Yap_PreAllocCodeSpace(void)
} }
#endif #endif
#if THREADS #ifdef THREADS
Prop STD_PROTO(Yap_NewThreadPred, (PredEntry *)); Prop STD_PROTO(Yap_NewThreadPred, (PredEntry *));
Prop STD_PROTO(Yap_NewPredPropByFunctor, (Functor, Term)); Prop STD_PROTO(Yap_NewPredPropByFunctor, (Functor, Term));

View File

@ -10,7 +10,7 @@
* File: Regs.h * * File: Regs.h *
* mods: * * mods: *
* comments: YAP abstract machine registers * * comments: YAP abstract machine registers *
* version: $Id: Regs.h,v 1.39 2006-05-22 16:29:58 tiagosoares Exp $ * * version: $Id: Regs.h,v 1.40 2008-03-25 22:03:13 vsc Exp $ *
*************************************************************************/ *************************************************************************/
@ -141,7 +141,7 @@ typedef struct
extra register, but makes it easier to access X[1]. extra register, but makes it easier to access X[1].
*/ */
#if PUSH_X #ifdef PUSH_X
Term XTERMS[MaxTemps]; /* 29 */ Term XTERMS[MaxTemps]; /* 29 */
#endif #endif
} }
@ -149,7 +149,7 @@ REGSTORE;
extern REGSTORE *Yap_regp; extern REGSTORE *Yap_regp;
#if PUSH_X #ifdef PUSH_X
#define XREGS (Yap_REGS.XTERMS) #define XREGS (Yap_REGS.XTERMS)
@ -750,7 +750,7 @@ EXTERN inline void restore_B(void) {
#define BBREG BB #define BBREG BB
#endif /* SBA || TABLING */ #endif /* SBA || TABLING */
#if !THREADS #if !defined(THREADS)
/* use actual addresses for regs */ /* use actual addresses for regs */
#define PRECOMPUTE_REGADDRESS 1 #define PRECOMPUTE_REGADDRESS 1
#endif /* THREADS */ #endif /* THREADS */

View File

@ -10,7 +10,7 @@
* File: TermExt.h * * File: TermExt.h *
* mods: * * mods: *
* comments: Extensions to standard terms for YAP * * comments: Extensions to standard terms for YAP *
* version: $Id: TermExt.h,v 1.14 2007-09-21 13:52:52 vsc Exp $ * * version: $Id: TermExt.h,v 1.15 2008-03-25 22:03:13 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#ifdef USE_SYSTEM_MALLOC #ifdef USE_SYSTEM_MALLOC
@ -19,12 +19,12 @@
#define SF_STORE ((special_functors *)HEAP_INIT_BASE) #define SF_STORE ((special_functors *)HEAP_INIT_BASE)
#endif #endif
#if USE_OFFSETS #ifdef USE_OFFSETS
#define AtomFoundVar ((Atom)(&(((special_functors *)(NULL))->AtFoundVar))) #define AtomFoundVar ((Atom)(&(((special_functors *)(NULL))->AtFoundVar)))
#define AtomFreeTerm ((Atom)(&(((special_functors *)(NULL))->AtFreeTerm))) #define AtomFreeTerm ((Atom)(&(((special_functors *)(NULL))->AtFreeTerm)))
#define AtomNil ((Atom)(&(((special_functors *)(NULL))->AtNil))) #define AtomNil ((Atom)(&(((special_functors *)(NULL))->AtNil)))
#define AtomDot ((Atom)(&(((special_functors *)(NULL))->AtDot))) #define AtomDot ((Atom)(&(((special_functors *)(NULL))->AtDot)))
#elif THREADS #elif defined(THREADS)
#define AtomFoundVar AbsAtom(SF_STORE->AtFoundVar) #define AtomFoundVar AbsAtom(SF_STORE->AtFoundVar)
#define AtomFreeTerm AbsAtom(SF_STORE->AtFreeTerm) #define AtomFreeTerm AbsAtom(SF_STORE->AtFreeTerm)
#define AtomNil AbsAtom(SF_STORE->AtNil) #define AtomNil AbsAtom(SF_STORE->AtNil)
@ -111,7 +111,7 @@ extern ext_op attas[attvars_ext + 1];
/* make sure that these data structures are the first thing to be allocated /* make sure that these data structures are the first thing to be allocated
in the heap when we start the system */ in the heap when we start the system */
#if THREADS #ifdef THREADS
typedef struct special_functors_struct typedef struct special_functors_struct
{ {
AtomEntry *AtFoundVar; AtomEntry *AtFoundVar;
@ -505,7 +505,11 @@ unify_extension (Functor f, CELL d0, CELL * pt0, CELL d1)
return (pt0[1] == RepAppl (d1)[1]); return (pt0[1] == RepAppl (d1)[1]);
case big_int_e: case big_int_e:
#ifdef USE_GMP #ifdef USE_GMP
return (mpz_cmp (Yap_BigIntOfTerm (d0), Yap_BigIntOfTerm (d1)) == 0); {
MP_INT *m0 = Yap_BigIntOfTerm (d0);
MP_INT *m1 = Yap_BigIntOfTerm (d1);
return mpz_cmp (m0, m1) == 0;
}
#else #else
return d0 == d1; return d0 == d1;
#endif /* USE_GMP */ #endif /* USE_GMP */

34
H/Yap.h
View File

@ -10,7 +10,7 @@
* File: Yap.h.m4 * * File: Yap.h.m4 *
* mods: * * mods: *
* comments: main header file for YAP * * comments: main header file for YAP *
* version: $Id: Yap.h,v 1.29 2008-03-24 23:48:47 vsc Exp $ * * version: $Id: Yap.h,v 1.30 2008-03-25 22:03:13 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#include "config.h" #include "config.h"
@ -53,7 +53,7 @@
#undef TRAILING_REQUIRES_BRANCH #undef TRAILING_REQUIRES_BRANCH
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#if ANALYST #ifdef ANALYST
#ifdef USE_THREADED_CODE #ifdef USE_THREADED_CODE
#undef USE_THREADED_CODE #undef USE_THREADED_CODE
#endif #endif
@ -65,7 +65,7 @@
#endif #endif
#endif #endif
#if SUPPORT_THREADS || SUPPORT_CONDOR #if defined(SUPPORT_THREADS) || defined(SUPPORT_CONDOR)
#define USE_SYSTEM_MALLOC 1 #define USE_SYSTEM_MALLOC 1
#endif #endif
@ -219,7 +219,7 @@ typedef unsigned long int YAP_ULONG_LONG;
#define LOW_PROF 1 #define LOW_PROF 1
#endif #endif
#if DEBUG #ifdef DEBUG
extern char Yap_Option[20]; extern char Yap_Option[20];
#endif #endif
@ -230,17 +230,17 @@ extern char Yap_Option[20];
#define MMAP_ADDR 0x42000000 #define MMAP_ADDR 0x42000000
#endif #endif
#if !IN_SECOND_QUADRANT #if !defined(IN_SECOND_QUADRANT)
#if __linux__ || __FreeBSD__ || __NetBSD__ || mips || __APPLE__ #if __linux__ || __FreeBSD__ || __NetBSD__ || mips || __APPLE__
#if defined(YAPOR) && defined(__alpha) #if defined(YAPOR) && defined(__alpha)
#define MMAP_ADDR 0x40000000 #define MMAP_ADDR 0x40000000
#elif mips #elif defined(mips)
#define MMAP_ADDR 0x02000000 #define MMAP_ADDR 0x02000000
#elif __APPLE__ && __LP64__ #elif defined(__APPLE__) && __LP64__
// this address is high enough that it is likely not to confuse Apple's malloc debugger; lowest possible is 0x100200000 // this address is high enough that it is likely not to confuse Apple's malloc debugger; lowest possible is 0x100200000
#define MMAP_ADDR 0x200000000 #define MMAP_ADDR 0x200000000
#elif __APPLE__ && !__LP64__ #elif defined(__APPLE__) && !__LP64__
#define MMAP_ADDR 0x20000000 #define MMAP_ADDR 0x20000000
#else #else
#define MMAP_ADDR 0x08800000 #define MMAP_ADDR 0x08800000
@ -254,7 +254,7 @@ extern char Yap_Option[20];
#define HEAP_INIT_BASE 0L #define HEAP_INIT_BASE 0L
#define AtomBase NULL #define AtomBase NULL
#else #else
#if defined(MMAP_ADDR) && (USE_MMAP || USE_SHMAT) && !__simplescalar__ #if defined(MMAP_ADDR) && (defined(USE_MMAP) || USE_SHMAT) && !defined(__simplescalar__)
#define HEAP_INIT_BASE (MMAP_ADDR) #define HEAP_INIT_BASE (MMAP_ADDR)
#define AtomBase ((char *)MMAP_ADDR) #define AtomBase ((char *)MMAP_ADDR)
#else #else
@ -775,7 +775,7 @@ VarOfTerm (Term t)
} }
#if SBA #ifdef SBA
inline EXTERN Term MkVarTerm (void); inline EXTERN Term MkVarTerm (void);
@ -839,7 +839,7 @@ FunctorOfTerm (Term t)
} }
#if (USE_SYSTEM_MALLOC || USE_DL_MALLOC) && !__LP64__ #if (defined(USE_SYSTEM_MALLOC) || USE_DL_MALLOC) && !defined(__LP64__)
#if USE_LOW32_TAGS #if USE_LOW32_TAGS
inline EXTERN Term MkAtomTerm (Atom); inline EXTERN Term MkAtomTerm (Atom);
@ -1033,7 +1033,7 @@ IntegerOfTerm (Term t)
/*************** unification routines ***********************************/ /*************** unification routines ***********************************/
#if SBA #ifdef SBA
#include "sbaamiops.h" #include "sbaamiops.h"
#else #else
#include "amiops.h" #include "amiops.h"
@ -1159,7 +1159,7 @@ typedef enum
SystemMode = 0x10000, /* in system mode */ SystemMode = 0x10000, /* in system mode */
} prolog_exec_mode; } prolog_exec_mode;
extern prolog_exec_mode Yap_PrologMode; extern Int Yap_PrologMode;
extern int Yap_CritLocks; extern int Yap_CritLocks;
/************** Access to yap initial arguments ***************************/ /************** Access to yap initial arguments ***************************/
@ -1175,7 +1175,7 @@ extern int Yap_PrologShouldHandleInterrupts;
#define DefaultMaxModules 256 #define DefaultMaxModules 256
#if YAPOR #ifdef YAPOR
#define YAPEnterCriticalSection() \ #define YAPEnterCriticalSection() \
{ \ { \
if (worker_id != GLOBAL_LOCKS_who_locked_heap) { \ if (worker_id != GLOBAL_LOCKS_who_locked_heap) { \
@ -1202,7 +1202,7 @@ extern int Yap_PrologShouldHandleInterrupts;
UNLOCK(GLOBAL_LOCKS_heap_access); \ UNLOCK(GLOBAL_LOCKS_heap_access); \
} \ } \
} }
#elif THREADS #elif defined(THREADS)
#define YAPEnterCriticalSection() \ #define YAPEnterCriticalSection() \
{ \ { \
/* LOCK(BGL); */ \ /* LOCK(BGL); */ \
@ -1260,7 +1260,7 @@ typedef struct TIMED_MAVAR
/********* while debugging you may need some info ***********************/ /********* while debugging you may need some info ***********************/
#if EMACS #ifdef EMACS
extern char emacs_tmp[], emacs_tmp2[]; extern char emacs_tmp[], emacs_tmp2[];
#endif #endif
@ -1270,7 +1270,7 @@ extern char emacs_tmp[], emacs_tmp2[];
#include "opt.macros.h" #include "opt.macros.h"
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
#if SBA #ifdef SBA
#include "sbaunify.h" #include "sbaunify.h"
#endif #endif

View File

@ -11,8 +11,11 @@
* File: YapOpcodes.h * * File: YapOpcodes.h *
* comments: Central Table with all YAP opcodes * * comments: Central Table with all YAP opcodes *
* * * *
* Last rev: $Date: 2007-11-26 23:43:09 $ * * Last rev: $Date: 2008-03-25 22:03:13 $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.43 2007/11/26 23:43:09 vsc
* fixes to support threads and assert correctly, even if inefficiently.
*
* Revision 1.42 2007/11/07 09:25:27 vsc * Revision 1.42 2007/11/07 09:25:27 vsc
* speedup meta-calls * speedup meta-calls
* *
@ -386,7 +389,7 @@
OPCODE(alloc_for_logical_pred ,EC), OPCODE(alloc_for_logical_pred ,EC),
OPCODE(unify_idb_term ,e), OPCODE(unify_idb_term ,e),
OPCODE(copy_idb_term ,e), OPCODE(copy_idb_term ,e),
#if THREADS #if defined(THREADS)
OPCODE(thread_local ,e), OPCODE(thread_local ,e),
#endif #endif
#ifdef SFUNC #ifdef SFUNC

View File

@ -10,7 +10,7 @@
* File: Yap.proto * * File: Yap.proto *
* mods: * * mods: *
* comments: Function declarations for YAP * * comments: Function declarations for YAP *
* version: $Id: Yapproto.h,v 1.82 2007-12-05 12:17:23 vsc Exp $ * * version: $Id: Yapproto.h,v 1.83 2008-03-25 22:03:13 vsc Exp $ *
*************************************************************************/ *************************************************************************/
/* prototype file for Yap */ /* prototype file for Yap */
@ -56,7 +56,7 @@ Term *STD_PROTO(Yap_AddressFromSlot,(long));
void STD_PROTO(Yap_PutInSlot,(long, Term)); void STD_PROTO(Yap_PutInSlot,(long, Term));
#if SFUNC #ifdef SFUNC
Term STD_PROTO(MkSFTerm,(Functor,int,Term *,Term)); Term STD_PROTO(MkSFTerm,(Functor,int,Term *,Term));
CELL STD_PROTO(*ArgsOfSFTerm,(Term)); CELL STD_PROTO(*ArgsOfSFTerm,(Term));
#endif #endif
@ -113,7 +113,7 @@ Term STD_PROTO(Yap_all_calls,(void));
Atom STD_PROTO(Yap_ConsultingFile,(void)); Atom STD_PROTO(Yap_ConsultingFile,(void));
struct pred_entry *STD_PROTO(Yap_PredForChoicePt,(choiceptr)); struct pred_entry *STD_PROTO(Yap_PredForChoicePt,(choiceptr));
void STD_PROTO(Yap_InitCdMgr,(void)); void STD_PROTO(Yap_InitCdMgr,(void));
#if EMACS #ifdef EMACS
int STD_PROTO(where_new_clause, (Prop, int)); int STD_PROTO(where_new_clause, (Prop, int));
#endif #endif
void STD_PROTO(Yap_init_consult,(int, char *)); void STD_PROTO(Yap_init_consult,(int, char *));
@ -297,7 +297,7 @@ Int STD_PROTO(Yap_walltime,(void));
int STD_PROTO(Yap_dir_separator,(int)); int STD_PROTO(Yap_dir_separator,(int));
int STD_PROTO(Yap_volume_header,(char *)); int STD_PROTO(Yap_volume_header,(char *));
void STD_PROTO(Yap_InitSysPath,(void)); void STD_PROTO(Yap_InitSysPath,(void));
#if MAC #ifdef MAC
void STD_PROTO(Yap_SetTextFile,(char *)); void STD_PROTO(Yap_SetTextFile,(char *));
#endif #endif
void STD_PROTO(Yap_cputime_interval,(Int *,Int *)); void STD_PROTO(Yap_cputime_interval,(Int *,Int *));

View File

@ -17,7 +17,7 @@
/* This code can only be defined *after* including Regs.h!!! */ /* This code can only be defined *after* including Regs.h!!! */
#if USE_OFFSETS #ifdef USE_OFFSETS
inline EXTERN Atom AbsAtom (AtomEntry * p); inline EXTERN Atom AbsAtom (AtomEntry * p);
@ -1372,7 +1372,7 @@ Atom STD_PROTO (Yap_GetOp, (OpEntry *, int *, int));
Prop STD_PROTO (Yap_GetAProp, (Atom, PropFlags)); Prop STD_PROTO (Yap_GetAProp, (Atom, PropFlags));
Prop STD_PROTO (Yap_GetAPropHavingLock, (AtomEntry *, PropFlags)); Prop STD_PROTO (Yap_GetAPropHavingLock, (AtomEntry *, PropFlags));
#if THREADS #ifdef THREADS
EXTERN inline PredEntry *STD_PROTO (Yap_GetThreadPred, (PredEntry *)); EXTERN inline PredEntry *STD_PROTO (Yap_GetThreadPred, (PredEntry *));
#endif #endif
@ -1407,7 +1407,7 @@ GetPredPropByFuncHavingLock (FunctorEntry *fe, Term cur_mod)
return NIL; return NIL;
} }
if ((p->ModuleOfPred == cur_mod || !(p->ModuleOfPred))) { if ((p->ModuleOfPred == cur_mod || !(p->ModuleOfPred))) {
#if THREADS #ifdef THREADS
/* Thread Local Predicates */ /* Thread Local Predicates */
if (p->PredFlags & ThreadLocalPredFlag) { if (p->PredFlags & ThreadLocalPredFlag) {
return AbsPredProp (Yap_GetThreadPred (p)); return AbsPredProp (Yap_GetThreadPred (p));
@ -1424,7 +1424,7 @@ GetPredPropByFuncHavingLock (FunctorEntry *fe, Term cur_mod)
if (p->FunctorOfPred == fe && if (p->FunctorOfPred == fe &&
p->ModuleOfPred == cur_mod) p->ModuleOfPred == cur_mod)
{ {
#if THREADS #ifdef THREADS
/* Thread Local Predicates */ /* Thread Local Predicates */
if (p->PredFlags & ThreadLocalPredFlag) { if (p->PredFlags & ThreadLocalPredFlag) {
READ_UNLOCK(PredHashRWLock); READ_UNLOCK(PredHashRWLock);
@ -1471,7 +1471,7 @@ PredPropByAtom (Atom at, Term cur_mod)
if (pe->KindOfPE == PEProp && if (pe->KindOfPE == PEProp &&
(pe->ModuleOfPred == cur_mod || !pe->ModuleOfPred)) (pe->ModuleOfPred == cur_mod || !pe->ModuleOfPred))
{ {
#if THREADS #ifdef THREADS
/* Thread Local Predicates */ /* Thread Local Predicates */
if (pe->PredFlags & ThreadLocalPredFlag) if (pe->PredFlags & ThreadLocalPredFlag)
{ {

View File

@ -75,7 +75,7 @@ static char SccsId[] = "%W% %G%";
/*************************************************************** /***************************************************************
* Use bp as PREG for X86 machines * * Use bp as PREG for X86 machines *
***************************************************************/ ***************************************************************/
#if IN_ABSMI_C #if defined(IN_ABSMI_C)
register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */
#define PREG P1REG #define PREG P1REG
#endif #endif
@ -139,7 +139,7 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */
#ifdef YAPOR #ifdef YAPOR
#include "or.macros.h" #include "or.macros.h"
#endif /* YAPOR */ #endif /* YAPOR */
#if USE_SYSTEM_MALLOC #ifdef USE_SYSTEM_MALLOC
#include "Heap.h" #include "Heap.h"
#endif #endif
#ifdef TABLING #ifdef TABLING
@ -367,7 +367,7 @@ restore_absmi_regs(REGSTORE * old_regs)
#endif #endif
#if USE_PREFETCH #ifdef USE_PREFETCH
#define START_PREFETCH(TYPE) ALWAYS_START_PREFETCH(TYPE) #define START_PREFETCH(TYPE) ALWAYS_START_PREFETCH(TYPE)
@ -447,7 +447,7 @@ restore_absmi_regs(REGSTORE * old_regs)
#endif #endif
#if USE_PREFETCH #ifdef USE_PREFETCH
#define GONext() ALWAYS_GONext() #define GONext() ALWAYS_GONext()
@ -600,7 +600,7 @@ typedef CELL label;
/* /*
* Next, Y * Next, Y
*/ */
#if SHADOW_Y #ifdef SHADOW_Y
#define set_y() YREG = YENV #define set_y() YREG = YENV
#define save_y() YENV = YREG #define save_y() YENV = YREG
#else #else
@ -612,7 +612,7 @@ typedef CELL label;
/* /*
* Next, CP * Next, CP
*/ */
#if SHADOW_CP #ifdef SHADOW_CP
#define set_cp() CPREG = CP #define set_cp() CPREG = CP
#define save_cp() CP = CPREG #define save_cp() CP = CPREG
#else #else
@ -654,12 +654,12 @@ Macros to check the limits of stacks
/* for the moment I don't know how to handle trail overflows /* for the moment I don't know how to handle trail overflows
in a pure Windows environment in a pure Windows environment
*/ */
#if !_MSC_VER && !defined(__MINGW32__) && !defined(THREADS) && !defined(YAPOR) && !USE_SYSTEM_MALLOC && !USE_DL_MALLOC #if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(THREADS) && !defined(YAPOR) && !defined(USE_SYSTEM_MALLOC) && !USE_DL_MALLOC
#define OS_HANDLES_TR_OVERFLOW 1 #define OS_HANDLES_TR_OVERFLOW 1
#endif #endif
#endif #endif
#if OS_HANDLES_TR_OVERFLOW #ifdef OS_HANDLES_TR_OVERFLOW
#define check_trail(x) #define check_trail(x)
@ -1068,7 +1068,7 @@ Macros to check the limits of stacks
/* /*
* Next, HB * Next, HB
*/ */
#if SHADOW_HB #ifdef SHADOW_HB
#undef HBREG #undef HBREG
#define set_hb() HBREG = HB #define set_hb() HBREG = HB
#define save_hb() HB = HBREG #define save_hb() HB = HBREG
@ -1077,17 +1077,17 @@ Macros to check the limits of stacks
#define save_hb() #define save_hb()
#endif #endif
#if IN_ABSMI_C || IN_UNIFY_C #if defined(IN_ABSMI_C) || defined(IN_UNIFY_C)
static int static int
IUnify_complex(CELL *pt0, CELL *pt0_end, CELL *pt1) IUnify_complex(CELL *pt0, CELL *pt0_end, CELL *pt1)
{ {
#if THREADS #ifdef THREADS
#undef Yap_REGS #undef Yap_REGS
register REGSTORE *regp = Yap_regp; register REGSTORE *regp = Yap_regp;
#define Yap_REGS (*regp) #define Yap_REGS (*regp)
#elif SHADOW_REGS #elif defined(SHADOW_REGS)
#if defined(B) || defined(TR) #if defined(B) || defined(TR)
register REGSTORE *regp = &Yap_REGS; register REGSTORE *regp = &Yap_REGS;
@ -1095,11 +1095,11 @@ IUnify_complex(CELL *pt0, CELL *pt0_end, CELL *pt1)
#endif /* defined(B) || defined(TR) || defined(HB) */ #endif /* defined(B) || defined(TR) || defined(HB) */
#endif #endif
#if SHADOW_HB #ifdef SHADOW_HB
register CELL *HBREG = HB; register CELL *HBREG = HB;
#endif /* SHADOW_HB */ #endif /* SHADOW_HB */
#if USE_SYSTEM_MALLOC #ifdef USE_SYSTEM_MALLOC
CELL **to_visit_max = (CELL **)Yap_PreAllocCodeSpace(), **to_visit = (CELL **)AuxSp; CELL **to_visit_max = (CELL **)Yap_PreAllocCodeSpace(), **to_visit = (CELL **)AuxSp;
#define address_to_visit_max (&to_visit_max) #define address_to_visit_max (&to_visit_max)
#define to_visit_base ((CELL **)AuxSp) #define to_visit_base ((CELL **)AuxSp)
@ -1265,10 +1265,10 @@ cufail:
} }
#endif #endif
return (FALSE); return (FALSE);
#if THREADS #ifdef THREADS
#undef Yap_REGS #undef Yap_REGS
#define Yap_REGS (*Yap_regp) #define Yap_REGS (*Yap_regp)
#elif SHADOW_REGS #elif defined(SHADOW_REGS)
#if defined(B) || defined(TR) #if defined(B) || defined(TR)
#undef Yap_REGS #undef Yap_REGS
#endif /* defined(B) || defined(TR) */ #endif /* defined(B) || defined(TR) */
@ -1289,7 +1289,7 @@ cufail:
#endif #endif
#if IN_ABSMI_C || IN_INLINES_C #if defined(IN_ABSMI_C) || defined(IN_INLINES_C)
static int static int
iequ_complex(register CELL *pt0, register CELL *pt0_end, iequ_complex(register CELL *pt0, register CELL *pt0_end,

View File

@ -78,7 +78,7 @@ typedef struct FREEB {
#define ALIGN_SIZE(X,SIZE) (((CELL)(X)+((SIZE)-1)) & ~((SIZE)-1)) #define ALIGN_SIZE(X,SIZE) (((CELL)(X)+((SIZE)-1)) & ~((SIZE)-1))
/* I'll assume page size is always a power of two */ /* I'll assume page size is always a power of two */
#if _WIN32 #ifdef _WIN32
/* in WIN32 VirtualAlloc works in multiples of 64K */ /* in WIN32 VirtualAlloc works in multiples of 64K */
#define YAP_ALLOC_SIZE (64*1024) #define YAP_ALLOC_SIZE (64*1024)
#define LGPAGE_SIZE YAP_ALLOC_SIZE #define LGPAGE_SIZE YAP_ALLOC_SIZE

View File

@ -233,7 +233,7 @@ AlignGlobalForDouble(void)
#define TRAIL_LOCAL(A,D) if ((A) > (CELL *)B) DO_TRAIL(A,D); #define TRAIL_LOCAL(A,D) if ((A) > (CELL *)B) DO_TRAIL(A,D);
#elif __alpha && !defined(TERM_EXTENSIONS) #elif defined(__alpha) && !defined(TERM_EXTENSIONS)
/* alpha machines have a move conditional instruction, which avoids a /* alpha machines have a move conditional instruction, which avoids a
branch when jumping */ branch when jumping */
@ -387,7 +387,7 @@ reset_trail(tr_fr_ptr TR0) {
/* AbsAppl means */ /* AbsAppl means */
/* multi-assignment variable */ /* multi-assignment variable */
/* so the next cell is the old value */ /* so the next cell is the old value */
#if FROZEN_STACKS #ifdef FROZEN_STACKS
pt[0] = TrailVal(TR-1); pt[0] = TrailVal(TR-1);
TR -= 1; TR -= 1;
#else #else
@ -434,18 +434,31 @@ Yap_unify_constant(register Term a, register Term cons)
case (CELL)FunctorDBRef: case (CELL)FunctorDBRef:
return(a == cons); return(a == cons);
case (CELL)FunctorLongInt: case (CELL)FunctorLongInt:
return(RepAppl(a)[1] == RepAppl(cons)[1]); {
CELL d0 = RepAppl(a)[1];
CELL d1 = RepAppl(cons)[1];
return d0 == d1;
}
case (CELL)FunctorDouble: case (CELL)FunctorDouble:
return(FloatOfTerm(a) == FloatOfTerm(cons)); {
#ifdef USE_GMP Float d0 = FloatOfTerm(a);
Float d1 = FloatOfTerm(cons);
return d0 == d1;
}
case (CELL)FunctorBigInt: case (CELL)FunctorBigInt:
return(mpz_cmp(Yap_BigIntOfTerm(a),Yap_BigIntOfTerm(cons)) == 0); #ifdef USE_GMP
{
MP_INT *d0 = Yap_BigIntOfTerm(a);
MP_INT *d1 = Yap_BigIntOfTerm(cons);
return mpz_cmp(d0,d1) == 0;
}
#endif /* USE_GMP */ #endif /* USE_GMP */
default: default:
return(FALSE); return FALSE;
} }
} }
} else return(FALSE); } else
return FALSE;
} }
deref_body(a,pt,unify_cons_unk,unify_cons_nonvar); deref_body(a,pt,unify_cons_unk,unify_cons_nonvar);

View File

@ -21,10 +21,10 @@
#if HAVE_MATH_H #if HAVE_MATH_H
#include <math.h> #include <math.h>
#endif #endif
#if HAVE_IEEEFP_H #ifdef HAVE_IEEEFP_H
#include <ieeefp.h> #include <ieeefp.h>
#endif #endif
#if HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> #include <limits.h>
#endif #endif
@ -82,7 +82,7 @@ Functor STD_PROTO(EvalArg,(Term,arith_retptr));
/* this macro, dependent on the particular implementation /* this macro, dependent on the particular implementation
is used to interface the arguments into the C libraries */ is used to interface the arguments into the C libraries */
#if MPW #ifdef MPW
#define FL(X) ((extended)(X)) #define FL(X) ((extended)(X))
#else #else
#define FL(X) ((double)(X)) #define FL(X) ((double)(X))

View File

@ -23,7 +23,7 @@ static char SccsId[] = "%W% %G%";
* *
*/ */
#if _MSC_VER || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h> #include <windows.h>
@ -33,7 +33,7 @@ static char SccsId[] = "%W% %G%";
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE
#if _MSC_VER || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
FILE *rl_instream, *rl_outstream; FILE *rl_instream, *rl_outstream;
#endif #endif
@ -48,7 +48,7 @@ typedef struct stream_desc
struct { struct {
Atom name; Atom name;
Term user_name; Term user_name;
#if defined(__MINGW32__) || _MSC_VER #if defined(__MINGW32__) || defined(_MSC_VER)
#define PLGETC_BUF_SIZE 4096 #define PLGETC_BUF_SIZE 4096
char *buf, *ptr; char *buf, *ptr;
int left; int left;
@ -62,7 +62,7 @@ typedef struct stream_desc
volatile void *error_handler; volatile void *error_handler;
} mem_string; } mem_string;
struct { struct {
#if defined(__MINGW32__) || _MSC_VER #if defined(__MINGW32__) || defined(_MSC_VER)
HANDLE hdl; HANDLE hdl;
#else #else
int fd; int fd;

View File

@ -12,8 +12,11 @@
* File: rclause.h * * File: rclause.h *
* comments: walk through a clause * * comments: walk through a clause *
* * * *
* Last rev: $Date: 2008-01-28 18:12:36 $,$Author: vsc $ * * Last rev: $Date: 2008-03-25 22:03:14 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.23 2008/01/28 18:12:36 vsc
* fix small bug in restore opcode
*
* Revision 1.22 2008/01/23 17:57:55 vsc * Revision 1.22 2008/01/23 17:57:55 vsc
* valgrind it! * valgrind it!
* enable atom garbage collection. * enable atom garbage collection.
@ -279,7 +282,7 @@ restore_opcodes(yamop *pc)
#ifdef BEAM #ifdef BEAM
case _retry_eam: case _retry_eam:
#endif #endif
#if THREADS #ifdef THREADS
case _thread_local: case _thread_local:
#endif #endif
case _expand_index: case _expand_index:
@ -946,12 +949,12 @@ restore_opcodes(yamop *pc)
{ {
int i, j; int i, j;
CELL *oldcode; CELL *oldcode;
#if !USE_OFFSETS #if !defined(USE_OFFSETS)
CELL *startcode; CELL *startcode;
#endif #endif
i = pc->u.sssl.s; i = pc->u.sssl.s;
#if !USE_OFFSETS #if !defined(USE_OFFSETS)
startcode = startcode =
#endif #endif
oldcode = (CELL *)(pc->u.sssl.l = PtoOpAdjust(pc->u.sssl.l)); oldcode = (CELL *)(pc->u.sssl.l = PtoOpAdjust(pc->u.sssl.l));

View File

@ -11,8 +11,11 @@
* File: rheap.h * * File: rheap.h *
* comments: walk through heap code * * comments: walk through heap code *
* * * *
* Last rev: $Date: 2008-03-25 16:45:53 $,$Author: vsc $ * * Last rev: $Date: 2008-03-25 22:03:14 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.86 2008/03/25 16:45:53 vsc
* make or-parallelism compile again
*
* Revision 1.85 2008/02/12 17:03:52 vsc * Revision 1.85 2008/02/12 17:03:52 vsc
* SWI-portability changes * SWI-portability changes
* *
@ -821,7 +824,7 @@ restore_codes(void)
PredEntryAdjust(Yap_heap_regs->pred_throw); PredEntryAdjust(Yap_heap_regs->pred_throw);
Yap_heap_regs->pred_handle_throw = Yap_heap_regs->pred_handle_throw =
PredEntryAdjust(Yap_heap_regs->pred_handle_throw); PredEntryAdjust(Yap_heap_regs->pred_handle_throw);
#if DEBUG #ifdef DEBUG
if (Yap_heap_regs->db_erased_list) { if (Yap_heap_regs->db_erased_list) {
Yap_heap_regs->db_erased_list = Yap_heap_regs->db_erased_list =
PtoLUCAdjust(Yap_heap_regs->db_erased_list); PtoLUCAdjust(Yap_heap_regs->db_erased_list);

View File

@ -34,7 +34,7 @@
#define YP_clearerr clearerr #define YP_clearerr clearerr
#define YP_feof feof #define YP_feof feof
#define YP_ferror ferror #define YP_ferror ferror
#if _MSC_VER || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#define YP_fileno _fileno #define YP_fileno _fileno
#else #else
#define YP_fileno fileno #define YP_fileno fileno
@ -49,7 +49,7 @@
#define YP_fdopen fdopen #define YP_fdopen fdopen
#define init_yp_stdio() #define init_yp_stdio()
#if _MSC_VER || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#define open _open #define open _open
#define close _close #define close _close
#define popen _popen #define popen _popen
@ -347,13 +347,13 @@ int STD_PROTO(Yap_growtrail_in_parser, (tr_fr_ptr *, TokEntry **, VarEntry **)
#if HAVE_ERRNO_H #ifdef HAVE_ERRNO_H
#include <errno.h> #include <errno.h>
#else #else
extern int errno; extern int errno;
#endif #endif
#if DEBUG #ifdef DEBUG
#if COROUTINING #if COROUTINING
extern int Yap_Portray_delays; extern int Yap_Portray_delays;
#endif #endif

View File

@ -17,6 +17,7 @@ xb
<h2>Yap-5.1.3:</h2> <h2>Yap-5.1.3:</h2>
<ul> <ul>
<li> FIXED: regexp core-dump (obs from Ryszard Szopa).</li>
<li> FIXED: handle message_queue_create/1 with vars right (obs from <li> FIXED: handle message_queue_create/1 with vars right (obs from
Paulo Moura).</li> Paulo Moura).</li>
<li> FIXED: handle thread overflow right (obs from Paulo Moura).</li> <li> FIXED: handle thread overflow right (obs from Paulo Moura).</li>

View File

@ -271,14 +271,14 @@
#endif #endif
/* Should we use MPI ? */ /* Should we use MPI ? */
#if HAVE_MPI_H && (HAVE_LIBMPI || HAVE_LIBMPICH) #if defined(HAVE_MPI_H) && (HAVE_LIBMPI || HAVE_LIBMPICH)
#define HAVE_MPI 1 #define HAVE_MPI 1
#else #else
#define HAVE_MPI 0 #define HAVE_MPI 0
#endif #endif
/* Should we use MPE ? */ /* Should we use MPE ? */
#if HAVE_MPI_H && HAVE_LIBMPE && HAVE_MPI #if defined(HAVE_MPI_H) && HAVE_LIBMPE && HAVE_MPI
#define HAVE_MPE 1 #define HAVE_MPE 1
#else #else
#define HAVE_MPE 0 #define HAVE_MPE 0

View File

@ -78,18 +78,6 @@ static void PROTO(do_bootfile, (char *));
static void PROTO(do_top_goal,(YAP_Term)); static void PROTO(do_top_goal,(YAP_Term));
static void PROTO(exec_top_level,(int, YAP_init_args *)); static void PROTO(exec_top_level,(int, YAP_init_args *));
#ifndef LIGHT
void PROTO (exit, (int));
#endif
#ifdef LIGHT
#include <unix.h>
int
_main (int, char **);
#else
int PROTO (main, (int, char **));
#endif
#ifdef DEBUG #ifdef DEBUG
static int output_msg; static int output_msg;
#endif #endif
@ -117,7 +105,7 @@ static char *def_value[MAXDEFS];
static int def_c=0; static int def_c=0;
/* End preprocessor code */ /* End preprocessor code */
#if USE_MYPUTC #ifdef USE_MYPUTC
static void static void
myputc (int ch) myputc (int ch)
{ {
@ -274,7 +262,7 @@ static int
parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap) parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
{ {
char *p; char *p;
#if USE_SYSTEM_MALLOC #ifdef USE_SYSTEM_MALLOC
int BootMode = YAP_FULL_BOOT_FROM_PROLOG; int BootMode = YAP_FULL_BOOT_FROM_PROLOG;
#else #else
int BootMode = YAP_BOOT_FROM_SAVED_CODE; int BootMode = YAP_BOOT_FROM_SAVED_CODE;

View File

@ -129,8 +129,8 @@ static int regexp(void)
YAP_FreeSpaceFromYap(sbuf); YAP_FreeSpaceFromYap(sbuf);
return(FALSE); return(FALSE);
} }
pmatch = YAP_AllocSpaceFromYap(sizeof(regmatch_t)*(nmatch+1)); pmatch = YAP_AllocSpaceFromYap(sizeof(regmatch_t)*(nmatch));
out = yap_regexec(&reg,sbuf,nmatch+1,pmatch,0); out = yap_regexec(&reg,sbuf,nmatch,pmatch,0);
if (out == 0) { if (out == 0) {
/* match succeed, let's fill the match in */ /* match succeed, let's fill the match in */
long int i; long int i;