summaryrefslogtreecommitdiff
path: root/navit/maptool/osm_o5m.c
diff options
context:
space:
mode:
authorMichael Dankov <tryagain@navit-project.org>2016-07-27 02:17:59 +0300
committerMichael Dankov <tryagain@navit-project.org>2016-07-27 02:17:59 +0300
commitc14bb728e223f2d113919233db3dc77368cd3c47 (patch)
treefa3c89029e9af9345183f49732498a3f8b323f29 /navit/maptool/osm_o5m.c
parentcdc4245f6a9f04236ad027a5630a1777e6398a8e (diff)
downloadnavit-c14bb728e223f2d113919233db3dc77368cd3c47.tar.gz
refactor:maptool:Support 56 bit node IDsR6731
We need it because openstreetmap data recently has passed 2^32 node id value. Also, running maptool on 32 bit systems won't work at least in following cases: - a node with osm id=>2^32 is a via member of a turn restriction relation; - input file has unordered node ids, that's the case, for example, for overpass turbo exported data. To avoid confusion, I have disabled maptool build for 32bit systems.
Diffstat (limited to 'navit/maptool/osm_o5m.c')
-rw-r--r--navit/maptool/osm_o5m.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/navit/maptool/osm_o5m.c b/navit/maptool/osm_o5m.c
index 1ca3b1c3c..96a5f7ba7 100644
--- a/navit/maptool/osm_o5m.c
+++ b/navit/maptool/osm_o5m.c
@@ -49,12 +49,12 @@ static unsigned long long
get_uval(unsigned char **p)
{
unsigned char c;
- long long ret=0;
+ unsigned long long ret=0;
int shift=0;
for (;;) {
c=*((*p)++);
- ret+=((long long)c & 0x7f) << shift;
+ ret+=((unsigned long long)c & 0x7f) << shift;
if (!(c & 0x80))
return ret;
shift+=7;
@@ -64,9 +64,9 @@ get_uval(unsigned char **p)
static unsigned long long
get_sval(unsigned char **p)
{
- long long ret=get_uval(p);
+ unsigned long long ret=get_uval(p);
if (ret & 1) {
- return -((ret >> 1)+1);
+ return -((long long)(ret >> 1)+1);
} else {
return ret >> 1;
}