diff --git a/os/encoding.h b/os/encoding.h index a52de596d..9364593f2 100644 --- a/os/encoding.h +++ b/os/encoding.h @@ -93,6 +93,7 @@ static inline const char *enc_name(encoding_t enc) case ENC_UTF16_LE: return "utf16_le"; case ENC_ISO_UTF32_BE: return "utf32_be"; case ENC_ISO_UTF32_LE: return "utf32_le"; + default: return "thanks for watching!!"; } } diff --git a/os/readutil.c b/os/readutil.c index c107d06ee..08d0ee25b 100644 --- a/os/readutil.c +++ b/os/readutil.c @@ -156,14 +156,14 @@ read_stream_to_terms(USES_REGS1) { int sno = Yap_CheckStream (ARG1, Input_Stream_f, "read_line_to_codes/2"); Term t, hd; - yhandle_t tails, outs, news; + yhandle_t tails, news; if (sno < 0) return FALSE; t = AbsPair(HR); RESET_VARIABLE(HR); - outs = Yap_InitSlot( (CELL)(HR) ); + Yap_InitSlot( (CELL)(HR) ); tails = Yap_InitSlot( (CELL)(HR) ); news = Yap_InitSlot( (CELL)(HR) ); HR++; diff --git a/os/streams.c b/os/streams.c index d395984cb..8fb06371e 100644 --- a/os/streams.c +++ b/os/streams.c @@ -215,7 +215,7 @@ has_reposition(int sno, char *Yap_guessFileName(int f, int sno, char *nameb, size_t max) { #if __linux__ char path[256]; - if (snprintf(path, 255, "/proc/self/fd/~d", f) && readlink(path, nameb, max)) + if (snprintf(path, 255, "/proc/self/fd/%d", f) && readlink(path, nameb, max)) return nameb; #elif __APPLE__ if (fcntl(f, F_GETPATH, nameb) != -1) { @@ -720,7 +720,7 @@ static bool do_set_stream(int sno, GLOBAL_Stream[sno].status |= Eof_Error_Stream_f; GLOBAL_Stream[sno].status &= ~Reset_Eof_Stream_f; } else if (t2 == TermReset) { - GLOBAL_Stream[sno].status |= GLOBAL_Stream[sno].status &= + GLOBAL_Stream[sno].status &= ~Eof_Error_Stream_f; GLOBAL_Stream[sno].status |= Reset_Eof_Stream_f; } else if (t2 == TermEOfCode) { @@ -754,8 +754,7 @@ static bool do_set_stream(int sno, GLOBAL_Stream[sno].status |= RepError_Xml_f; GLOBAL_Stream[sno].status &= ~RepError_Prolog_f; } else if (t2 == TermError) { - GLOBAL_Stream[sno].status |= GLOBAL_Stream[sno].status &= - ~RepError_Xml_f; + GLOBAL_Stream[sno].status &= ~RepError_Xml_f; GLOBAL_Stream[sno].status |= RepError_Prolog_f; } else if (t2 == TermEOfCode) { GLOBAL_Stream[sno].status &= ~RepError_Xml_f; diff --git a/os/sysbits.c b/os/sysbits.c index 767a198a2..952c955f4 100644 --- a/os/sysbits.c +++ b/os/sysbits.c @@ -103,6 +103,9 @@ static char SccsId[] = "%W% %G%"; #if HAVE_LIBGEN_H #include #endif +#if HAVE_STDARG_H +#include +#endif #if HAVE_READLINE_READLINE_H #include #endif