mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Less verbose initializer syntax
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ struct type_and_string_stats {
|
|||||||
|
|
||||||
struct layermap_entry {
|
struct layermap_entry {
|
||||||
size_t id = 0;
|
size_t id = 0;
|
||||||
std::map<std::string, type_and_string_stats> file_keys = std::map<std::string, type_and_string_stats>();
|
std::map<std::string, type_and_string_stats> file_keys{};
|
||||||
int minzoom = 0;
|
int minzoom = 0;
|
||||||
int maxzoom = 0;
|
int maxzoom = 0;
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -2,11 +2,11 @@
|
|||||||
#define MEMFILE_HPP
|
#define MEMFILE_HPP
|
||||||
|
|
||||||
struct memfile {
|
struct memfile {
|
||||||
int fd;
|
int fd = 0;
|
||||||
char *map;
|
char *map = NULL;
|
||||||
long long len;
|
long long len = 0;
|
||||||
long long off;
|
long long off = 0;
|
||||||
unsigned long tree;
|
unsigned long tree = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct memfile *memfile_open(int fd);
|
struct memfile *memfile_open(int fd);
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ enum mvt_geometry_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct mvt_feature {
|
struct mvt_feature {
|
||||||
std::vector<unsigned> tags = std::vector<unsigned>();
|
std::vector<unsigned> tags{};
|
||||||
std::vector<mvt_geometry> geometry = std::vector<mvt_geometry>();
|
std::vector<mvt_geometry> geometry{};
|
||||||
int /* mvt_geometry_type */ type = 0;
|
int /* mvt_geometry_type */ type = 0;
|
||||||
unsigned long long id = 0;
|
unsigned long long id = 0;
|
||||||
bool has_id = false;
|
bool has_id = false;
|
||||||
@@ -91,9 +91,9 @@ struct mvt_value {
|
|||||||
struct mvt_layer {
|
struct mvt_layer {
|
||||||
int version = 0;
|
int version = 0;
|
||||||
std::string name = "";
|
std::string name = "";
|
||||||
std::vector<mvt_feature> features = std::vector<mvt_feature>();
|
std::vector<mvt_feature> features{};
|
||||||
std::vector<std::string> keys = std::vector<std::string>();
|
std::vector<std::string> keys{};
|
||||||
std::vector<mvt_value> values = std::vector<mvt_value>();
|
std::vector<mvt_value> values{};
|
||||||
long long extent = 0;
|
long long extent = 0;
|
||||||
|
|
||||||
// Add a key-value pair to a feature, using this layer's constant pool
|
// Add a key-value pair to a feature, using this layer's constant pool
|
||||||
@@ -105,7 +105,7 @@ struct mvt_layer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct mvt_tile {
|
struct mvt_tile {
|
||||||
std::vector<mvt_layer> layers;
|
std::vector<mvt_layer> layers{};
|
||||||
|
|
||||||
std::string encode();
|
std::string encode();
|
||||||
bool decode(std::string &message, bool &was_compressed);
|
bool decode(std::string &message, bool &was_compressed);
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
#define POOL_HPP
|
#define POOL_HPP
|
||||||
|
|
||||||
struct stringpool {
|
struct stringpool {
|
||||||
unsigned long left;
|
unsigned long left = 0;
|
||||||
unsigned long right;
|
unsigned long right = 0;
|
||||||
unsigned long off;
|
unsigned long off = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
long long addpool(struct memfile *poolfile, struct memfile *treefile, const char *s, char type);
|
long long addpool(struct memfile *poolfile, struct memfile *treefile, const char *s, char type);
|
||||||
|
|||||||
+4
-4
@@ -57,14 +57,14 @@ struct serial_feature {
|
|||||||
long long extent = 0;
|
long long extent = 0;
|
||||||
|
|
||||||
size_t m = 0;
|
size_t m = 0;
|
||||||
std::vector<long long> keys = std::vector<long long>();
|
std::vector<long long> keys{};
|
||||||
std::vector<long long> values = std::vector<long long>();
|
std::vector<long long> values{};
|
||||||
long long metapos = 0;
|
long long metapos = 0;
|
||||||
|
|
||||||
// XXX This isn't serialized. Should it be here?
|
// XXX This isn't serialized. Should it be here?
|
||||||
long long bbox[4] = {0, 0, 0, 0};
|
long long bbox[4] = {0, 0, 0, 0};
|
||||||
std::vector<std::string> full_keys = std::vector<std::string>();
|
std::vector<std::string> full_keys{};
|
||||||
std::vector<serial_val> full_values = std::vector<serial_val>();
|
std::vector<serial_val> full_values{};
|
||||||
std::string layername = "";
|
std::string layername = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user