From 4e0ef3a68c8dab5ef71fe66ce4bd3dc555cfda82 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Mon, 12 Feb 2018 18:33:27 +0100 Subject: [PATCH] Main blockio: Added const keyword to block_io_write(). --- ucw/main-block.c | 2 +- ucw/mainloop.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.2