mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 01:45:41 +02:00
Distinguish between signed and unsigned in the temporary file
This commit is contained in:
@@ -179,6 +179,11 @@ void deserialize_int(char **f, int *n) {
|
|||||||
*f += sizeof(int);
|
*f += sizeof(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deserialize_uint(char **f, unsigned *n) {
|
||||||
|
memcpy(n, *f, sizeof(unsigned));
|
||||||
|
*f += sizeof(unsigned);
|
||||||
|
}
|
||||||
|
|
||||||
void deserialize_byte(char **f, signed char *n) {
|
void deserialize_byte(char **f, signed char *n) {
|
||||||
memcpy(n, *f, sizeof(signed char));
|
memcpy(n, *f, sizeof(signed char));
|
||||||
*f += sizeof(signed char);
|
*f += sizeof(signed char);
|
||||||
|
|||||||
+3
-3
@@ -28,9 +28,9 @@ drawvec decode_geometry(char **meta, int z, unsigned tx, unsigned ty, int detail
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
|
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
|
||||||
int wx, wy;
|
unsigned wx, wy;
|
||||||
deserialize_int(meta, &wx);
|
deserialize_uint(meta, &wx);
|
||||||
deserialize_int(meta, &wy);
|
deserialize_uint(meta, &wy);
|
||||||
|
|
||||||
long long wwx = (unsigned) wx;
|
long long wwx = (unsigned) wx;
|
||||||
long long wwy = (unsigned) wy;
|
long long wwy = (unsigned) wy;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
struct pool;
|
struct pool;
|
||||||
|
|
||||||
void deserialize_int(char **f, int *n);
|
void deserialize_int(char **f, int *n);
|
||||||
|
void deserialize_uint(char **f, unsigned *n);
|
||||||
void deserialize_byte(char **f, signed char *n);
|
void deserialize_byte(char **f, signed char *n);
|
||||||
struct pool_val *deserialize_string(char **f, struct pool *p, int type);
|
struct pool_val *deserialize_string(char **f, struct pool *p, int type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user