diff --git a/C/arith0.c b/C/arith0.c index fce74e9d3..7d8a023aa 100644 --- a/C/arith0.c +++ b/C/arith0.c @@ -111,7 +111,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" diff --git a/C/arith1.c b/C/arith1.c index 0c7d45798..abaab04cc 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -228,7 +228,7 @@ X is Y*10+C-48. #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" static Term float_to_int(Float v USES_REGS) diff --git a/C/arith2.c b/C/arith2.c index ddce481a5..5a26fced4 100644 --- a/C/arith2.c +++ b/C/arith2.c @@ -127,7 +127,7 @@ These are the binary numeric operators currently supported by YAP. #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #include "arith2.h" diff --git a/C/arrays.c b/C/arrays.c index f621bd075..eb219ad3c 100644 --- a/C/arrays.c +++ b/C/arrays.c @@ -102,7 +102,7 @@ The following predicates manipulate arrays: #include "Yap.h" #include "Yatom.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #include "heapgc.h" #if HAVE_ERRNO_H #include diff --git a/C/bignum.c b/C/bignum.c index f0a7b0367..3da5acf1d 100644 --- a/C/bignum.c +++ b/C/bignum.c @@ -30,7 +30,7 @@ static char SccsId[] = "%W% %G%"; #ifdef USE_GMP -#include "eval.h" +#include "YapEval.h" #include "alloc.h" Term diff --git a/C/cmppreds.c b/C/cmppreds.c index 9da40cd5b..faa0970c5 100644 --- a/C/cmppreds.c +++ b/C/cmppreds.c @@ -57,7 +57,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_STRING_H #include #endif diff --git a/C/compiler.c b/C/compiler.c index bffd9ab19..04bbe70b6 100644 --- a/C/compiler.c +++ b/C/compiler.c @@ -174,7 +174,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "alloc.h" #include "clause.h" -#include "compile.h" +#include "YapCompile.h" #include "yapio.h" #if HAVE_STRING_H #include diff --git a/C/computils.c b/C/computils.c index 82b4e1189..3bf9ab27a 100644 --- a/C/computils.c +++ b/C/computils.c @@ -54,13 +54,13 @@ static char SccsId[] = "%W% %G%"; /* * This file includes a set of utilities, useful to the several compilation - * modules + * modules */ #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "compile.h" +#include "YapCompile.h" #include "yapio.h" #if HAVE_STRING_H #include @@ -69,7 +69,7 @@ static char SccsId[] = "%W% %G%"; /* * The compiler creates an instruction chain which will be assembled after - * afterwards + * afterwards */ @@ -146,7 +146,7 @@ AllocCMem (UInt size, struct intermediates *cip) LOCAL_Error_Size = 256+((char *)cip->freep - (char *)HR); save_machine_regs(); siglongjmp(cip->CompilerBotch, OUT_OF_STACK_BOTCH); - } + } p = cip->freep; cip->freep += size; return p; @@ -216,7 +216,7 @@ is_a_test(Term arg, Term mod) return TRUE; } return FALSE; - } + } return pe->PredFlags & (TestPredFlag|BinaryPredFlag); } } @@ -315,7 +315,7 @@ Yap_emit_6ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CE p->rnd1 = r1; p->rnd2 = r2; p->rnd3 = r3; - p->rnd4 = r4; + p->rnd4 = r4; p->rnd5 = r5; p->rnd6 = r6; p->nextInst = NIL; @@ -337,7 +337,7 @@ Yap_emit_7ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CE p->rnd1 = r1; p->rnd2 = r2; p->rnd3 = r3; - p->rnd4 = r4; + p->rnd4 = r4; p->rnd5 = r5; p->rnd6 = r6; p->rnd7 = r7; @@ -520,7 +520,7 @@ write_special_label(special_label_op arg, special_label_id rn, UInt lab) Yap_DebugErrorPuts("fail"); break; } - } + } } static void @@ -616,7 +616,7 @@ ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc) Yap_DebugPlWrite(MkIntegerTerm((Int)(*ptr++))); } } - break; + break; case 'l': write_address (arg); break; @@ -645,7 +645,7 @@ ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc) Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs)); } } - break; + break; case 'N': { Ventry *v; @@ -795,4 +795,3 @@ Yap_ShowCode (struct intermediates *cint) } #endif /* DEBUG */ - diff --git a/C/depth_bound.c b/C/depth_bound.c index b9e253dfd..a920542fd 100644 --- a/C/depth_bound.c +++ b/C/depth_bound.c @@ -22,7 +22,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #ifdef DEPTH_LIMIT diff --git a/C/eval.c b/C/eval.c index b4c08d13d..a16a4916b 100644 --- a/C/eval.c +++ b/C/eval.c @@ -31,7 +31,7 @@ static char SccsId[] = "%W% %G%"; #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_STDARG_H #include #endif diff --git a/C/exo.c b/C/exo.c index 9bbe6ad82..eb4354ee7 100755 --- a/C/exo.c +++ b/C/exo.c @@ -21,7 +21,7 @@ #include "Yap.h" #include "clause.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #ifdef YAPOR #include "or.macros.h" diff --git a/C/exo_udi.c b/C/exo_udi.c index 741277e45..90a9cf382 100755 --- a/C/exo_udi.c +++ b/C/exo_udi.c @@ -20,7 +20,7 @@ #include "Yap.h" #include "clause.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #include "attvar.h" #ifdef YAPOR diff --git a/C/flags.c b/C/flags.c index fa1b553e6..0e62684ee 100644 --- a/C/flags.c +++ b/C/flags.c @@ -60,7 +60,7 @@ static Int current_prolog_flag(USES_REGS1); static Int set_prolog_flag(USES_REGS1); #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #define YAP_FLAG(ID, NAME, WRITABLE, DEF, INIT, HELPER) \ diff --git a/C/gmp_support.c b/C/gmp_support.c index 167802cb1..a1f7e506f 100644 --- a/C/gmp_support.c +++ b/C/gmp_support.c @@ -18,7 +18,7 @@ #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_STRING_H #include #endif diff --git a/C/grow.c b/C/grow.c index 13e30ad11..cbd532665 100755 --- a/C/grow.c +++ b/C/grow.c @@ -20,7 +20,7 @@ #include "yapio.h" #include "alloc.h" #include "sshift.h" -#include "compile.h" +#include "YapCompile.h" #include "attvar.h" #include "cut_c.h" #if HAVE_STRING_H diff --git a/C/index.c b/C/index.c index 7722ab2f3..6fd571344 100755 --- a/C/index.c +++ b/C/index.c @@ -634,7 +634,7 @@ type_of_verb(rest,passive). */ #include "absmi.h" -#include "compile.h" +#include "YapCompile.h" #if DEBUG #include "yapio.h" #endif diff --git a/C/mavar.c b/C/mavar.c index 3ce613ba8..135fff36e 100644 --- a/C/mavar.c +++ b/C/mavar.c @@ -48,7 +48,7 @@ deterministic computations. #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" static Int p_setarg( USES_REGS1 ); static Int p_create_mutable( USES_REGS1 ); diff --git a/C/parser.c b/C/parser.c index e4001d273..fde6b32e2 100755 --- a/C/parser.c +++ b/C/parser.c @@ -141,7 +141,7 @@ dot with single quotes. #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" /* stuff we want to use in standard YAP code */ #include "iopreds.h" diff --git a/C/range.c b/C/range.c index 378621347..71c0efd94 100644 --- a/C/range.c +++ b/C/range.c @@ -21,7 +21,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" static Int p_in_range( USES_REGS1 ) { diff --git a/C/scanner.c b/C/scanner.c index 122c35f82..0b3b2570c 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -407,7 +407,7 @@ writing, writing a BOM can be requested using the option #include "YapHeap.h" #include "Yatom.h" #include "alloc.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" /* stuff we want to use in standard YAP code */ #include "YapText.h" diff --git a/C/signals.c b/C/signals.c index cdc3f36cd..b2684b519 100755 --- a/C/signals.c +++ b/C/signals.c @@ -30,7 +30,7 @@ static char SccsId[] = "%W% %G%"; #endif #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #ifdef TABLING #include "tab.macros.h" diff --git a/C/stack.c b/C/stack.c index e8a6ec09e..c1bb25b7a 100644 --- a/C/stack.c +++ b/C/stack.c @@ -30,7 +30,7 @@ #include "Yap.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #include "iopreds.h" #include "tracer.h" #include "yapio.h" diff --git a/C/stackinfo.c b/C/stackinfo.c index 10a7c7ce6..b61621b4b 100644 --- a/C/stackinfo.c +++ b/C/stackinfo.c @@ -31,7 +31,7 @@ #include "Yap.h" #include "clause.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #ifdef YAPOR #include "or.macros.h" diff --git a/C/stdpreds.c b/C/stdpreds.c index e62665634..d019f7821 100755 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -37,7 +37,7 @@ static char SccsId[] = "%W% %G%"; #include "Foreign.h" #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #ifdef TABLING #include "tab.macros.h" diff --git a/C/text.c b/C/text.c index 648ca6c2a..7ffd2eba8 100644 --- a/C/text.c +++ b/C/text.c @@ -16,10 +16,10 @@ *************************************************************************/ #include "Yap.h" +#include "YapEval.h" #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" #include "yapio.h" #include diff --git a/C/threads.c b/C/threads.c index f875530f1..96f51175e 100644 --- a/C/threads.c +++ b/C/threads.c @@ -26,7 +26,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #include "blobs.h" #include diff --git a/os/alias.c b/os/alias.c index 267e488dc..cd70f62fd 100644 --- a/os/alias.c +++ b/os/alias.c @@ -61,7 +61,7 @@ static char SccsId[] = "%W% %G%"; #include "Yatom.h" #include "YapHeap.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "YapText.h" #include #if HAVE_STDARG_H diff --git a/os/chartypes.c b/os/chartypes.c index f7019b3b9..1e61250fc 100644 --- a/os/chartypes.c +++ b/os/chartypes.c @@ -74,7 +74,7 @@ static char SccsId[] = "%W% %G%"; #define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR) #endif #endif -#include "eval.h" +#include "YapEval.h" #include "iopreds.h" static Int p_change_type_of_char(USES_REGS1); diff --git a/os/format.c b/os/format.c index 6e5517971..105faab12 100644 --- a/os/format.c +++ b/os/format.c @@ -263,7 +263,7 @@ output is directed to the stream used by format/2. #endif #endif -#include "eval.h" +#include "YapEval.h" #include "iopreds.h" #include "format.h" diff --git a/os/iopreds.c b/os/iopreds.c index 316c7b99d..7ef1e1c18 100644 --- a/os/iopreds.c +++ b/os/iopreds.c @@ -36,7 +36,7 @@ static char SccsId[] = "%W% %G%"; #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #include #if HAVE_UNISTD_H diff --git a/os/streams.c b/os/streams.c index bfb356f05..3d31b4bf7 100644 --- a/os/streams.c +++ b/os/streams.c @@ -32,7 +32,7 @@ static char SccsId[] = "%W% %G%"; #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #include #if HAVE_STDARG_H diff --git a/os/sysbits.c b/os/sysbits.c index c5a8ee9c0..8a2ffcac3 100644 --- a/os/sysbits.c +++ b/os/sysbits.c @@ -65,7 +65,7 @@ void Yap_WinError(char *yap_error) { /* Error, we could not read time */ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - msg, 256, NULL); + msg, 255, NULL); Yap_Error(SYSTEM_ERROR_OPERATING_SYSTEM, TermNil, "%s at %s", msg, yap_error); } #endif /* __WINDOWS__ */ @@ -81,7 +81,7 @@ static bool is_directory(const char *FileName) { if ((vfs = vfs_owner(FileName))) { return vfs->isdir(vfs, FileName); } -#ifdef __WINDOWS__ +#ifdef _WIN32 DWORD dwAtts = GetFileAttributes(FileName); if (dwAtts == INVALID_FILE_ATTRIBUTES) return false; @@ -952,15 +952,15 @@ static bool initSysPath(Term tlib, Term tcommons, bool dir_done, { char *dir; if ((dir = Yap_RegistryGetString("library")) && is_directory(dir)) { + dir_done = true; if (!Yap_unify(tlib, MkAtomTerm(Yap_LookupAtom(dir)))) return FALSE; } - dir_done = true; if ((dir = Yap_RegistryGetString("prolog_commons")) && is_directory(dir)) { if (!Yap_unify(tcommons, MkAtomTerm(Yap_LookupAtom(dir)))) return FALSE; + commons_done = true; } - commons_done = true; } if (dir_done && commons_done) return TRUE; @@ -1199,9 +1199,7 @@ const char *Yap_findFile(const char *isource, const char *idef, source = (isource ? isource : idef); } if (source) { - if (source[0] == '/') { - abspath = true; - } + abspath = Yap_IsAbsolutePath(source); } if (!abspath && !root && ftype == YAP_BOOT_PL) { root = YAP_PL_SRCDIR; @@ -1251,7 +1249,7 @@ const char *Yap_findFile(const char *isource, const char *idef, break; case 4: // WIN stuff: registry -#if __WINDOWS__ +#if __WINDOWS if (in_lib) { source = (ftype == YAP_PL || ftype == YAP_QLY ? "library" : "startup"); source = Yap_RegistryGetString(source); diff --git a/os/sysbits.h b/os/sysbits.h index f1bbe6307..8253b1a73 100644 --- a/os/sysbits.h +++ b/os/sysbits.h @@ -25,7 +25,7 @@ #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" // Win32 InputOutput Support diff --git a/os/writeterm.c b/os/writeterm.c index 16f943073..0c385c79a 100644 --- a/os/writeterm.c +++ b/os/writeterm.c @@ -28,7 +28,7 @@ static char SccsId[] = "%W% %G%"; #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #include #if HAVE_STDARG_H