mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-26 18:15:40 +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 <iostream>
|
||||
#include <new>
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
|
||||
namespace ELFIO {
|
||||
|
||||
@ -197,7 +197,7 @@ template <class T> class section_impl : public section
|
||||
set_stream_size( stream.tellg() );
|
||||
}
|
||||
else {
|
||||
set_stream_size( ULLONG_MAX );
|
||||
set_stream_size( std::numeric_limits<size_t>::max() );
|
||||
}
|
||||
|
||||
stream.seekg( ( *translator )[header_offset] );
|
||||
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <new>
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
|
||||
namespace ELFIO {
|
||||
|
||||
@ -166,7 +166,7 @@ template <class T> class segment_impl : public segment
|
||||
set_stream_size( stream.tellg() );
|
||||
}
|
||||
else {
|
||||
set_stream_size( ULLONG_MAX );
|
||||
set_stream_size( std::numeric_limits<size_t>::max() );
|
||||
}
|
||||
|
||||
stream.seekg( ( *translator )[header_offset] );
|
||||
|
Loading…
Reference in New Issue
Block a user