]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-cookie.cc
Doc: Included/compile.itexi - CG 4.2 - Updated notes on reqs for compiling
[lilypond.git] / flower / file-cookie.cc
index 8f4c9c4f85be8372c6407808090d7c38bc54a6f1..36871d705d5e56f78aa3017c2e382301ac80875a 100644 (file)
@@ -1,13 +1,12 @@
 
 #include <cassert>
 #include <cstdio>
-using namespace std;
 
 #include "memory-stream.hh"
 
 extern "C" {
 
-  static bool
+  bool
   is_memory_stream (void *foo)
   {
     Memory_out_stream *cookie = (Memory_out_stream *) foo;
@@ -15,24 +14,22 @@ extern "C" {
   }
 
   void *
-  lily_fopencookie (void *cookie, char const *modes,
-                   lily_cookie_io_functions_t io_funcs)
+  lily_fopencookie (void *cookie,
+                    char const * /* modes */,
+                    lily_cookie_io_functions_t /* io_funcs */)
   {
-    (void) cookie;
-    (void) modes;
-    (void) 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));
@@ -41,13 +38,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));