fix a few variable warnings

fix erase clause to pass a pointer to clause, not code
get rid of Yap4.4 code in Yap_EraseStaticClause


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1278 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2005-04-20 04:02:30 +00:00
parent ca8cdb9b5d
commit 9ebc807dfb
4 changed files with 10 additions and 10 deletions

View File

@ -11,8 +11,11 @@
* File: cdmgr.c *
* comments: Code manager *
* *
* Last rev: $Date: 2005-04-10 04:01:10 $,$Author: vsc $ *
* Last rev: $Date: 2005-04-20 04:02:15 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.155 2005/04/10 04:01:10 vsc
* bug fixes, I hope!
*
* Revision 1.154 2005/03/04 20:30:11 ricroc
* bug fixes for YapTab support
*
@ -1774,7 +1777,7 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
if (pflags & LogUpdatePredFlag) {
tf = MkDBRefTerm((DBRef)ClauseCodeToLogUpdClause(cp));
} else {
tf = Yap_MkStaticRefTerm((StaticClause *)cp);
tf = Yap_MkStaticRefTerm(ClauseCodeToStaticClause(cp));
}
if (*t4ref != TermNil) {
if (!Yap_unify(*t4ref,tf)) {
@ -1841,7 +1844,6 @@ Yap_EraseStaticClause(StaticClause *cl, Term mod) {
} else {
yamop *ncl = cl->ClNext->ClCode;
ap->cs.p_code.FirstClause = ncl;
ncl->opc = Yap_opcode(_try_me);
ap->cs.p_code.TrueCodeOfPred =
ncl;
ap->OpcodeOfPred = ncl->opc;
@ -1858,8 +1860,6 @@ Yap_EraseStaticClause(StaticClause *cl, Term mod) {
ocl->ClNext = cl->ClNext;
if (cl->ClCode == ap->cs.p_code.LastClause) {
ap->cs.p_code.LastClause = ocl->ClCode;
if (ap->cs.p_code.NOfClauses > 1)
ocl->ClCode->opc = Yap_opcode(_trust_me);
}
}
if (ap->cs.p_code.NOfClauses == 1) {

View File

@ -1050,7 +1050,7 @@ InitCodes(void)
Yap_heap_regs->functor_portray = Yap_MkFunctor(AtomPortray, 1);
Yap_heap_regs->functor_query = Yap_MkFunctor(AtomQuery, 1);
Yap_heap_regs->functor_creep = Yap_MkFunctor(AtomCreep, 1);
Yap_heap_regs->functor_static_clause = Yap_MkFunctor (Yap_FullLookupAtom("$startic_clause"), 1);
Yap_heap_regs->functor_static_clause = Yap_MkFunctor (Yap_FullLookupAtom("$static_clause"), 1);
Yap_heap_regs->functor_stream = Yap_MkFunctor (AtomStream, 1);
Yap_heap_regs->functor_stream_pos = Yap_MkFunctor (AtomStreamPos, 3);
Yap_heap_regs->functor_stream_eOS = Yap_MkFunctor (Yap_LookupAtom("end_of_stream"), 1);

View File

@ -124,7 +124,7 @@ get_keys([], []).
get_keys([V|AVars], [K-V|KeysVars]) :-
get_atts(V, [key(K)]), !,
get_keys(AVars, KeysVars).
get_keys([V|AVars], KeysVars) :- % may be non-CLPBN vars.
get_keys([_|AVars], KeysVars) :- % may be non-CLPBN vars.
get_keys(AVars, KeysVars).
merge_same_key([], [], _, []).
@ -228,7 +228,7 @@ bind_clpbn(_, Var, _, _, _, _) :-
use(vel),
check_if_vel_done(Var), !.
bind_clpbn(T, Var, Key0, _, _, _) :-
get_atts(Var, [key(Key0)]), !,
get_atts(Var, [key(Key)]), !,
(
Key = Key0 -> true
;

View File

@ -176,7 +176,7 @@ ord_intersection(>, Head1, Tail1, _, Tail2, Intersection) :-
% is true when Intersection is the ordered representation of Set1
% and Set2, provided that Set1 and Set2 are ordered sets.
ord_intersection(L, [], [], []) :- !.
ord_intersection(_, [], [], []) :- !.
ord_intersection([], L, [], L) :- !.
ord_intersection([Head1|Tail1], [Head2|Tail2], Intersection, Difference) :-
compare(Order, Head1, Head2),
@ -184,7 +184,7 @@ ord_intersection([Head1|Tail1], [Head2|Tail2], Intersection, Difference) :-
ord_intersection(=, Head, Tail1, _, Tail2, [Head|Intersection], Difference) :-
ord_intersection(Tail1, Tail2, Intersection, Difference).
ord_intersection(<, Head1, Tail1, Head2, Tail2, Intersection, Difference) :-
ord_intersection(<, _, Tail1, Head2, Tail2, Intersection, Difference) :-
ord_intersection(Tail1, [Head2|Tail2], Intersection, Difference).
ord_intersection(>, Head1, Tail1, Head2, Tail2, Intersection, [Head2|Difference]) :-
ord_intersection([Head1|Tail1], Tail2, Intersection, Difference).