diff options
author | vng <viktor.govako@gmail.com> | 2015-07-08 19:02:33 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:55:03 +0300 |
commit | ba88809f5bcfbcfbdba8af5b7611ae0b30ae45d2 (patch) | |
tree | 82510906286949d1a27e85e826cdffd11bf9d5b1 /3party/succinct/util.hpp | |
parent | f906493af5f0c6e417960894679e0ce222ee2222 (diff) |
[3party][succinct] Fixed uint64_t <-> size_t warnings.
- Use size_t for memory byte index
- Use uint64_t for bit position index.
Diffstat (limited to '3party/succinct/util.hpp')
-rw-r--r-- | 3party/succinct/util.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/3party/succinct/util.hpp b/3party/succinct/util.hpp index c8c079fcf4..5cdea07c9d 100644 --- a/3party/succinct/util.hpp +++ b/3party/succinct/util.hpp @@ -10,7 +10,13 @@ #include <boost/iterator/iterator_facade.hpp> #include <boost/iostreams/device/mapped_file.hpp> -namespace succinct { namespace util { +namespace succinct { namespace util +{ + inline size_t to_size(uint64_t n) + { + assert(n <= std::numeric_limits<size_t>::max()); + return static_cast<size_t>(n); + } inline void trim_newline_chars(std::string& s) { |