VFile write should use const void*
Jeffrey Pfau jeffrey@endrift.com
Tue, 14 Oct 2014 03:08:39 -0700
3 files changed,
5 insertions(+),
5 deletions(-)
M
src/util/vfs.c
→
src/util/vfs.c
@@ -24,7 +24,7 @@ static bool _vfdClose(struct VFile* vf);
static off_t _vfdSeek(struct VFile* vf, off_t offset, int whence); static ssize_t _vfdRead(struct VFile* vf, void* buffer, size_t size); static ssize_t _vfdReadline(struct VFile* vf, char* buffer, size_t size); -static ssize_t _vfdWrite(struct VFile* vf, void* buffer, size_t size); +static ssize_t _vfdWrite(struct VFile* vf, const void* buffer, size_t size); static void* _vfdMap(struct VFile* vf, size_t size, int flags); static void _vfdUnmap(struct VFile* vf, void* memory, size_t size); static void _vfdTruncate(struct VFile* vf, size_t size);@@ -96,7 +96,7 @@ }
return buffer[bytesRead] = '\0'; } -ssize_t _vfdWrite(struct VFile* vf, void* buffer, size_t size) { +ssize_t _vfdWrite(struct VFile* vf, const void* buffer, size_t size) { struct VFileFD* vfd = (struct VFileFD*) vf; return write(vfd->fd, buffer, size); }
M
src/util/vfs.h
→
src/util/vfs.h
@@ -13,7 +13,7 @@ bool (*close)(struct VFile* vf);
off_t (*seek)(struct VFile* vf, off_t offset, int whence); ssize_t (*read)(struct VFile* vf, void* buffer, size_t size); ssize_t (*readline)(struct VFile* vf, char* buffer, size_t size); - ssize_t (*write)(struct VFile* vf, void* buffer, size_t size); + ssize_t (*write)(struct VFile* vf, const void* buffer, size_t size); void* (*map)(struct VFile* vf, size_t size, int flags); void (*unmap)(struct VFile* vf, void* memory, size_t size); void (*truncate)(struct VFile* vf, size_t size);
M
src/util/vfs/vfs-zip.c
→
src/util/vfs/vfs-zip.c
@@ -34,7 +34,7 @@ static bool _vfzClose(struct VFile* vf);
static off_t _vfzSeek(struct VFile* vf, off_t offset, int whence); static ssize_t _vfzRead(struct VFile* vf, void* buffer, size_t size); static ssize_t _vfzReadline(struct VFile* vf, char* buffer, size_t size); -static ssize_t _vfzWrite(struct VFile* vf, void* buffer, size_t size); +static ssize_t _vfzWrite(struct VFile* vf, const void* buffer, size_t size); static void* _vfzMap(struct VFile* vf, size_t size, int flags); static void _vfzUnmap(struct VFile* vf, void* memory, size_t size); static void _vfzTruncate(struct VFile* vf, size_t size);@@ -194,7 +194,7 @@ }
return buffer[bytesRead] = '\0'; } -ssize_t _vfzWrite(struct VFile* vf, void* buffer, size_t size) { +ssize_t _vfzWrite(struct VFile* vf, const void* buffer, size_t size) { // TODO UNUSED(vf); UNUSED(buffer);