Make explicit int to unsigned __int6 conversion

This commit is contained in:
Simon Rozman 2018-09-07 19:36:10 +02:00
parent 4226774e21
commit 59d06ae3dc
2 changed files with 6 additions and 2 deletions

View File

@ -936,7 +936,11 @@ inline ZRCola::transeq_db& operator<<(_Inout_ ZRCola::transeq_db &db, _In_ const
wxASSERT_MSG(n <= 0xffff, wxT("translation sequence sets overflow")); wxASSERT_MSG(n <= 0xffff, wxT("translation sequence sets overflow"));
db.data.push_back((unsigned __int16)n); db.data.push_back((unsigned __int16)n);
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend()); db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
db.data.insert(db.data.end(), rec.sets.cbegin(), rec.sets.cend()); for (auto s = rec.sets.cbegin(), s_end = rec.sets.cend(); s != s_end; ++s) {
int val = *s;
wxASSERT_MSG(val <= 0xffff, wxT("translation sequence ID overflow"));
db.data.push_back((unsigned __int16)val);
}
db.idxTranSeq.push_back(idx); db.idxTranSeq.push_back(idx);
db.idxRank .push_back(idx); db.idxRank .push_back(idx);

View File

@ -106,7 +106,7 @@ bool ZRCola::tagname_db::Search(_In_z_ const wchar_t *str, _In_ LCID locale, _In
auto idx = hits.find(val.tag); auto idx = hits.find(val.tag);
if (idx == hits.end()) { if (idx == hits.end()) {
// New tag. // New tag.
hits.insert(std::make_pair(val.tag, 1)); hits.insert(std::make_pair(val.tag, (unsigned __int16)1));
} else { } else {
// Increase count for existing tag. // Increase count for existing tag.
idx->second++; idx->second++;