diff --git a/decode.cpp b/decode.cpp index 4bd64849..dedb4053 100644 --- a/decode.cpp +++ b/decode.cpp @@ -277,7 +277,7 @@ void decode(char *fname, int z, unsigned x, unsigned y, std::set co struct stat st; std::vector tiles; - char *pmtiles_map; + char *pmtiles_map = NULL; std::vector entries; bool is_pmtiles = false; diff --git a/pmtiles/pmtiles.hpp b/pmtiles/pmtiles.hpp index 3d613995..98c77730 100644 --- a/pmtiles/pmtiles.hpp +++ b/pmtiles/pmtiles.hpp @@ -166,11 +166,11 @@ struct entryv3 { } }; -static struct { +struct entryv3_cmp { bool operator()(entryv3 a, entryv3 b) const { return a.tile_id < b.tile_id; } -} entryv3_cmp; +}; struct entry_zxy { uint8_t z; diff --git a/pmtiles_file.cpp b/pmtiles_file.cpp index 0326c92a..5cd78620 100644 --- a/pmtiles_file.cpp +++ b/pmtiles_file.cpp @@ -263,7 +263,7 @@ void mbtiles_map_image_to_pmtiles(char *fname, metadata m, bool tile_compression // finalize PMTiles archive. { - std::sort(entries.begin(), entries.end(), pmtiles::entryv3_cmp); + std::sort(entries.begin(), entries.end(), pmtiles::entryv3_cmp()); std::string root_bytes; std::string leaves_bytes;