mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-08 03:50:25 +00:00
Use a proper constructor, discover two unused fields
This commit is contained in:
parent
dca1ebbbfb
commit
069807caf4
14
geojson.hpp
14
geojson.hpp
@ -10,13 +10,15 @@
|
|||||||
#include "serial.hpp"
|
#include "serial.hpp"
|
||||||
|
|
||||||
struct parse_json_args {
|
struct parse_json_args {
|
||||||
json_pull *jp = NULL;
|
json_pull *jp;
|
||||||
int layer = 0;
|
int layer;
|
||||||
std::string *layername = NULL;
|
std::string *layername;
|
||||||
std::map<std::string, int> const *attribute_types = NULL;
|
|
||||||
bool want_dist = false;
|
|
||||||
|
|
||||||
struct serialization_state *sst = NULL;
|
struct serialization_state *sst;
|
||||||
|
|
||||||
|
parse_json_args(json_pull *jp1, int layer1, std::string *layername1, struct serialization_state *sst1)
|
||||||
|
: jp(jp1), layer(layer1), layername(layername1), sst(sst1) {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct json_pull *json_begin_map(char *map, long long len);
|
struct json_pull *json_begin_map(char *map, long long len);
|
||||||
|
13
main.cpp
13
main.cpp
@ -374,7 +374,6 @@ void do_read_parallel(char *map, long long len, long long initial_offset, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<parse_json_args> pja;
|
std::vector<parse_json_args> pja;
|
||||||
pja.resize(CPUS);
|
|
||||||
|
|
||||||
std::vector<serialization_state> sst;
|
std::vector<serialization_state> sst;
|
||||||
sst.resize(CPUS);
|
sst.resize(CPUS);
|
||||||
@ -410,12 +409,14 @@ void do_read_parallel(char *map, long long len, long long initial_offset, const
|
|||||||
sst[i].basezoom = basezoom;
|
sst[i].basezoom = basezoom;
|
||||||
sst[i].attribute_types = attribute_types;
|
sst[i].attribute_types = attribute_types;
|
||||||
|
|
||||||
pja[i].jp = json_begin_map(map + segs[i], segs[i + 1] - segs[i]);
|
pja.push_back(parse_json_args(
|
||||||
pja[i].layer = source;
|
json_begin_map(map + segs[i], segs[i + 1] - segs[i]),
|
||||||
pja[i].layername = &layername;
|
source,
|
||||||
|
&layername,
|
||||||
pja[i].sst = &sst[i];
|
&sst[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < CPUS; i++) {
|
||||||
if (pthread_create(&pthreads[i], NULL, run_parse_json, &pja[i]) != 0) {
|
if (pthread_create(&pthreads[i], NULL, run_parse_json, &pja[i]) != 0) {
|
||||||
perror("pthread_create");
|
perror("pthread_create");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user