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:
parent
b2274186bd
commit
0c0826b938
13
C/agc.c
13
C/agc.c
@ -155,16 +155,9 @@ AtomAdjust(Atom a)
|
||||
#define YAdjust(P) (P)
|
||||
#define HoldEntryAdjust(P) (P)
|
||||
|
||||
static void
|
||||
recompute_mask(DBRef dbr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#define recompute_mask(dbr)
|
||||
|
||||
static void
|
||||
rehash(CELL *oldcode, int NOfE, int KindOfEntries)
|
||||
{
|
||||
}
|
||||
#define rehash(oldcode, NOfE, KindOfEntries)
|
||||
|
||||
#include "rheap.h"
|
||||
|
||||
@ -280,7 +273,7 @@ mark_local(void)
|
||||
|
||||
if (!IsVarTerm(reg)) {
|
||||
if (IsAtomTerm(reg)
|
||||
#if TABLING
|
||||
#ifdef TABLING
|
||||
/* assume we cannot have atoms on first page,
|
||||
so this must be an arity
|
||||
*/
|
||||
|
2
C/init.c
2
C/init.c
@ -156,7 +156,7 @@ char emacs_tmp[256], emacs_tmp2[256];
|
||||
|
||||
/********* Prolog State ********************************************/
|
||||
|
||||
prolog_exec_mode Yap_PrologMode = BootMode;
|
||||
Int Yap_PrologMode = BootMode;
|
||||
|
||||
int Yap_CritLocks = 0;
|
||||
|
||||
|
@ -61,7 +61,7 @@ AtomEntry;
|
||||
|
||||
|
||||
/* Props and Atoms are stored in chains, ending with a NIL */
|
||||
#if USE_OFFSETS
|
||||
#ifdef USE_OFFSETS
|
||||
# define EndOfPAEntr(P) ( Addr(P) == AtomBase)
|
||||
#else
|
||||
# define EndOfPAEntr(P) ( Addr(P) == NIL )
|
||||
@ -72,7 +72,7 @@ AtomEntry;
|
||||
|
||||
/* ********************** Properties **********************************/
|
||||
|
||||
#if USE_OFFSETS
|
||||
#if defined(USE_OFFSETS)
|
||||
#define USE_OFFSETS_IN_PROPS 1
|
||||
#else
|
||||
#define USE_OFFSETS_IN_PROPS 0
|
||||
|
@ -71,7 +71,7 @@
|
||||
#define LOAD_SHL 1
|
||||
#endif
|
||||
|
||||
#if HAVE_NSLINKMODULE
|
||||
#ifdef HAVE_NSLINKMODULE
|
||||
#ifdef NO_DYN
|
||||
#undef NO_DYN
|
||||
#endif
|
||||
|
10
H/Heap.h
10
H/Heap.h
@ -10,7 +10,7 @@
|
||||
* File: Heap.h *
|
||||
* mods: *
|
||||
* 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 */
|
||||
@ -50,7 +50,7 @@ typedef struct memory_hole {
|
||||
|
||||
typedef struct gc_ma_hash_entry_struct {
|
||||
UInt timestmp;
|
||||
#if TABLING
|
||||
#ifdef TABLING
|
||||
tr_fr_ptr loc;
|
||||
struct gc_ma_hash_entry_struct *more;
|
||||
#endif
|
||||
@ -1024,13 +1024,13 @@ struct various_codes *Yap_heap_regs;
|
||||
#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));
|
||||
#endif
|
||||
|
||||
ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *));
|
||||
#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));
|
||||
EXTERN inline ADDR
|
||||
Yap_PreAllocCodeSpace(void)
|
||||
@ -1047,7 +1047,7 @@ Yap_PreAllocCodeSpace(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
Prop STD_PROTO(Yap_NewThreadPred, (PredEntry *));
|
||||
Prop STD_PROTO(Yap_NewPredPropByFunctor, (Functor, Term));
|
||||
|
||||
|
8
H/Regs.h
8
H/Regs.h
@ -10,7 +10,7 @@
|
||||
* File: Regs.h *
|
||||
* mods: *
|
||||
* 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].
|
||||
*/
|
||||
|
||||
#if PUSH_X
|
||||
#ifdef PUSH_X
|
||||
Term XTERMS[MaxTemps]; /* 29 */
|
||||
#endif
|
||||
}
|
||||
@ -149,7 +149,7 @@ REGSTORE;
|
||||
|
||||
extern REGSTORE *Yap_regp;
|
||||
|
||||
#if PUSH_X
|
||||
#ifdef PUSH_X
|
||||
|
||||
#define XREGS (Yap_REGS.XTERMS)
|
||||
|
||||
@ -750,7 +750,7 @@ EXTERN inline void restore_B(void) {
|
||||
#define BBREG BB
|
||||
#endif /* SBA || TABLING */
|
||||
|
||||
#if !THREADS
|
||||
#if !defined(THREADS)
|
||||
/* use actual addresses for regs */
|
||||
#define PRECOMPUTE_REGADDRESS 1
|
||||
#endif /* THREADS */
|
||||
|
14
H/TermExt.h
14
H/TermExt.h
@ -10,7 +10,7 @@
|
||||
* File: TermExt.h *
|
||||
* mods: *
|
||||
* 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
|
||||
@ -19,12 +19,12 @@
|
||||
#define SF_STORE ((special_functors *)HEAP_INIT_BASE)
|
||||
#endif
|
||||
|
||||
#if USE_OFFSETS
|
||||
#ifdef USE_OFFSETS
|
||||
#define AtomFoundVar ((Atom)(&(((special_functors *)(NULL))->AtFoundVar)))
|
||||
#define AtomFreeTerm ((Atom)(&(((special_functors *)(NULL))->AtFreeTerm)))
|
||||
#define AtomNil ((Atom)(&(((special_functors *)(NULL))->AtNil)))
|
||||
#define AtomDot ((Atom)(&(((special_functors *)(NULL))->AtDot)))
|
||||
#elif THREADS
|
||||
#elif defined(THREADS)
|
||||
#define AtomFoundVar AbsAtom(SF_STORE->AtFoundVar)
|
||||
#define AtomFreeTerm AbsAtom(SF_STORE->AtFreeTerm)
|
||||
#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
|
||||
in the heap when we start the system */
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
typedef struct special_functors_struct
|
||||
{
|
||||
AtomEntry *AtFoundVar;
|
||||
@ -505,7 +505,11 @@ unify_extension (Functor f, CELL d0, CELL * pt0, CELL d1)
|
||||
return (pt0[1] == RepAppl (d1)[1]);
|
||||
case big_int_e:
|
||||
#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
|
||||
return d0 == d1;
|
||||
#endif /* USE_GMP */
|
||||
|
34
H/Yap.h
34
H/Yap.h
@ -10,7 +10,7 @@
|
||||
* File: Yap.h.m4 *
|
||||
* mods: *
|
||||
* 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"
|
||||
@ -53,7 +53,7 @@
|
||||
#undef TRAILING_REQUIRES_BRANCH
|
||||
#endif /* YAPOR || TABLING */
|
||||
|
||||
#if ANALYST
|
||||
#ifdef ANALYST
|
||||
#ifdef USE_THREADED_CODE
|
||||
#undef USE_THREADED_CODE
|
||||
#endif
|
||||
@ -65,7 +65,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if SUPPORT_THREADS || SUPPORT_CONDOR
|
||||
#if defined(SUPPORT_THREADS) || defined(SUPPORT_CONDOR)
|
||||
#define USE_SYSTEM_MALLOC 1
|
||||
#endif
|
||||
|
||||
@ -219,7 +219,7 @@ typedef unsigned long int YAP_ULONG_LONG;
|
||||
#define LOW_PROF 1
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#ifdef DEBUG
|
||||
extern char Yap_Option[20];
|
||||
#endif
|
||||
|
||||
@ -230,17 +230,17 @@ extern char Yap_Option[20];
|
||||
#define MMAP_ADDR 0x42000000
|
||||
#endif
|
||||
|
||||
#if !IN_SECOND_QUADRANT
|
||||
#if !defined(IN_SECOND_QUADRANT)
|
||||
#if __linux__ || __FreeBSD__ || __NetBSD__ || mips || __APPLE__
|
||||
#if defined(YAPOR) && defined(__alpha)
|
||||
|
||||
#define MMAP_ADDR 0x40000000
|
||||
#elif mips
|
||||
#elif defined(mips)
|
||||
#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
|
||||
#define MMAP_ADDR 0x200000000
|
||||
#elif __APPLE__ && !__LP64__
|
||||
#elif defined(__APPLE__) && !__LP64__
|
||||
#define MMAP_ADDR 0x20000000
|
||||
#else
|
||||
#define MMAP_ADDR 0x08800000
|
||||
@ -254,7 +254,7 @@ extern char Yap_Option[20];
|
||||
#define HEAP_INIT_BASE 0L
|
||||
#define AtomBase NULL
|
||||
#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 AtomBase ((char *)MMAP_ADDR)
|
||||
#else
|
||||
@ -775,7 +775,7 @@ VarOfTerm (Term t)
|
||||
}
|
||||
|
||||
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
|
||||
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
|
||||
|
||||
inline EXTERN Term MkAtomTerm (Atom);
|
||||
@ -1033,7 +1033,7 @@ IntegerOfTerm (Term t)
|
||||
|
||||
/*************** unification routines ***********************************/
|
||||
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
#include "sbaamiops.h"
|
||||
#else
|
||||
#include "amiops.h"
|
||||
@ -1159,7 +1159,7 @@ typedef enum
|
||||
SystemMode = 0x10000, /* in system mode */
|
||||
} prolog_exec_mode;
|
||||
|
||||
extern prolog_exec_mode Yap_PrologMode;
|
||||
extern Int Yap_PrologMode;
|
||||
extern int Yap_CritLocks;
|
||||
|
||||
/************** Access to yap initial arguments ***************************/
|
||||
@ -1175,7 +1175,7 @@ extern int Yap_PrologShouldHandleInterrupts;
|
||||
|
||||
#define DefaultMaxModules 256
|
||||
|
||||
#if YAPOR
|
||||
#ifdef YAPOR
|
||||
#define YAPEnterCriticalSection() \
|
||||
{ \
|
||||
if (worker_id != GLOBAL_LOCKS_who_locked_heap) { \
|
||||
@ -1202,7 +1202,7 @@ extern int Yap_PrologShouldHandleInterrupts;
|
||||
UNLOCK(GLOBAL_LOCKS_heap_access); \
|
||||
} \
|
||||
}
|
||||
#elif THREADS
|
||||
#elif defined(THREADS)
|
||||
#define YAPEnterCriticalSection() \
|
||||
{ \
|
||||
/* LOCK(BGL); */ \
|
||||
@ -1260,7 +1260,7 @@ typedef struct TIMED_MAVAR
|
||||
|
||||
/********* while debugging you may need some info ***********************/
|
||||
|
||||
#if EMACS
|
||||
#ifdef EMACS
|
||||
extern char emacs_tmp[], emacs_tmp2[];
|
||||
#endif
|
||||
|
||||
@ -1270,7 +1270,7 @@ extern char emacs_tmp[], emacs_tmp2[];
|
||||
#include "opt.macros.h"
|
||||
#endif /* YAPOR || TABLING */
|
||||
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
#include "sbaunify.h"
|
||||
#endif
|
||||
|
||||
|
@ -11,8 +11,11 @@
|
||||
* File: YapOpcodes.h *
|
||||
* 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 $
|
||||
* 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
|
||||
* speedup meta-calls
|
||||
*
|
||||
@ -386,7 +389,7 @@
|
||||
OPCODE(alloc_for_logical_pred ,EC),
|
||||
OPCODE(unify_idb_term ,e),
|
||||
OPCODE(copy_idb_term ,e),
|
||||
#if THREADS
|
||||
#if defined(THREADS)
|
||||
OPCODE(thread_local ,e),
|
||||
#endif
|
||||
#ifdef SFUNC
|
||||
|
@ -10,7 +10,7 @@
|
||||
* File: Yap.proto *
|
||||
* mods: *
|
||||
* 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 */
|
||||
@ -56,7 +56,7 @@ Term *STD_PROTO(Yap_AddressFromSlot,(long));
|
||||
void STD_PROTO(Yap_PutInSlot,(long, Term));
|
||||
|
||||
|
||||
#if SFUNC
|
||||
#ifdef SFUNC
|
||||
Term STD_PROTO(MkSFTerm,(Functor,int,Term *,Term));
|
||||
CELL STD_PROTO(*ArgsOfSFTerm,(Term));
|
||||
#endif
|
||||
@ -113,7 +113,7 @@ Term STD_PROTO(Yap_all_calls,(void));
|
||||
Atom STD_PROTO(Yap_ConsultingFile,(void));
|
||||
struct pred_entry *STD_PROTO(Yap_PredForChoicePt,(choiceptr));
|
||||
void STD_PROTO(Yap_InitCdMgr,(void));
|
||||
#if EMACS
|
||||
#ifdef EMACS
|
||||
int STD_PROTO(where_new_clause, (Prop, int));
|
||||
#endif
|
||||
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_volume_header,(char *));
|
||||
void STD_PROTO(Yap_InitSysPath,(void));
|
||||
#if MAC
|
||||
#ifdef MAC
|
||||
void STD_PROTO(Yap_SetTextFile,(char *));
|
||||
#endif
|
||||
void STD_PROTO(Yap_cputime_interval,(Int *,Int *));
|
||||
|
10
H/Yatom.h
10
H/Yatom.h
@ -17,7 +17,7 @@
|
||||
|
||||
/* This code can only be defined *after* including Regs.h!!! */
|
||||
|
||||
#if USE_OFFSETS
|
||||
#ifdef USE_OFFSETS
|
||||
|
||||
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_GetAPropHavingLock, (AtomEntry *, PropFlags));
|
||||
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
EXTERN inline PredEntry *STD_PROTO (Yap_GetThreadPred, (PredEntry *));
|
||||
#endif
|
||||
|
||||
@ -1407,7 +1407,7 @@ GetPredPropByFuncHavingLock (FunctorEntry *fe, Term cur_mod)
|
||||
return NIL;
|
||||
}
|
||||
if ((p->ModuleOfPred == cur_mod || !(p->ModuleOfPred))) {
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
/* Thread Local Predicates */
|
||||
if (p->PredFlags & ThreadLocalPredFlag) {
|
||||
return AbsPredProp (Yap_GetThreadPred (p));
|
||||
@ -1424,7 +1424,7 @@ GetPredPropByFuncHavingLock (FunctorEntry *fe, Term cur_mod)
|
||||
if (p->FunctorOfPred == fe &&
|
||||
p->ModuleOfPred == cur_mod)
|
||||
{
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
/* Thread Local Predicates */
|
||||
if (p->PredFlags & ThreadLocalPredFlag) {
|
||||
READ_UNLOCK(PredHashRWLock);
|
||||
@ -1471,7 +1471,7 @@ PredPropByAtom (Atom at, Term cur_mod)
|
||||
if (pe->KindOfPE == PEProp &&
|
||||
(pe->ModuleOfPred == cur_mod || !pe->ModuleOfPred))
|
||||
{
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
/* Thread Local Predicates */
|
||||
if (pe->PredFlags & ThreadLocalPredFlag)
|
||||
{
|
||||
|
34
H/absmi.h
34
H/absmi.h
@ -75,7 +75,7 @@ static char SccsId[] = "%W% %G%";
|
||||
/***************************************************************
|
||||
* 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 */
|
||||
#define PREG P1REG
|
||||
#endif
|
||||
@ -139,7 +139,7 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */
|
||||
#ifdef YAPOR
|
||||
#include "or.macros.h"
|
||||
#endif /* YAPOR */
|
||||
#if USE_SYSTEM_MALLOC
|
||||
#ifdef USE_SYSTEM_MALLOC
|
||||
#include "Heap.h"
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
@ -367,7 +367,7 @@ restore_absmi_regs(REGSTORE * old_regs)
|
||||
|
||||
#endif
|
||||
|
||||
#if USE_PREFETCH
|
||||
#ifdef USE_PREFETCH
|
||||
|
||||
#define START_PREFETCH(TYPE) ALWAYS_START_PREFETCH(TYPE)
|
||||
|
||||
@ -447,7 +447,7 @@ restore_absmi_regs(REGSTORE * old_regs)
|
||||
|
||||
#endif
|
||||
|
||||
#if USE_PREFETCH
|
||||
#ifdef USE_PREFETCH
|
||||
|
||||
#define GONext() ALWAYS_GONext()
|
||||
|
||||
@ -600,7 +600,7 @@ typedef CELL label;
|
||||
/*
|
||||
* Next, Y
|
||||
*/
|
||||
#if SHADOW_Y
|
||||
#ifdef SHADOW_Y
|
||||
#define set_y() YREG = YENV
|
||||
#define save_y() YENV = YREG
|
||||
#else
|
||||
@ -612,7 +612,7 @@ typedef CELL label;
|
||||
/*
|
||||
* Next, CP
|
||||
*/
|
||||
#if SHADOW_CP
|
||||
#ifdef SHADOW_CP
|
||||
#define set_cp() CPREG = CP
|
||||
#define save_cp() CP = CPREG
|
||||
#else
|
||||
@ -654,12 +654,12 @@ Macros to check the limits of stacks
|
||||
/* for the moment I don't know how to handle trail overflows
|
||||
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
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if OS_HANDLES_TR_OVERFLOW
|
||||
#ifdef OS_HANDLES_TR_OVERFLOW
|
||||
|
||||
#define check_trail(x)
|
||||
|
||||
@ -1068,7 +1068,7 @@ Macros to check the limits of stacks
|
||||
/*
|
||||
* Next, HB
|
||||
*/
|
||||
#if SHADOW_HB
|
||||
#ifdef SHADOW_HB
|
||||
#undef HBREG
|
||||
#define set_hb() HBREG = HB
|
||||
#define save_hb() HB = HBREG
|
||||
@ -1077,17 +1077,17 @@ Macros to check the limits of stacks
|
||||
#define save_hb()
|
||||
#endif
|
||||
|
||||
#if IN_ABSMI_C || IN_UNIFY_C
|
||||
#if defined(IN_ABSMI_C) || defined(IN_UNIFY_C)
|
||||
|
||||
static int
|
||||
|
||||
IUnify_complex(CELL *pt0, CELL *pt0_end, CELL *pt1)
|
||||
{
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
#undef Yap_REGS
|
||||
register REGSTORE *regp = Yap_regp;
|
||||
#define Yap_REGS (*regp)
|
||||
#elif SHADOW_REGS
|
||||
#elif defined(SHADOW_REGS)
|
||||
#if defined(B) || defined(TR)
|
||||
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
|
||||
|
||||
#if SHADOW_HB
|
||||
#ifdef SHADOW_HB
|
||||
register CELL *HBREG = HB;
|
||||
#endif /* SHADOW_HB */
|
||||
|
||||
#if USE_SYSTEM_MALLOC
|
||||
#ifdef USE_SYSTEM_MALLOC
|
||||
CELL **to_visit_max = (CELL **)Yap_PreAllocCodeSpace(), **to_visit = (CELL **)AuxSp;
|
||||
#define address_to_visit_max (&to_visit_max)
|
||||
#define to_visit_base ((CELL **)AuxSp)
|
||||
@ -1265,10 +1265,10 @@ cufail:
|
||||
}
|
||||
#endif
|
||||
return (FALSE);
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
#undef Yap_REGS
|
||||
#define Yap_REGS (*Yap_regp)
|
||||
#elif SHADOW_REGS
|
||||
#elif defined(SHADOW_REGS)
|
||||
#if defined(B) || defined(TR)
|
||||
#undef Yap_REGS
|
||||
#endif /* defined(B) || defined(TR) */
|
||||
@ -1289,7 +1289,7 @@ cufail:
|
||||
#endif
|
||||
|
||||
|
||||
#if IN_ABSMI_C || IN_INLINES_C
|
||||
#if defined(IN_ABSMI_C) || defined(IN_INLINES_C)
|
||||
|
||||
static int
|
||||
iequ_complex(register CELL *pt0, register CELL *pt0_end,
|
||||
|
@ -78,7 +78,7 @@ typedef struct FREEB {
|
||||
#define ALIGN_SIZE(X,SIZE) (((CELL)(X)+((SIZE)-1)) & ~((SIZE)-1))
|
||||
|
||||
/* I'll assume page size is always a power of two */
|
||||
#if _WIN32
|
||||
#ifdef _WIN32
|
||||
/* in WIN32 VirtualAlloc works in multiples of 64K */
|
||||
#define YAP_ALLOC_SIZE (64*1024)
|
||||
#define LGPAGE_SIZE YAP_ALLOC_SIZE
|
||||
|
29
H/amiops.h
29
H/amiops.h
@ -233,7 +233,7 @@ AlignGlobalForDouble(void)
|
||||
#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
|
||||
branch when jumping */
|
||||
@ -387,7 +387,7 @@ reset_trail(tr_fr_ptr TR0) {
|
||||
/* AbsAppl means */
|
||||
/* multi-assignment variable */
|
||||
/* so the next cell is the old value */
|
||||
#if FROZEN_STACKS
|
||||
#ifdef FROZEN_STACKS
|
||||
pt[0] = TrailVal(TR-1);
|
||||
TR -= 1;
|
||||
#else
|
||||
@ -434,18 +434,31 @@ Yap_unify_constant(register Term a, register Term cons)
|
||||
case (CELL)FunctorDBRef:
|
||||
return(a == cons);
|
||||
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:
|
||||
return(FloatOfTerm(a) == FloatOfTerm(cons));
|
||||
#ifdef USE_GMP
|
||||
{
|
||||
Float d0 = FloatOfTerm(a);
|
||||
Float d1 = FloatOfTerm(cons);
|
||||
return d0 == d1;
|
||||
}
|
||||
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 */
|
||||
default:
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
} else return(FALSE);
|
||||
} else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
deref_body(a,pt,unify_cons_unk,unify_cons_nonvar);
|
||||
|
6
H/eval.h
6
H/eval.h
@ -21,10 +21,10 @@
|
||||
#if HAVE_MATH_H
|
||||
#include <math.h>
|
||||
#endif
|
||||
#if HAVE_IEEEFP_H
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
#if HAVE_LIMITS_H
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
@ -82,7 +82,7 @@ Functor STD_PROTO(EvalArg,(Term,arith_retptr));
|
||||
|
||||
/* this macro, dependent on the particular implementation
|
||||
is used to interface the arguments into the C libraries */
|
||||
#if MPW
|
||||
#ifdef MPW
|
||||
#define FL(X) ((extended)(X))
|
||||
#else
|
||||
#define FL(X) ((double)(X))
|
||||
|
@ -23,7 +23,7 @@ static char SccsId[] = "%W% %G%";
|
||||
*
|
||||
*/
|
||||
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@ -33,7 +33,7 @@ static char SccsId[] = "%W% %G%";
|
||||
|
||||
#if HAVE_LIBREADLINE
|
||||
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
|
||||
FILE *rl_instream, *rl_outstream;
|
||||
#endif
|
||||
@ -48,7 +48,7 @@ typedef struct stream_desc
|
||||
struct {
|
||||
Atom name;
|
||||
Term user_name;
|
||||
#if defined(__MINGW32__) || _MSC_VER
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
#define PLGETC_BUF_SIZE 4096
|
||||
char *buf, *ptr;
|
||||
int left;
|
||||
@ -62,7 +62,7 @@ typedef struct stream_desc
|
||||
volatile void *error_handler;
|
||||
} mem_string;
|
||||
struct {
|
||||
#if defined(__MINGW32__) || _MSC_VER
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
HANDLE hdl;
|
||||
#else
|
||||
int fd;
|
||||
|
11
H/rclause.h
11
H/rclause.h
@ -12,8 +12,11 @@
|
||||
* File: rclause.h *
|
||||
* 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 $
|
||||
* 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
|
||||
* valgrind it!
|
||||
* enable atom garbage collection.
|
||||
@ -279,7 +282,7 @@ restore_opcodes(yamop *pc)
|
||||
#ifdef BEAM
|
||||
case _retry_eam:
|
||||
#endif
|
||||
#if THREADS
|
||||
#ifdef THREADS
|
||||
case _thread_local:
|
||||
#endif
|
||||
case _expand_index:
|
||||
@ -946,12 +949,12 @@ restore_opcodes(yamop *pc)
|
||||
{
|
||||
int i, j;
|
||||
CELL *oldcode;
|
||||
#if !USE_OFFSETS
|
||||
#if !defined(USE_OFFSETS)
|
||||
CELL *startcode;
|
||||
#endif
|
||||
|
||||
i = pc->u.sssl.s;
|
||||
#if !USE_OFFSETS
|
||||
#if !defined(USE_OFFSETS)
|
||||
startcode =
|
||||
#endif
|
||||
oldcode = (CELL *)(pc->u.sssl.l = PtoOpAdjust(pc->u.sssl.l));
|
||||
|
@ -11,8 +11,11 @@
|
||||
* File: rheap.h *
|
||||
* 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 $
|
||||
* 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
|
||||
* SWI-portability changes
|
||||
*
|
||||
@ -821,7 +824,7 @@ restore_codes(void)
|
||||
PredEntryAdjust(Yap_heap_regs->pred_throw);
|
||||
Yap_heap_regs->pred_handle_throw =
|
||||
PredEntryAdjust(Yap_heap_regs->pred_handle_throw);
|
||||
#if DEBUG
|
||||
#ifdef DEBUG
|
||||
if (Yap_heap_regs->db_erased_list) {
|
||||
Yap_heap_regs->db_erased_list =
|
||||
PtoLUCAdjust(Yap_heap_regs->db_erased_list);
|
||||
|
@ -34,7 +34,7 @@
|
||||
#define YP_clearerr clearerr
|
||||
#define YP_feof feof
|
||||
#define YP_ferror ferror
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define YP_fileno _fileno
|
||||
#else
|
||||
#define YP_fileno fileno
|
||||
@ -49,7 +49,7 @@
|
||||
#define YP_fdopen fdopen
|
||||
#define init_yp_stdio()
|
||||
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define open _open
|
||||
#define close _close
|
||||
#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>
|
||||
#else
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#ifdef DEBUG
|
||||
#if COROUTINING
|
||||
extern int Yap_Portray_delays;
|
||||
#endif
|
||||
|
@ -17,6 +17,7 @@ xb
|
||||
|
||||
<h2>Yap-5.1.3:</h2>
|
||||
<ul>
|
||||
<li> FIXED: regexp core-dump (obs from Ryszard Szopa).</li>
|
||||
<li> FIXED: handle message_queue_create/1 with vars right (obs from
|
||||
Paulo Moura).</li>
|
||||
<li> FIXED: handle thread overflow right (obs from Paulo Moura).</li>
|
||||
|
@ -271,14 +271,14 @@
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
#else
|
||||
#define HAVE_MPI 0
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
#else
|
||||
#define HAVE_MPE 0
|
||||
|
@ -78,18 +78,6 @@ static void PROTO(do_bootfile, (char *));
|
||||
static void PROTO(do_top_goal,(YAP_Term));
|
||||
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
|
||||
static int output_msg;
|
||||
#endif
|
||||
@ -117,7 +105,7 @@ static char *def_value[MAXDEFS];
|
||||
static int def_c=0;
|
||||
/* End preprocessor code */
|
||||
|
||||
#if USE_MYPUTC
|
||||
#ifdef USE_MYPUTC
|
||||
static void
|
||||
myputc (int ch)
|
||||
{
|
||||
@ -274,7 +262,7 @@ static int
|
||||
parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
||||
{
|
||||
char *p;
|
||||
#if USE_SYSTEM_MALLOC
|
||||
#ifdef USE_SYSTEM_MALLOC
|
||||
int BootMode = YAP_FULL_BOOT_FROM_PROLOG;
|
||||
#else
|
||||
int BootMode = YAP_BOOT_FROM_SAVED_CODE;
|
||||
|
@ -129,8 +129,8 @@ static int regexp(void)
|
||||
YAP_FreeSpaceFromYap(sbuf);
|
||||
return(FALSE);
|
||||
}
|
||||
pmatch = YAP_AllocSpaceFromYap(sizeof(regmatch_t)*(nmatch+1));
|
||||
out = yap_regexec(®,sbuf,nmatch+1,pmatch,0);
|
||||
pmatch = YAP_AllocSpaceFromYap(sizeof(regmatch_t)*(nmatch));
|
||||
out = yap_regexec(®,sbuf,nmatch,pmatch,0);
|
||||
if (out == 0) {
|
||||
/* match succeed, let's fill the match in */
|
||||
long int i;
|
||||
|
Reference in New Issue
Block a user