@ -56,7 +56,7 @@ static Sint64 MpqFileRwSize(struct SDL_RWops *context)
static OffsetType MpqFileRwSeek ( struct SDL_RWops * context , OffsetType offset , int whence )
{
Data & data = * GetData ( context ) ;
siz e_ t newPosition ;
Off setType newPosition ;
switch ( whence ) {
case RW_SEEK_SET :
newPosition = static_cast < size_t > ( offset ) ;
@ -71,11 +71,11 @@ static OffsetType MpqFileRwSeek(struct SDL_RWops *context, OffsetType offset, in
return - 1 ;
}
if ( newPosition = = data . position )
return static_cast < OffsetType > ( newPosition ) ;
if ( newPosition = = static_cast < OffsetType > ( data . position ) )
return newPosition ;
if ( newPosition > data . size ) {
SDL_SetError ( " MpqFileRwSeek beyond EOF (%d > %u) " , static_cast < int > ( newPosition ) , data . size ) ;
if ( newPosition > static_cast < OffsetType > ( data . size ) ) {
SDL_SetError ( " MpqFileRwSeek beyond EOF (%d > %u) " , static_cast < int > ( newPosition ) , static_cast < unsigned > ( data . size ) ) ;
return - 1 ;
}
@ -84,12 +84,12 @@ static OffsetType MpqFileRwSeek(struct SDL_RWops *context, OffsetType offset, in
return - 1 ;
}
if ( data . position / data . blockSize ! = newPosition / data . blockSize )
if ( data . position / data . blockSize ! = static_cast < size_t > ( newPosition ) / data . blockSize )
data . blockRead = false ;
data . position = newPosition ;
data . position = static_cast < size_t > ( newPosition ) ;
return static_cast < OffsetType > ( newPosition ) ;
return newPosition ;
}
static SizeType MpqFileRwRead ( struct SDL_RWops * context , void * ptr , SizeType size , SizeType maxnum )