Fix errors about string iteration on gcc/linux builds

This commit is contained in:
Twan van Laarhoven
2020-04-16 00:32:11 +02:00
parent eadf39cf83
commit a8d78fc28c
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -174,7 +174,7 @@ String canonical_name_form(const String& str) {
bool leading = true;
FOR_EACH_CONST(c, str) {
if ((c == _('_') || c == _(' '))) {
ret += leading ? c : _(' ');
ret += leading ? c : wxUniChar(' ');
} else {
ret += c;
leading = false;
@@ -367,10 +367,7 @@ bool smart_equal(const String& sa, const String& sb) {
bool starts_with(const String& str, const String& start) {
if (str.size() < start.size()) return false;
FOR_EACH_2_CONST(a, str, b, start) {
if (a != b) return false;
}
return true;
return equal(start.begin(), start.end(), str.begin());
}
bool is_substr(const String& str, size_t pos, const Char* cmp) {
+1 -1
View File
@@ -634,7 +634,7 @@ bool is_space_like(Char c) {
String curly_quotes(String str, bool curl) {
bool open = true, in_tag = false;
FOR_EACH(c, str) {
for (wxUniCharRef c : str) {
if (c == _('\'') || c == LEFT_SINGLE_QUOTE || c == RIGHT_SINGLE_QUOTE) {
c = curl ? (open ? LEFT_SINGLE_QUOTE : RIGHT_SINGLE_QUOTE) : _('\'');
} else if (c == _('\"') || c == LEFT_DOUBLE_QUOTE || c == RIGHT_DOUBLE_QUOTE) {