Fixed some warnings

This commit is contained in:
Alex Zolotarev 2011-10-05 12:16:29 +03:00 committed by Alex Zolotarev
parent b91122858b
commit 16568a93c1
3 changed files with 12 additions and 7 deletions

View file

@ -43,7 +43,7 @@ namespace my
int m_maxWeight;
public:
explicit MRUCache(size_t maxWeight)
explicit MRUCache(int maxWeight)
: m_curWeight(0), m_maxWeight(maxWeight)
{}

View file

@ -37,7 +37,7 @@ namespace feature
{
return m_header.GetCodingParams(scaleIndex);
}
inline int GetScalesCount() const { return m_header.GetScalesCount(); }
inline int GetScalesCount() const { return static_cast<int>(m_header.GetScalesCount()); }
inline int GetScale(int i) const { return m_header.GetScale(i); }
};

View file

@ -90,9 +90,12 @@ public:
{
IntervalIndexBase::Header header;
header.m_Version = IntervalIndexBase::kVersion;
header.m_BitsPerLevel = m_BitsPerLevel;
header.m_Levels = m_Levels;
header.m_LeafBytes = m_LeafBytes;
header.m_BitsPerLevel = static_cast<uint8_t>(m_BitsPerLevel);
ASSERT_EQUAL(header.m_BitsPerLevel, m_BitsPerLevel, ());
header.m_Levels = static_cast<uint8_t>(m_Levels);
ASSERT_EQUAL(header.m_Levels, m_Levels, ());
header.m_LeafBytes = static_cast<uint8_t>(m_LeafBytes);
ASSERT_EQUAL(header.m_LeafBytes, m_LeafBytes, ());
writer.Write(&header, sizeof(header));
}
@ -157,12 +160,14 @@ public:
if (bitmapSerial.size() <= listSerial.size())
{
sink.Write(&bitmapSerial[0], bitmapSerial.size());
return bitmapSerial.size();
ASSERT_EQUAL(bitmapSerial.size(), static_cast<uint32_t>(bitmapSerial.size()), ());
return static_cast<uint32_t>(bitmapSerial.size());
}
else
{
sink.Write(&listSerial[0], listSerial.size());
return listSerial.size();
ASSERT_EQUAL(listSerial.size(), static_cast<uint32_t>(listSerial.size()), ());
return static_cast<uint32_t>(listSerial.size());
}
}