diff options
author | artemp <artem@mapnik.org> | 2014-02-06 12:09:13 +0000 |
---|---|---|
committer | artemp <artem@mapnik.org> | 2014-02-06 12:09:13 +0000 |
commit | 8703b691515756fdbb180275fa465815c103c805 (patch) | |
tree | 305de1f16e9380e9c9a16809ca393dd1703ece50 /include/llmr/util/pbf.hpp | |
parent | 0cf3f28d0577d5eb04a4bab150ed2170cd87801e (diff) | |
download | qtlocation-mapboxgl-8703b691515756fdbb180275fa465815c103c805.tar.gz |
c++
* use c++ style casts
* remove unused includes
Diffstat (limited to 'include/llmr/util/pbf.hpp')
-rw-r--r-- | include/llmr/util/pbf.hpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/include/llmr/util/pbf.hpp b/include/llmr/util/pbf.hpp index 526bc68d32..b685d158cc 100644 --- a/include/llmr/util/pbf.hpp +++ b/include/llmr/util/pbf.hpp @@ -8,12 +8,8 @@ * Author: Josh Haberman <jhaberman@gmail.com> */ -#include <cstdlib> -#include <cstdio> -#include <cstring> #include <string> - namespace llmr { struct pbf { @@ -73,7 +69,7 @@ pbf::operator bool() const { bool pbf::next() { if (data < end) { - value = (uint32_t)varint(); + value = static_cast<uint32_t>(varint()); tag = value >> 3; return true; } @@ -134,8 +130,8 @@ double pbf::float64() { } std::string pbf::string() { - uint32_t bytes = (uint32_t)varint(); - const char *string = (const char *)data; + uint32_t bytes = static_cast<uint32_t>(varint()); + const char *string = reinterpret_cast<const char*>(data); skipBytes(bytes); return std::string(string, bytes); } @@ -146,7 +142,7 @@ bool pbf::boolean() { } pbf pbf::message() { - uint32_t bytes = (uint32_t)varint(); + uint32_t bytes = static_cast<uint32_t>(varint()); const uint8_t *pos = data; skipBytes(bytes); return pbf(pos, bytes); @@ -165,7 +161,7 @@ void pbf::skipValue(uint32_t val) { skipBytes(8); break; case 2: // string/message - skipBytes((uint32_t)varint()); + skipBytes(static_cast<uint32_t>(varint())); break; case 5: // 32 bit skipBytes(4); |