mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-25 13:17:38 +00:00
fix 'negation of 1 cannot be represented in type unsigned int' error - refs #227
This commit is contained in:
parent
d35ef72a99
commit
3182930f35
8
mvt.cc
8
mvt.cc
@ -79,10 +79,6 @@ int compress(std::string const &input, std::string &output) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dezig(unsigned n) {
|
||||
return (n >> 1) ^ (-(n & 1));
|
||||
}
|
||||
|
||||
bool mvt_tile::decode(std::string &message) {
|
||||
layers.clear();
|
||||
std::string src;
|
||||
@ -214,8 +210,8 @@ bool mvt_tile::decode(std::string &message) {
|
||||
|
||||
if (op == mvt_moveto || op == mvt_lineto) {
|
||||
for (size_t k = 0; k < count && g + 2 < geoms.size(); k++) {
|
||||
px += dezig(geoms[g + 1]);
|
||||
py += dezig(geoms[g + 2]);
|
||||
px += protozero::decode_zigzag32(geoms[g + 1]);
|
||||
py += protozero::decode_zigzag32(geoms[g + 2]);
|
||||
g += 2;
|
||||
|
||||
feature.geometry.push_back(mvt_geometry(op, px, py));
|
||||
|
Loading…
x
Reference in New Issue
Block a user