Skip to content

Commit

Permalink
E57 changes for GCC 9.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Feb 7, 2020
1 parent c09f2b1 commit 3b8c0f5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/e57/libE57Format/src/CheckedFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void CheckedFile::read(char* buf, size_t nRead, size_t /*bufSize*/)
vector<char> page_buffer_v( physicalPageSize );
char* page_buffer = &page_buffer_v[0];

auto checksumMod = static_cast<const unsigned int>( std::nearbyint( 100.0 / checkSumPolicy_ ) );
auto checksumMod = static_cast<unsigned int>( std::nearbyint( 100.0 / checkSumPolicy_ ) );

while ( nRead > 0 )
{
Expand Down Expand Up @@ -240,7 +240,7 @@ void CheckedFile::write(const char* buf, size_t nWrite)
{
const off_t physicalLength = length( Physical );

if ( page*physicalPageSize < physicalLength )
if ( (off_t)(page*physicalPageSize) < physicalLength )
{
readPhysicalPage( page_buffer, page );
}
Expand Down Expand Up @@ -481,7 +481,7 @@ void CheckedFile::extend(off_t newLength, OffsetMode omode)
/// Watch out for different int sizes here.
size_t n = 0;

if (nWrite < logicalPageSize - pageOffset)
if (nWrite < (off_t)(logicalPageSize - pageOffset))
{
n = static_cast<size_t>(nWrite);
}
Expand All @@ -498,7 +498,7 @@ void CheckedFile::extend(off_t newLength, OffsetMode omode)
{
const off_t physicalLength = length( Physical );

if ( page*physicalPageSize < physicalLength )
if ( (off_t)(page*physicalPageSize) < physicalLength )
{
readPhysicalPage( page_buffer, page );
}
Expand All @@ -513,7 +513,7 @@ void CheckedFile::extend(off_t newLength, OffsetMode omode)
pageOffset = 0;
++page;

if (nWrite < logicalPageSize)
if (nWrite < (off_t)logicalPageSize)
{
n = static_cast<size_t>(nWrite);
}
Expand Down

0 comments on commit 3b8c0f5

Please sign in to comment.