From 57a176068cc48e942fc8a97d4b3220da68067e86 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 16 Mar 2002 03:53:46 +0000 Subject: [PATCH] const correctness fixes. --- archivers/dir.c | 4 ++-- physfs.c | 6 +++--- physfs.h | 4 ++-- physfs_internal.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/archivers/dir.c b/archivers/dir.c index 2ad9794a..a913a70d 100644 --- a/archivers/dir.c +++ b/archivers/dir.c @@ -18,7 +18,7 @@ static int DIR_read(FileHandle *handle, void *buffer, unsigned int objSize, unsigned int objCount); -static int DIR_write(FileHandle *handle, void *buffer, +static int DIR_write(FileHandle *handle, const void *buffer, unsigned int objSize, unsigned int objCount); static int DIR_eof(FileHandle *handle); static int DIR_tell(FileHandle *handle); @@ -109,7 +109,7 @@ static int DIR_read(FileHandle *handle, void *buffer, } /* DIR_read */ -static int DIR_write(FileHandle *handle, void *buffer, +static int DIR_write(FileHandle *handle, const void *buffer, unsigned int objSize, unsigned int objCount) { FILE *h = (FILE *) (handle->opaque); diff --git a/physfs.c b/physfs.c index 609b31c1..6e2f2067 100644 --- a/physfs.c +++ b/physfs.c @@ -1230,7 +1230,7 @@ int PHYSFS_close(PHYSFS_file *handle) int PHYSFS_read(PHYSFS_file *handle, void *buffer, - unsigned int objSize, unsigned int objCount) + unsigned int objSize, unsigned int objCount) { FileHandle *h = (FileHandle *) handle->opaque; assert(h != NULL); @@ -1240,8 +1240,8 @@ int PHYSFS_read(PHYSFS_file *handle, void *buffer, } /* PHYSFS_read */ -int PHYSFS_write(PHYSFS_file *handle, void *buffer, - unsigned int objSize, unsigned int objCount) +int PHYSFS_write(PHYSFS_file *handle, const void *buffer, + unsigned int objSize, unsigned int objCount) { FileHandle *h = (FileHandle *) handle->opaque; assert(h != NULL); diff --git a/physfs.h b/physfs.h index ae02e2b4..12799813 100644 --- a/physfs.h +++ b/physfs.h @@ -772,7 +772,7 @@ __EXPORT__ int PHYSFS_read(PHYSFS_file *handle, void *buffer, * @return number of objects written. PHYSFS_getLastError() can shed light on * the reason this might be < (objCount). -1 if complete failure. */ -__EXPORT__ int PHYSFS_write(PHYSFS_file *handle, void *buffer, +__EXPORT__ int PHYSFS_write(PHYSFS_file *handle, const void *buffer, unsigned int objSize, unsigned int objCount); @@ -811,7 +811,7 @@ __EXPORT__ int PHYSFS_seek(PHYSFS_file *handle, int pos); /** * Get total length of a file in bytes. Note that if the file size can't * be determined (since the archive is "streamed" or whatnot) than this - * with report (-1). Also note that if another process/thread is writing + * will report (-1). Also note that if another process/thread is writing * to this file at the same time, then the information this function * supplies could be incorrect before you get it. Use with caution, or * better yet, don't use at all. diff --git a/physfs_internal.h b/physfs_internal.h index 64a45c5c..4b13740c 100644 --- a/physfs_internal.h +++ b/physfs_internal.h @@ -62,7 +62,7 @@ typedef struct __PHYSFS_FILEFUNCTIONS__ * if complete failure. * On failure, call __PHYSFS_setError(). */ - int (*write)(FileHandle *handle, void *buffer, + int (*write)(FileHandle *handle, const void *buffer, unsigned int objSize, unsigned int objCount); /*