diff --git a/C/cdmgr.c b/C/cdmgr.c index 34de06463..3ffb16e7d 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -2065,7 +2065,7 @@ Atom Yap_ConsultingFile(USES_REGS1) { if (LOCAL_consult_level == 0) { return (AtomUser); } else { - return (Yap_ULookupAtom(LOCAL_ConsultBase[2].f_name)); + return LOCAL_ConsultBase[2].f_name; } } diff --git a/C/flags.c b/C/flags.c index c5ce98ce4..1a3f588b0 100644 --- a/C/flags.c +++ b/C/flags.c @@ -468,7 +468,7 @@ static bool typein(Term inp) { return true; } - static bool list_atom( Term inp ) { +x static bool list_atom( Term inp ) { if (IsVarTerm(inp)) { Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag in \"...\""); return false; diff --git a/H/TermExt.h b/H/TermExt.h index bcbaf0e5b..cd2487948 100755 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -345,7 +345,7 @@ INLINE_ONLY Term __MkCharPTerm(char *s USES_REGS); INLINE_ONLY Term __MkCharPTerm(char *s USES_REGS) { Term t = AbsAppl(HR); size_t sz; - if ((s[0] == '\0')) { + if (s[0] == '\0') { sz = sizeof(CELL); HR[0] = (CELL)FunctorString; HR[1] = (CELL)sz; diff --git a/H/YapGFlagInfo.h b/H/YapGFlagInfo.h index 1997267e8..4633ab29a 100644 --- a/H/YapGFlagInfo.h +++ b/H/YapGFlagInfo.h @@ -98,7 +98,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0 It is `true` by default, but it is disabled by packages like CLP(BN) and ProbLog. */ - YAP_FLAG(BACK_QUOTES_FLAG, "back_quotes", true, isatom, "true", NULL), + YAP_FLAG(BACK_QUOTES_FLAG, "back_quotes", true, isatom, "true", bqs), /**> If _Value_ is unbound, tell whether a back quoted list of characters token is converted to a list of atoms, `chars`, to a list of integers, @@ -155,7 +155,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0 */ YAP_FLAG(DEBUGGER_PRINT_OPTIONS_FLAG, "debugger_print_options", true, list_option, - "[quoted(true),numbervars(true),portrayed(true),max_depth(10)]", + "[quoted(true),numbervars(true),portrayed(true),max_depth(10)]", NULL), YAP_FLAG(DEBUGGER_SHOW_CONTEXT_FLAG, "debugger_show_context", true, booleanFlag, "false", NULL), @@ -180,7 +180,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0 booleanFlag, "false", NULL), /**< If `off` (default) consider the character `$` a control character, if - `on` consider `$` a lower case character. +vxu `on` consider `$` a lower case character. */ YAP_FLAG(DOUBLE_QUOTES_FLAG, "double_quotes", true, isatom, "codes", dqs), /**< iso @@ -476,9 +476,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0 */ YAP_FLAG(THREADS_FLAG, "threads", false, ro, "MAX_THREADS", NULL), YAP_FLAG(TIMEZONE_FLAG, "timezone", false, ro, "18000", NULL), - YAP_FLAG(TOPLEVEL_PRINT_ANON_FLAG, "toplevel_print_anon", true, booleanFlag, - "true", NULL), - YAP_FLAG(TOPLEVEL_HOOK_FLAG, "toplevel_hook", true, + YAP_FLAG(TOPLEVEL_HOOK_FLAG, "toplevel_hook", true, booleanFlag, "true", NULL), /**< `toplevel_hook ` @@ -489,6 +487,8 @@ opportunity. Initial value is 10,000. May be changed. A value of 0 backtracked into. */ + YAP_FLAG(TOPLEVEL_PRINT_ANON_FLAG, "toplevel_print_anon", true, booleanFlag, + "true", NULL), YAP_FLAG(TOPLEVEL_PRINT_OPTIONS_FLAG, "toplevel_print_options", true, list_option, "[quoted(true),numbervars(true),portrayed(true)]", NULL), diff --git a/H/clause.h b/H/clause.h index 12760351b..1b2d55903 100644 --- a/H/clause.h +++ b/H/clause.h @@ -24,7 +24,7 @@ /* consulting files */ typedef union CONSULT_OBJ { - const unsigned char *f_name; + Atom f_name; int mode; Prop p; UInt c; diff --git a/os/chartypes.c b/os/chartypes.c index cab263e7f..973f09635 100644 --- a/os/chartypes.c +++ b/os/chartypes.c @@ -82,7 +82,6 @@ Term Yap_StringToNumberTerm(const char *s, encoding_t *encp, bool error_on) { CACHE_REGS int sno; int i = push_text_stack(); -char buf [16]; Atom nat = Yap_LookupAtom(Yap_StrPrefix(s, 16)); sno = Yap_open_buf_read_stream(s, strlen(s), encp, MEM_BUF_USER, nat, MkAtomTerm(Yap_LookupAtom("eval"))); if (sno < 0) diff --git a/os/fmem.c b/os/fmem.c index b5bed15d1..0257f0c6c 100644 --- a/os/fmem.c +++ b/os/fmem.c @@ -163,7 +163,7 @@ int Yap_open_buf_read_stream(const char *buf, size_t nchars, f = st->file = fmemopen((void *)buf, nchars, "r"); st->vfs = NULL; flags = Input_Stream_f | InMemory_Stream_f | Seekable_Stream_f; - Yap_initStream(sno, f, fname, "r", uname, encoding, flags, NULL); + Yap_initStream(sno, f, RepAtom(fname)->StrOfAE, "r", uname, encoding, flags, NULL); // like any file stream. Yap_DefaultStreamOps(st); UNLOCK(st->streamlock); diff --git a/os/readterm.c b/os/readterm.c index 8c199748f..83ff7b055 100644 --- a/os/readterm.c +++ b/os/readterm.c @@ -1396,7 +1396,7 @@ static Int start_mega(USES_REGS1) { Term rval; int sno; encoding_t l = ENC_ISO_UTF8; - sno = Yap_open_buf_read_stream((char *)s, strlen((const char *)s+1), &l, + sno = Yap_open_buf_read_stream((char *)s, strlen(s)+1, &l, MEM_BUF_USER, Yap_LookupAtom(Yap_StrPrefix(s,16)), TermNone ); GLOBAL_Stream[sno].status |= CloseOnException_Stream_f; diff --git a/pl/protect.yap b/pl/protect.yap index 0a21f1bba..23f8a6a8f 100755 --- a/pl/protect.yap +++ b/pl/protect.yap @@ -48,7 +48,6 @@ '$new_system_predicate'(Name,Arity,M), sub_atom(Name,0,1,_, '$'), functor(P,Name,Arity), - writeln(M:P), '$hide_predicate'(P,M), fail. '$protect' :- diff --git a/pl/qly.yap b/pl/qly.yap index ec948ecbe..78433dc28 100755 --- a/pl/qly.yap +++ b/pl/qly.yap @@ -236,6 +236,7 @@ qend_program :- prolog_flag_property(X, [access(read_write)]), atom(X), yap_flag(X, V), +writeln(X:V), X \= gc_margin, % different machines will have different needs, X \= argv, X \= os_argv,