Constification.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 29 Aug 2010 01:55:30 -0400
changeset 1117 968e1567f4f4
parent 1116 20dfca1e8a27
child 1118 2e09fc635fdd
Constification.
src/platform_posix.c
--- a/src/platform_posix.c	Fri Aug 27 14:27:15 2010 -0400
+++ b/src/platform_posix.c	Sun Aug 29 01:55:30 2010 -0400
@@ -302,7 +302,7 @@
 PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
                                     PHYSFS_uint64 len)
 {
-    int fd = *((int *) opaque);
+    const int fd = *((int *) opaque);
     ssize_t rc = 0;
 
     BAIL_IF_MACRO(!__PHYSFS_ui64FitsAddressSpace(len),ERR_INVALID_ARGUMENT,-1);
@@ -318,7 +318,7 @@
 PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
                                      PHYSFS_uint64 len)
 {
-    int fd = *((int *) opaque);
+    const int fd = *((int *) opaque);
     ssize_t rc = 0;
 
     BAIL_IF_MACRO(!__PHYSFS_ui64FitsAddressSpace(len),ERR_INVALID_ARGUMENT,-1);
@@ -333,7 +333,7 @@
 
 int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
 {
-    int fd = *((int *) opaque);
+    const int fd = *((int *) opaque);
 
     #ifdef PHYSFS_HAVE_LLSEEK
       unsigned long offset_high = ((pos >> 32) & 0xFFFFFFFF);
@@ -351,7 +351,7 @@
 
 PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
 {
-    int fd = *((int *) opaque);
+    const int fd = *((int *) opaque);
     PHYSFS_sint64 retval;
 
     #ifdef PHYSFS_HAVE_LLSEEK
@@ -370,7 +370,7 @@
 
 PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
 {
-    int fd = *((int *) opaque);
+    const int fd = *((int *) opaque);
     struct stat statbuf;
     BAIL_IF_MACRO(fstat(fd, &statbuf) == -1, strerror(errno), -1);
     return ((PHYSFS_sint64) statbuf.st_size);
@@ -379,15 +379,15 @@
 
 int __PHYSFS_platformEOF(void *opaque)
 {
-    PHYSFS_sint64 pos = __PHYSFS_platformTell(opaque);
-    PHYSFS_sint64 len = __PHYSFS_platformFileLength(opaque);
+    const PHYSFS_sint64 pos = __PHYSFS_platformTell(opaque);
+    const PHYSFS_sint64 len = __PHYSFS_platformFileLength(opaque);
     return (pos >= len);
 } /* __PHYSFS_platformEOF */
 
 
 int __PHYSFS_platformFlush(void *opaque)
 {
-    int fd = *((int *) opaque);
+    const int fd = *((int *) opaque);
     BAIL_IF_MACRO(fsync(fd) == -1, strerror(errno), 0);
     return 1;
 } /* __PHYSFS_platformFlush */