medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 69303fc7da6d9efedc119b35437335e1f84bcbe9
parent d0f8e7ece417864f414a0d44c875a9f4da7058f7
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Wed Dec 28 21:47:26 +0200

ReadStream takes const void * + len, WriteStream takes void * + len

Diffstat:
stream.h | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/stream.h b/stream.h @@ -8,15 +8,15 @@ struct ReadStream; struct ReadStreamCheckpoint { const ReadStream * rs; - char * cursor; + const char * cursor; bool ok; bool used; }; struct ReadStream { - ReadStream( char * buf, size_t n ) { - cursor = buf; - one_past_end = buf + n; + ReadStream( const void * buf, size_t n ) { + cursor = ( const char * ) buf; + one_past_end = cursor + n; ok = true; } @@ -45,16 +45,16 @@ struct ReadStream { cp->used = true; } - char * cursor; - char * one_past_end; + const char * cursor; + const char * one_past_end; bool ok; }; struct WriteStream { - WriteStream( char * buf, size_t n ) { - start = buf; - cursor = buf; - one_past_end = buf + n; + WriteStream( void * buf, size_t n ) { + start = ( char * ) buf; + cursor = start; + one_past_end = start + n; ok = true; }