X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Ffile-cookie.cc;h=762acb1c065d210f92bc3ba0bf1c1087810f3a6c;hb=b872748c6aa8bb721ced458691b38ac2fac5dfc8;hp=39e76e35169710ee13c616f9b38d3d3c6811992e;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/flower/file-cookie.cc b/flower/file-cookie.cc index 39e76e3516..762acb1c06 100644 --- a/flower/file-cookie.cc +++ b/flower/file-cookie.cc @@ -23,14 +23,14 @@ extern "C" { return (FILE *) cookie; } - int + ssize_t lily_cookie_fclose (void *file) { assert (is_memory_stream (file)); return Memory_out_stream::cleaner (file); } - int + ssize_t lily_cookie_fprintf (void *file, char const *format, ...) { assert (is_memory_stream (file)); @@ -39,13 +39,13 @@ extern "C" { static char buf[65536]; int i = vsnprintf (buf, sizeof (buf), format, ap); - if (i == -1 || (unsigned) i > sizeof (buf)) + if (i < 0 || (unsigned) i > sizeof (buf)) assert (false); va_end (ap); - return Memory_out_stream::writer (file, buf, i); + return Memory_out_stream::writer (file, buf, (unsigned)i); } - int + ssize_t lily_cookie_putc (int c, void *file) { assert (is_memory_stream (file));