Skip to content

Commit

Permalink
replaced deprecated libtiff v4.3 typedefs with C99 fixed width integers
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-langer committed Jun 9, 2022
1 parent 9ecdb87 commit 65408ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
33 changes: 17 additions & 16 deletions include/boost/gil/extension/io/tiff/detail/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <boost/gil/io/device.hpp>

#include <algorithm>
#include <cstdint>
#include <memory>
#include <sstream>
#include <type_traits>
Expand Down Expand Up @@ -221,9 +222,9 @@ class tiff_device_base
{
if( TIFFReadTile( _tiff_file.get()
, reinterpret_cast< tdata_t >( &buffer.front() )
, (uint32) x
, (uint32) y
, (uint32) z
, static_cast< std::uint32_t >( x )
, static_cast< std::uint32_t >( y )
, static_cast< std::uint32_t >( z )
, plane
) == -1 )
{
Expand All @@ -234,9 +235,9 @@ class tiff_device_base
}

template< typename Buffer >
void write_scaline( Buffer& buffer
, uint32 row
, tsample_t plane
void write_scaline( Buffer& buffer
, std::uint32_t row
, tsample_t plane
)
{
io_error_if( TIFFWriteScanline( _tiff_file.get()
Expand All @@ -248,9 +249,9 @@ class tiff_device_base
);
}

void write_scaline( byte_t* buffer
, uint32 row
, tsample_t plane
void write_scaline( byte_t* buffer
, std::uint32_t row
, tsample_t plane
)
{
io_error_if( TIFFWriteScanline( _tiff_file.get()
Expand All @@ -263,11 +264,11 @@ class tiff_device_base
}

template< typename Buffer >
void write_tile( Buffer& buffer
, uint32 x
, uint32 y
, uint32 z
, tsample_t plane
void write_tile( Buffer& buffer
, std::uint32_t x
, std::uint32_t y
, std::uint32_t z
, tsample_t plane
)
{
if( TIFFWriteTile( _tiff_file.get()
Expand Down Expand Up @@ -300,8 +301,8 @@ class tiff_device_base
)
{
bool result = true;
uint32 tw = static_cast< uint32 >( width );
uint32 th = static_cast< uint32 >( height );
std::uint32_t tw = static_cast< std::uint32_t >( width );
std::uint32_t th = static_cast< std::uint32_t >( height );

TIFFDefaultTileSize( _tiff_file.get()
, &tw
Expand Down
5 changes: 3 additions & 2 deletions include/boost/gil/extension/io/tiff/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <boost/gil/io/detail/dynamic.hpp>

#include <algorithm>
#include <cstdint>
#include <string>
#include <type_traits>
#include <vector>
Expand Down Expand Up @@ -393,8 +394,8 @@ class writer< Device
}

this->_io_dev.write_tile( row
, static_cast< uint32 >( j )
, static_cast< uint32 >( i )
, static_cast< std::uint32_t >( j )
, static_cast< std::uint32_t >( i )
, 0
, 0
);
Expand Down

0 comments on commit 65408ac

Please sign in to comment.