Merge pull request #3766 from Zverik/fix2_32_m

[generator] Fix big node ids issue (→master)
This commit is contained in:
ygorshenin 2016-07-13 17:49:26 +03:00 committed by GitHub
commit 201968fbc3

View file

@ -306,7 +306,7 @@ class RawMemPointStorage : public PointStorage
vector<LatLon> m_data;
public:
explicit RawMemPointStorage(string const & name) : m_file(name), m_data((size_t)0xFFFFFFFF)
explicit RawMemPointStorage(string const & name) : m_file(name), m_data(static_cast<size_t>(1) << 33)
{
InitStorage<TMode>();
}
@ -337,6 +337,7 @@ public:
int64_t const lat64 = lat * kValueOrder;
int64_t const lng64 = lng * kValueOrder;
CHECK_LESS(id, m_data.size(), ("Found node with id", id, "which is bigger than the allocated cache size"));
LatLon & ll = m_data[id];
ll.lat = static_cast<int32_t>(lat64);
ll.lon = static_cast<int32_t>(lng64);