From d3846ba757c740caf2f715621ec14ca6e8099190 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 23 Aug 2023 11:41:52 +0300 Subject: [PATCH] MSVC warnings. --- .../vdxf/libdxfrw/intern/drw_textcodec.cpp | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/libs/vdxf/libdxfrw/intern/drw_textcodec.cpp b/src/libs/vdxf/libdxfrw/intern/drw_textcodec.cpp index 6965eb644..8bdd0687b 100644 --- a/src/libs/vdxf/libdxfrw/intern/drw_textcodec.cpp +++ b/src/libs/vdxf/libdxfrw/intern/drw_textcodec.cpp @@ -332,8 +332,8 @@ auto DRW_ConvTable::toUtf8(const std::string &s) -> std::string } } else - { // end c < 0x80 - res += encodeNum(table[c - 0x80]); // translate from table + { // end c < 0x80 + res += encodeNum(table[static_cast(c - 0x80)]); // translate from table } } // end for @@ -501,7 +501,9 @@ template auto DRW_ConvDBCSTable::toUtf } } else + { res += static_cast(c); // c!='\' ascii char write + } } else if (c == 0x80) { // 1 byte table @@ -512,9 +514,9 @@ template auto DRW_ConvDBCSTable::toUtf { // 2 bytes ++it; int code = (c << 8) | static_cast(*it); - int sta = leadTable[c - 0x81]; - int end = leadTable[c - 0x80]; - for (size_t k = static_cast(sta); k < static_cast(end); k++) + int sta = leadTable[static_cast(c - 0x81)]; + int end = leadTable[static_cast(c - 0x80)]; + for (auto k = static_cast(sta); k < static_cast(end); k++) { if (doubleTable[k][0] == code) { @@ -627,13 +629,13 @@ auto DRW_Conv932Table::toUtf8(const std::string &s) -> std::string int end = 0; if (c > 0x80 && c < 0xA0) { - sta = DRW_LeadTable932[c - 0x81]; - end = DRW_LeadTable932[c - 0x80]; + sta = DRW_LeadTable932[static_cast(c - 0x81)]; + end = DRW_LeadTable932[static_cast(c - 0x80)]; } else if (c > 0xDF && c < 0xFD) { - sta = DRW_LeadTable932[c - 0xC1]; - end = DRW_LeadTable932[c - 0xC0]; + sta = DRW_LeadTable932[static_cast(c - 0xC1)]; + end = DRW_LeadTable932[static_cast(c - 0xC0)]; } if (end > 0) {