mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-25 13:17:38 +00:00
Fix use of 32-bit zigzag encoding/decoding for 64-bit integers
This commit is contained in:
parent
1f38e85f30
commit
eb1c64db27
@ -30,7 +30,6 @@ extern "C" {
|
||||
|
||||
#include "pool.hpp"
|
||||
#include "projection.hpp"
|
||||
#include "version.hpp"
|
||||
#include "memfile.hpp"
|
||||
#include "main.hpp"
|
||||
#include "mbtiles.hpp"
|
||||
|
@ -27,7 +27,7 @@ void serialize_int(FILE *out, int n, long long *fpos, const char *fname) {
|
||||
}
|
||||
|
||||
void serialize_long_long(FILE *out, long long n, long long *fpos, const char *fname) {
|
||||
unsigned long long zigzag = protozero::encode_zigzag32(n);
|
||||
unsigned long long zigzag = protozero::encode_zigzag64(n);
|
||||
|
||||
serialize_ulong_long(out, zigzag, fpos, fname);
|
||||
}
|
||||
@ -73,7 +73,7 @@ void deserialize_int(char **f, int *n) {
|
||||
void deserialize_long_long(char **f, long long *n) {
|
||||
unsigned long long zigzag = 0;
|
||||
deserialize_ulong_long(f, &zigzag);
|
||||
*n = protozero::decode_zigzag32(zigzag);
|
||||
*n = protozero::decode_zigzag64(zigzag);
|
||||
}
|
||||
|
||||
void deserialize_ulong_long(char **f, unsigned long long *zigzag) {
|
||||
@ -107,7 +107,7 @@ void deserialize_byte(char **f, signed char *n) {
|
||||
int deserialize_long_long_io(FILE *f, long long *n, long long *geompos) {
|
||||
unsigned long long zigzag = 0;
|
||||
int ret = deserialize_ulong_long_io(f, &zigzag, geompos);
|
||||
*n = protozero::decode_zigzag32(zigzag);
|
||||
*n = protozero::decode_zigzag64(zigzag);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user