From 015c888af6ef906dd299369486ff1123c912ba8f Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 27 Jun 2015 02:59:10 +0100 Subject: [PATCH] stream fixes --- octa/stream.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/octa/stream.h b/octa/stream.h index 2990602..b87e0ee 100644 --- a/octa/stream.h +++ b/octa/stream.h @@ -52,8 +52,8 @@ struct Stream { virtual bool flush() { return true; } - virtual octa::Size read(char *, octa::Size) { return 0; } - virtual octa::Size write(const char *, octa::Size) { return 0; } + virtual octa::Size read(void *, octa::Size) { return 0; } + virtual octa::Size write(const void *, octa::Size) { return 0; } template StreamRange iter(); @@ -63,6 +63,7 @@ template struct StreamRange: InputRange< Stream, octa::InputRangeTag, T, T, octa::Size, StreamOffset > { + StreamRange(): p_stream() {} StreamRange(Stream &s): p_stream(&s) {} StreamRange(const StreamRange &r): p_stream(r.p_stream) {} @@ -143,11 +144,11 @@ struct FileStream: Stream { bool flush() { return !fflush(p_f); } - octa::Size read(char *buf, octa::Size count) { + octa::Size read(void *buf, octa::Size count) { return fread(buf, 1, count, p_f); } - octa::Size write(const char *buf, octa::Size count) { + octa::Size write(const void *buf, octa::Size count) { return fwrite(buf, 1, count, p_f); }