From: Pavel Charvat Date: Mon, 12 Feb 2018 17:33:27 +0000 (+0100) Subject: Main blockio: Added const keyword to block_io_write(). X-Git-Tag: v6.5.9~3 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=4e0ef3a68c8dab5ef71fe66ce4bd3dc555cfda82;p=libucw.git Main blockio: Added const keyword to block_io_write(). --- diff --git a/ucw/main-block.c b/ucw/main-block.c index 9efd8a27..6093984a 100644 --- a/ucw/main-block.c +++ b/ucw/main-block.c @@ -114,7 +114,7 @@ block_io_read(struct main_block_io *bio, void *buf, uint len) } void -block_io_write(struct main_block_io *bio, void *buf, uint len) +block_io_write(struct main_block_io *bio, const void *buf, uint len) { ASSERT(bio->file.n.next); if (len) diff --git a/ucw/mainloop.h b/ucw/mainloop.h index 03ebec6e..98722e59 100644 --- a/ucw/mainloop.h +++ b/ucw/mainloop.h @@ -422,7 +422,7 @@ struct main_block_io { struct main_file file; byte *rbuf; /* Read/write pointers for use by file_read/write */ uint rpos, rlen; - byte *wbuf; + const byte *wbuf; uint wpos, wlen; void (*read_done)(struct main_block_io *bio); /* [*] Called when file_read is finished; rpos < rlen if EOF */ void (*write_done)(struct main_block_io *bio); /* [*] Called when file_write is finished */ @@ -475,7 +475,7 @@ void block_io_read(struct main_block_io *bio, void *buf, uint len); * If you call it with zero @len, it will cancel the previous write, but note * that some data may already be written. **/ -void block_io_write(struct main_block_io *bio, void *buf, uint len); +void block_io_write(struct main_block_io *bio, const void *buf, uint len); /** * Sets a timer for a file @bio. If the timer is not overwritten or disabled