Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2011-12-09 18:10:44 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:30:02 +0300
commitdba009c9ea28f5b75c0743ccf3fe9fc3ceda38f9 (patch)
tree25bb3f3ca98fae5f9f098ff0ce25ab282b01cc5b /indexer/classificator.cpp
parentd38f6a81f7ad39bae5aa1f27924250e978270a84 (diff)
Fix feature type conversion from 1.01 to 2.0
Diffstat (limited to 'indexer/classificator.cpp')
-rw-r--r--indexer/classificator.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp
index ee98dfc95f..1c8f0e2145 100644
--- a/indexer/classificator.cpp
+++ b/indexer/classificator.cpp
@@ -166,7 +166,7 @@ void ClassifObject::Swap(ClassifObject & r)
ClassifObject const * ClassifObject::GetObject(size_t i) const
{
- ASSERT ( i < m_objs.size(), (i) );
+ ASSERT_LESS ( i, m_objs.size(), (m_name) );
return &(m_objs[i]);
}
@@ -261,7 +261,7 @@ namespace ftype
void PopValue(uint32_t & type)
{
uint8_t const cl = get_control_level(type);
- ASSERT ( cl > 0, (cl) );
+ ASSERT_GREATER ( cl, 0, () );
// remove control level
set_value(type, cl, 0);
@@ -269,6 +269,23 @@ namespace ftype
// set control level
set_value(type, cl-1, 1);
}
+
+ void TruncValue(uint32_t & type, uint8_t level)
+ {
+ ASSERT_GREATER ( level, 0, () );
+ uint8_t cl = get_control_level(type);
+
+ while (cl > level)
+ {
+ // remove control level
+ set_value(type, cl, 0);
+
+ --cl;
+
+ // set control level
+ set_value(type, cl, 1);
+ }
+ }
}
namespace