mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 18:35:41 +02:00
Consistent indent style with clang-format
This commit is contained in:
@@ -17,6 +17,7 @@ vector_tile.pb.cc vector_tile.pb.h: vector_tile.proto
|
||||
PG=
|
||||
|
||||
H = $(shell find . '(' -name '*.h' -o -name '*.hh' ')')
|
||||
C = $(shell find . '(' -name '*.c' -o -name '*.cc' ')')
|
||||
|
||||
INCLUDES = -I/usr/local/include
|
||||
LIBS = -L/usr/local/lib
|
||||
@@ -42,3 +43,6 @@ libjsonpull.a: jsonpull.o
|
||||
|
||||
clean:
|
||||
rm tippecanoe *.o
|
||||
|
||||
indent:
|
||||
for i in $(C) $(H); do clang-format -i -style="{BasedOnStyle: Google, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, ColumnLimit: 0, ContinuationIndentWidth: 8, SpaceAfterCStyleCast: true, IndentCaseLabels: false, AllowShortBlocksOnASingleLine: false, AllowShortFunctionsOnASingleLine: false}" $$i; done
|
||||
|
||||
@@ -13,9 +13,7 @@ extern "C" {
|
||||
|
||||
// https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_compression.hpp
|
||||
inline bool is_compressed(std::string const &data) {
|
||||
return data.size() > 2 &&
|
||||
(((uint8_t)data[0] == 0x78 && (uint8_t)data[1] == 0x9C) ||
|
||||
((uint8_t)data[0] == 0x1F && (uint8_t)data[1] == 0x8B));
|
||||
return data.size() > 2 && (((uint8_t) data[0] == 0x78 && (uint8_t) data[1] == 0x9C) || ((uint8_t) data[0] == 0x1F && (uint8_t) data[1] == 0x8B));
|
||||
}
|
||||
|
||||
// https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_compression.hpp
|
||||
|
||||
@@ -34,12 +34,7 @@ int min_detail = 7;
|
||||
#define GEOM_TYPES 6
|
||||
|
||||
const char *geometry_names[GEOM_TYPES] = {
|
||||
"Point",
|
||||
"MultiPoint",
|
||||
"LineString",
|
||||
"MultiLineString",
|
||||
"Polygon",
|
||||
"MultiPolygon",
|
||||
"Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon",
|
||||
};
|
||||
|
||||
int geometry_within[GEOM_TYPES] = {
|
||||
@@ -52,12 +47,7 @@ int geometry_within[GEOM_TYPES] = {
|
||||
};
|
||||
|
||||
int mb_geometry[GEOM_TYPES] = {
|
||||
VT_POINT,
|
||||
VT_POINT,
|
||||
VT_LINE,
|
||||
VT_LINE,
|
||||
VT_POLYGON,
|
||||
VT_POLYGON,
|
||||
VT_POINT, VT_POINT, VT_LINE, VT_LINE, VT_POLYGON, VT_POLYGON,
|
||||
};
|
||||
|
||||
size_t fwrite_check(const void *ptr, size_t size, size_t nitems, FILE *stream, const char *fname) {
|
||||
@@ -601,8 +591,7 @@ int read_json(int argc, char **argv, char *fname, const char *layername, int max
|
||||
for (minzoom = 0; minzoom < 31; minzoom++) {
|
||||
unsigned mask = 1 << (32 - (minzoom + 1));
|
||||
|
||||
if (((bbox[0] & mask) != (bbox[2] & mask)) ||
|
||||
((bbox[1] & mask) != (bbox[3] & mask))) {
|
||||
if (((bbox[0] & mask) != (bbox[2] & mask)) || ((bbox[1] & mask) != (bbox[3] & mask))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1042,14 +1031,12 @@ int main(int argc, char **argv) {
|
||||
gamma = atof(optarg);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
{
|
||||
case 'p': {
|
||||
char *cp;
|
||||
for (cp = optarg; *cp != '\0'; cp++) {
|
||||
prevent[*cp & 0xFF] = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
|
||||
case 'v':
|
||||
fprintf(stderr, VERSION);
|
||||
|
||||
+1
-3
@@ -551,9 +551,7 @@ static void douglas_peucker(drawvec &geom, int start, int n, double e) {
|
||||
// find index idx of element with max_distance
|
||||
int i;
|
||||
for (i = first + 1; i < second; i++) {
|
||||
double temp_dist = square_distance_from_line(geom[start + i].x, geom[start + i].y,
|
||||
geom[start + first].x, geom[start + first].y,
|
||||
geom[start + second].x, geom[start + second].y);
|
||||
double temp_dist = square_distance_from_line(geom[start + i].x, geom[start + i].y, geom[start + first].x, geom[start + first].y, geom[start + second].x, geom[start + second].y);
|
||||
|
||||
double distance = fabs(temp_dist);
|
||||
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ struct draw {
|
||||
this->y = y;
|
||||
}
|
||||
|
||||
draw() { }
|
||||
draw() {
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::vector<draw> drawvec;
|
||||
|
||||
+12
-3
@@ -1,12 +1,21 @@
|
||||
typedef enum json_type {
|
||||
// These types can be returned by json_read()
|
||||
JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL,
|
||||
JSON_HASH,
|
||||
JSON_ARRAY,
|
||||
JSON_NUMBER,
|
||||
JSON_STRING,
|
||||
JSON_TRUE,
|
||||
JSON_FALSE,
|
||||
JSON_NULL,
|
||||
|
||||
// These and JSON_HASH and JSON_ARRAY can be called back by json_read_with_separators()
|
||||
JSON_COMMA, JSON_COLON,
|
||||
JSON_COMMA,
|
||||
JSON_COLON,
|
||||
|
||||
// These are only used internally as expectations of what comes next
|
||||
JSON_ITEM, JSON_KEY, JSON_VALUE,
|
||||
JSON_ITEM,
|
||||
JSON_KEY,
|
||||
JSON_VALUE,
|
||||
} json_type;
|
||||
|
||||
typedef struct json_object {
|
||||
|
||||
@@ -62,7 +62,6 @@ int is_pooled(struct pool *p, char *s, int type) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct pool_val *pool(struct pool *p, char *s, int type) {
|
||||
return pool1(p, s, type, strcmp);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ struct pool {
|
||||
int n;
|
||||
};
|
||||
|
||||
|
||||
struct pool_val *pool(struct pool *p, char *s, int type);
|
||||
void pool_free(struct pool *p);
|
||||
void pool_free_strings(struct pool *p);
|
||||
|
||||
@@ -53,7 +53,6 @@ unsigned long long encode(unsigned int wx, unsigned int wy) {
|
||||
out |= v;
|
||||
}
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user