]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-cookie.cc
Doc-es: various updates.
[lilypond.git] / flower / file-cookie.cc
index bedb100a00b26b4ac246e7948dd4c3166795f8f2..762acb1c065d210f92bc3ba0bf1c1087810f3a6c 100644 (file)
@@ -16,21 +16,21 @@ extern "C" {
 
   void *
   lily_fopencookie (void *cookie,
-                   char const * /* modes */,
-                   lily_cookie_io_functions_t /* io_funcs */)
+                    char const * /* modes */,
+                    lily_cookie_io_functions_t /* io_funcs */)
   {
     assert (is_memory_stream (cookie));
     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));