diff --git a/ZRColaCompile/dbsource.h b/ZRColaCompile/dbsource.h index 1ff7b7a..2491122 100644 --- a/ZRColaCompile/dbsource.h +++ b/ZRColaCompile/dbsource.h @@ -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")); 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.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.idxRank .push_back(idx); diff --git a/lib/libZRCola/src/tag.cpp b/lib/libZRCola/src/tag.cpp index 94b56d5..3d3be1e 100644 --- a/lib/libZRCola/src/tag.cpp +++ b/lib/libZRCola/src/tag.cpp @@ -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); if (idx == hits.end()) { // New tag. - hits.insert(std::make_pair(val.tag, 1)); + hits.insert(std::make_pair(val.tag, (unsigned __int16)1)); } else { // Increase count for existing tag. idx->second++;