]> mj.ucw.cz Git - libucw.git/commitdiff
Main blockio: Added const keyword to block_io_write().
authorPavel Charvat <pchar@ucw.cz>
Mon, 12 Feb 2018 17:33:27 +0000 (18:33 +0100)
committerPavel Charvat <pchar@ucw.cz>
Mon, 12 Feb 2018 17:33:27 +0000 (18:33 +0100)
ucw/main-block.c
ucw/mainloop.h

index 9efd8a27549a7e8d0faced887421f168a95f2f55..6093984aaa9665cf3c089ae63968c87814bd56d4 100644 (file)
@@ -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)
index 03ebec6ef0b7b4f7e9cecb4ee280264640a69425..98722e599459c2a4baa327d88b1820e776846f33 100644 (file)
@@ -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