From 69d59a86a42ad98898c1cc7258f00b6ebd77e243 Mon Sep 17 00:00:00 2001 From: vng Date: Mon, 3 Jan 2011 21:12:41 +0200 Subject: [PATCH] Fix illegal instruction when --- indexer/feature.hpp | 2 +- indexer/feature_processor.hpp | 7 +++---- indexer/indexer_tool/feature_sorter.cpp | 12 ++---------- tools/unix/make_index_of_vng.sh | 2 +- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/indexer/feature.hpp b/indexer/feature.hpp index 407a3e0c1e..552c361efb 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -234,7 +234,7 @@ public: vector m_data; uint32_t m_offset; - read_source_t(...) : m_offset(0) {} + read_source_t() : m_offset(0) {} void assign(char const * data, uint32_t size) { diff --git a/indexer/feature_processor.hpp b/indexer/feature_processor.hpp index b71e56f4b7..1991a5a673 100644 --- a/indexer/feature_processor.hpp +++ b/indexer/feature_processor.hpp @@ -31,18 +31,17 @@ namespace feature template void ForEachFromDatRawFormat(string const & fName, ToDo & toDo) { - typedef ReaderSource source_t; - FileReader reader(fName); - source_t src(reader); - typename FeatureGeom::read_source_t buffer(fName); + ReaderSource src(reader); // skip header uint64_t currPos = feature::GetSkipHeaderSize(reader); src.Skip(currPos); uint64_t const fSize = reader.Size(); + // read features one by one + typename FeatureGeom::read_source_t buffer; while (currPos < fSize) { FeatureGeom f; diff --git a/indexer/indexer_tool/feature_sorter.cpp b/indexer/indexer_tool/feature_sorter.cpp index 16c9227e90..c28cc89194 100644 --- a/indexer/indexer_tool/feature_sorter.cpp +++ b/indexer/indexer_tool/feature_sorter.cpp @@ -89,22 +89,14 @@ namespace feature FeaturesCollectorRef collector(datFilePath); + FeatureGeom::read_source_t buffer; for (size_t i = 0; i < midPoints.m_vec.size(); ++i) { ReaderSource src(reader); - - // move to position src.Skip(midPoints.m_vec[i].second); - // read feature bytes - uint32_t const sz = ReadVarUint(src); - FeatureGeom::read_source_t buffer; - buffer.m_data.resize(sz); - src.Read(&buffer.m_data[0], sz); - - // FeatureGeom -> FeatureBuilderTypes FeatureGeom f; - f.Deserialize(buffer); + feature::ReadFromSource(src, f, buffer); FeatureBuilderType fb; f.InitFeatureBuilder(fb); diff --git a/tools/unix/make_index_of_vng.sh b/tools/unix/make_index_of_vng.sh index 31a5ecb61a..029323da14 100755 --- a/tools/unix/make_index_of_vng.sh +++ b/tools/unix/make_index_of_vng.sh @@ -16,4 +16,4 @@ then fi $PV ../../../omim-maps/$2.osm.bz2 | bzip2 -d | $INDEXER_TOOL --generate_intermediate_data=true --generate_final_data=false --use_light_nodes=true --generate_index=false --intermediate_data_path=$TMPDIR -$PV ../../../omim-maps/$2.osm.bz2 | bzip2 -d | $INDEXER_TOOL --generate_intermediate_data=false --generate_final_data=true --use_light_nodes=true --generate_index=true --sort_features --intermediate_data_path=$TMPDIR --output=$2 --bucketing_level=0 +$PV ../../../omim-maps/$2.osm.bz2 | bzip2 -d | $INDEXER_TOOL --generate_intermediate_data=false --generate_final_data=true --use_light_nodes=true --generate_index=true --sort_features=true --intermediate_data_path=$TMPDIR --output=$2 --bucketing_level=0