Skip to content

Commit

Permalink
Constification.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 29, 2010
1 parent 74f8cb4 commit c2e77d7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/platform_posix.c
Expand Up @@ -302,7 +302,7 @@ void *__PHYSFS_platformOpenAppend(const char *filename)
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);
Expand All @@ -318,7 +318,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
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);
Expand All @@ -333,7 +333,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,

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);
Expand All @@ -351,7 +351,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)

PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
{
int fd = *((int *) opaque);
const int fd = *((int *) opaque);
PHYSFS_sint64 retval;

#ifdef PHYSFS_HAVE_LLSEEK
Expand All @@ -370,7 +370,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)

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);
Expand All @@ -379,15 +379,15 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)

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 */
Expand Down

0 comments on commit c2e77d7

Please sign in to comment.