From 4ed691696de132289e4023e2fbd7e7854d78c88b Mon Sep 17 00:00:00 2001 From: Michael Dankov Date: Fri, 26 Aug 2016 19:20:18 +0300 Subject: fix:maptool:properly check node reference mark --- navit/maptool/osm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c index 59518d620..b5c72e7d9 100644 --- a/navit/maptool/osm.c +++ b/navit/maptool/osm.c @@ -126,7 +126,8 @@ char *osm_types[]={"unknown","node","way","relation"}; * Currently it keeps low 31 bits in y coordinate and up to 30 high order bits in x coordinate, allowing for 61 bit osm node id in total. */ #define REF_MARKER (1ull << 30) -#define IS_REF(c) (((c).x & REF_MARKER)!=0) +#define REF_MASK (3ull << 30) +#define IS_REF(c) (((c).x & REF_MASK)==REF_MARKER) #define GET_REF(c) ((((osmid)(c).x & ~REF_MARKER)<<31) + (c).y ) #define SET_REF(c,ref) do { (c).x = REF_MARKER | ((osmid)(ref)>>31); (c).y = (osmid)(ref) & 0x7fffffffull; } while(0) -- cgit v1.2.1