Committed by
GitHub
Fix isspace on windows in debug build (#2042)
正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -312,7 +312,7 @@ static std::vector<std::string> MergeCharactersIntoWords( | @@ -312,7 +312,7 @@ static std::vector<std::string> MergeCharactersIntoWords( | ||
| 312 | while (i < n) { | 312 | while (i < n) { |
| 313 | const auto &w = words[i]; | 313 | const auto &w = words[i]; |
| 314 | if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) || | 314 | if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) || |
| 315 | - (w.size() == 1 && (IsPunct(w[0]) || std::isspace(w[0])))) { | 315 | + (w.size() == 1 && (IsPunct(w[0]) || std::isspace(static_cast<uint8_t>(w[0]))))) { |
| 316 | if (prev != -1) { | 316 | if (prev != -1) { |
| 317 | std::string t; | 317 | std::string t; |
| 318 | for (; prev < i; ++prev) { | 318 | for (; prev < i; ++prev) { |
| @@ -322,7 +322,7 @@ static std::vector<std::string> MergeCharactersIntoWords( | @@ -322,7 +322,7 @@ static std::vector<std::string> MergeCharactersIntoWords( | ||
| 322 | ans.push_back(std::move(t)); | 322 | ans.push_back(std::move(t)); |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | - if (!std::isspace(w[0])) { | 325 | + if (!std::isspace(static_cast<uint8_t>(w[0]))) { |
| 326 | ans.push_back(w); | 326 | ans.push_back(w); |
| 327 | } | 327 | } |
| 328 | ++i; | 328 | ++i; |
-
请 注册 或 登录 后发表评论