]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/memory-stream.cc
Release: bump Welcome versions.
[lilypond.git] / flower / memory-stream.cc
index 9d4c747ef5a41e231a4992b3ebf230c71304bdfd..511657f5fcc733d2b15d2846155f10cbdd88477f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -93,7 +93,7 @@ Memory_out_stream::writer (void *cookie,
 {
   Memory_out_stream *stream = (Memory_out_stream *) cookie;
 
-  ssize_t newsize = stream->size_ + size;
+  ssize_t newsize = stream->size_ + (ssize_t) size;
 
   bool change = false;
   while (newsize > stream->buffer_blocks_ * block_size_)
@@ -105,12 +105,12 @@ Memory_out_stream::writer (void *cookie,
 
   if (change)
     stream->buffer_ = (char *) realloc (stream->buffer_,
-                                        stream->buffer_blocks_ * block_size_);
+                                        (size_t) (stream->buffer_blocks_ * block_size_));
 
   memcpy (stream->buffer_ + stream->size_, buffer, size);
   stream->size_ = newsize;
 
-  return size;
+  return (ssize_t) size;
 }
 
 ssize_t