indenting and fix bad usage of recover slots.

This commit is contained in:
Vítor Santos Costa 2014-05-14 10:00:40 +01:00
parent 24b90ae6bd
commit 503b2b93f9

View File

@ -1,19 +1,19 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: write.c *
* Last rev: *
* mods: *
* comments: Writing a Prolog Term *
* *
*************************************************************************/
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: write.c *
* Last rev: *
* mods: *
* comments: Writing a Prolog Term *
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
#endif
@ -98,7 +98,7 @@ static void writeTerm(Term, int, int, int, struct write_globs *, struct rewind_t
/*
protect bracket from merging with previoous character.
avoid stuff like not (2,3) -> not(2,3) or
*/
*/
static void
wropen_bracket(struct write_globs *wglb, int protect)
{
@ -237,7 +237,7 @@ write_mpint(MP_INT *big, struct write_globs *wglb) {
}
#endif
/* writes a bignum */
/* writes a bignum */
static void
writebig(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, struct rewind_term *rwt)
{
@ -729,7 +729,7 @@ restore_from_write(struct rewind_term *rwt, struct write_globs *wglb)
if (wglb->Keep_terms) {
ptr = (CELL*)Yap_GetPtrFromSlot(rwt->u_sd.s.ptr PASS_REGS);
Yap_RecoverSlots(2 PASS_REGS);
//Yap_RecoverSlots(2 PASS_REGS);
} else {
ptr = rwt->u_sd.d.ptr;
}
@ -865,7 +865,7 @@ write_list(Term t, int direction, int depth, struct write_globs *wglb, struct re
writeTerm(from_pointer(RepPair(t)+1, &nrwt, wglb), 999, depth, FALSE, wglb, &nrwt);
restore_from_write(&nrwt, wglb);
}
}
}
static void
@ -1211,9 +1211,9 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
void
Yap_plwrite(Term t, void *mywrite, int max_depth, int flags, int priority)
/* term to be written */
/* consumer */
/* write options */
/* term to be written */
/* consumer */
/* write options */
{
struct write_globs wglb;
struct rewind_term rwt;