mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-27 12:17:28 +00:00
Respect maximum value of size_t in set_stream_size
When size_t is 32-bits (like in a WASM project), passing in a 64-bit constant leads to compile-time warnings.
This commit is contained in:
parent
62a6f61acf
commit
0a229d80fd
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <climits>
|
#include <limits>
|
||||||
|
|
||||||
namespace ELFIO {
|
namespace ELFIO {
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ template <class T> class section_impl : public section
|
|||||||
set_stream_size( stream.tellg() );
|
set_stream_size( stream.tellg() );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_stream_size( ULLONG_MAX );
|
set_stream_size( std::numeric_limits<size_t>::max() );
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.seekg( ( *translator )[header_offset] );
|
stream.seekg( ( *translator )[header_offset] );
|
||||||
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <climits>
|
#include <limits>
|
||||||
|
|
||||||
namespace ELFIO {
|
namespace ELFIO {
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ template <class T> class segment_impl : public segment
|
|||||||
set_stream_size( stream.tellg() );
|
set_stream_size( stream.tellg() );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_stream_size( ULLONG_MAX );
|
set_stream_size( std::numeric_limits<size_t>::max() );
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.seekg( ( *translator )[header_offset] );
|
stream.seekg( ( *translator )[header_offset] );
|
||||||
|
Loading…
Reference in New Issue
Block a user