From 319207d3c6991d8cefb670cee54e47dfaa39aec9 Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 16 Dec 2004 06:08:57 +0000 Subject: [PATCH] small bug fixes git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1213 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- library/rbtrees.yap | 13 ++++++------- library/regex/regcomp.c | 2 +- library/regex/regexec.c | 2 +- library/yap2swi/yap2swi.h | 6 +----- pl/boot.yap | 8 +++++++- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/library/rbtrees.yap b/library/rbtrees.yap index 1f36779f0..4879e2b6d 100644 --- a/library/rbtrees.yap +++ b/library/rbtrees.yap @@ -24,22 +24,22 @@ new(black([],[],[],[])). new(K,V,black(Nil,K,V,Nil)) :- Nil = black([],[],[],[]). -lookup(Key, Val, black([],_,_,[])) :- !, fail. +lookup(_, _, black([],_,_,[])) :- !, fail. lookup(Key, Val, Tree) :- arg(2,Tree,KA), compare(Cmp,KA,Key), lookup(Cmp,Key,Val,Tree). -lookup(<, K, V, Tree) :- +lookup(>, K, V, Tree) :- arg(1,Tree,NTree), lookup(K, V, NTree). -lookup(>, K, V, Tree) :- +lookup(<, K, V, Tree) :- arg(4,Tree,NTree), lookup(K, V, NTree). -lookup(=, K, V, Tree) :- +lookup(=, _, V, Tree) :- arg(3,Tree,V). -lookupall(Key, Val, black([],_,_,[])) :- !, fail. +lookupall(_, _, black([],_,_,[])) :- !, fail. lookupall(Key, Val, Tree) :- arg(2,Tree,KA), compare(Cmp,KA,Key), @@ -48,7 +48,7 @@ lookupall(Key, Val, Tree) :- lookupall(>, K, V, Tree) :- arg(4,Tree,NTree), lookupall(K, V, NTree). -lookupall(=, K, V, Tree) :- +lookupall(=, _, V, Tree) :- arg(3,Tree,V). lookupall(=, K, V, Tree) :- arg(1,Tree,NTree), @@ -440,7 +440,6 @@ bclean_tree(X1,X,T0,TF) :- X2 is X1-1, ( rbtree(TI) -> true ; abort), bclean_tree(X2,X,TI,TF). -tree(X2,X,TI,TF). diff --git a/library/regex/regcomp.c b/library/regex/regcomp.c index 0bc27071c..7fbcbe9c5 100644 --- a/library/regex/regcomp.c +++ b/library/regex/regcomp.c @@ -51,7 +51,7 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94"; #if HAVE_STRING_H #include #endif -#if HAVE_CTYPE_H && !defined(_WIN32) && !defined(__CYGWIN__) +#if HAVE_CTYPE_H #include #endif #if HAVE_LIMITS_H diff --git a/library/regex/regexec.c b/library/regex/regexec.c index 58636589a..a266a4d2b 100644 --- a/library/regex/regexec.c +++ b/library/regex/regexec.c @@ -55,7 +55,7 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94"; #endif #include #include -#if HAVE_CTYPE_H && !defined(_WIN32) && !defined(__CYGWIN__) +#if HAVE_CTYPE_H #include #endif #if HAVE_STRING_H diff --git a/library/yap2swi/yap2swi.h b/library/yap2swi/yap2swi.h index ea50a4abc..45ad86df7 100644 --- a/library/yap2swi/yap2swi.h +++ b/library/yap2swi/yap2swi.h @@ -228,12 +228,8 @@ extern X_API int PL_set_engine(PL_engine_t,PL_engine_t *); extern X_API int PL_get_string_chars(term_t, char **, int *); extern X_API int PL_action(int,...); - - extern X_API int Sprintf(char *,...); extern X_API int Sdprintf(char *,...); - - - +int swi_install(void); diff --git a/pl/boot.yap b/pl/boot.yap index e5905c851..c517a92a7 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -738,7 +738,13 @@ not(G) :- \+ '$execute'(G). S \= M, % can't try importing from the module itself. !, '$exit_undefp', - '$execute'(S:G). + ( + '$meta_expansion'(S,M,G,G1,[]) + -> + '$execute'(S:G1) + ; + '$execute'(S:G) + ). '$do_undefp'(G,M) :- '$is_expand_goal_or_meta_predicate'(G,M), '$system_catch'(goal_expansion(G, M, NG), user, _, fail), !,