]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/memory-stream.cc
Merge branch 'stable'
[lilypond.git] / flower / memory-stream.cc
index 3d29993486f8651f3a7a86f1c6a68174f7d6d2c1..dbf6fd83f29555605f4fe42fc7ca5c8f77d3a86c 100644 (file)
@@ -3,12 +3,13 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
-#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstring>
+#include <cstdlib>
+using namespace std;
 
 #include "memory-stream.hh"
 
@@ -17,7 +18,7 @@
 */
 const int Memory_out_stream::block_size_ = 1024;
 
-cookie_io_functions_t
+lily_cookie_io_functions_t
 Memory_out_stream::functions_
 = {
   Memory_out_stream::reader,
@@ -40,7 +41,11 @@ Memory_out_stream::Memory_out_stream ()
   size_ = 0;
   buffer_ = 0;
   buffer_blocks_ = 0;
+  file_ = 0;
+
+#if 0
   file_ = fopencookie ((void *) this, "w", functions_);
+#endif
 }
 
 Memory_out_stream::~Memory_out_stream ()
@@ -63,7 +68,7 @@ Memory_out_stream::get_length () const
   return size_;
 }
 
-const char *
+char const *
 Memory_out_stream::get_string () const
 {
   return buffer_;
@@ -71,7 +76,7 @@ Memory_out_stream::get_string () const
 
 ssize_t
 Memory_out_stream::writer (void *cookie,
-                          const char *buffer,
+                          char const *buffer,
                           size_t size)
 {
   Memory_out_stream *stream = (Memory_out_stream *) cookie;
@@ -97,23 +102,19 @@ Memory_out_stream::writer (void *cookie,
 }
 
 ssize_t
-Memory_out_stream::reader (void *cookie,
-                          char *buffer,
-                          size_t size)
+Memory_out_stream::reader (void * /* cookie */,
+                          char * /* buffer */,
+                          size_t /* size */)
 {
-  (void) cookie;
-  (void) buffer;
-  (void) size;
-
   assert (false);
   return 0;
 }
 
 int
-Memory_out_stream::seeker (void *, off64_t *, int whence)
+Memory_out_stream::seeker (void *,
+                          off64_t *,
+                          int)
 {
-  (void) whence;
-
   assert (false);
   return 0;
 }