From e8ed525e3b882b2d645daff77bf14599ec54eda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 8 Oct 2015 02:12:06 +0100 Subject: [PATCH] we usually are not sure how best to pass encoding: pass by ref --- C/c_interface.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index 2083542c5..88073f215 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1895,7 +1895,7 @@ YAP_ReadBuffer(const char *s, Term *tp) BACKUP_H(); LOCAL_ErrorMessage=NULL; - while (!(t = Yap_StringToTerm(s, strlen(s)+1, LOCAL_encoding, 1200, tp))) { + while (!(t = Yap_StringToTerm(s, strlen(s)+1, &LOCAL_encoding, 1200, tp))) { if (LOCAL_ErrorMessage) { if (!strcmp(LOCAL_ErrorMessage,"Stack Overflow")) { if (!Yap_dogc( 0, NULL PASS_REGS )) { @@ -2745,7 +2745,7 @@ YAP_WriteBuffer(Term t, char *buf, size_t sze, int flags) char *b; BACKUP_MACHINE_REGS(); - if ((b = Yap_TermToString(t, buf, sze, &length,LOCAL_encoding, flags)) != buf) { + if ((b = Yap_TermToString(t, buf, sze, &length, &LOCAL_encoding, flags)) != buf) { if (b) free(b); RECOVER_MACHINE_REGS(); return FALSE; @@ -2755,12 +2755,13 @@ YAP_WriteBuffer(Term t, char *buf, size_t sze, int flags) } X_API char * -YAP_WriteDynamicBuffer(Term t, char *buf, size_t sze, size_t *lengthp, int *encp, int flags) +YAP_WriteDynamicBuffer(YAP_Term t, char *buf, size_t sze, size_t *lengthp, encoding_t + *encp, int flags) { char *b; BACKUP_MACHINE_REGS(); - b = Yap_TermToString(t, buf, sze, lengthp, *encp, flags); + b = Yap_TermToString(t, buf, sze, lengthp, encp, flags); RECOVER_MACHINE_REGS(); return b; }