diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2021-02-01 11:06:47 +0200 | 
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2021-02-06 16:28:57 +0200 | 
| commit | 2ac45198cf101f094cf8d94f3a546a57624e59f5 (patch) | |
| tree | d833a07af98f3897945706e84c50c0c92d7f5f66 /src | |
| parent | 081f559031fed7cde755e006b226cf06f33bd0f8 (diff) | |
| download | kconfig-2ac45198cf101f094cf8d94f3a546a57624e59f5.tar.gz kconfig-2ac45198cf101f094cf8d94f3a546a57624e59f5.tar.bz2 | |
Preincerment/predecrement operator where the post ones aren't needed
NO_CHANGELOG
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/bufferfragment_p.h | 8 | ||||
| -rw-r--r-- | src/core/kconfig.cpp | 8 | ||||
| -rw-r--r-- | src/core/kconfigini.cpp | 19 | ||||
| -rw-r--r-- | src/kconf_update/kconf_update.cpp | 2 | 
4 files changed, 19 insertions, 18 deletions
| diff --git a/src/core/bufferfragment_p.h b/src/core/bufferfragment_p.h index ba100ef7..3edbb6b6 100644 --- a/src/core/bufferfragment_p.h +++ b/src/core/bufferfragment_p.h @@ -64,11 +64,11 @@ public:      void trim()      {          while (bf_isspace(*d) && len > 0) { -            d++; -            len--; +            ++d; +            --len;          }          while (len > 0 && bf_isspace(d[len - 1])) { -            len--; +            --len;          }      } @@ -160,7 +160,7 @@ public:              if (d[from] == c) {                  return from;              } else { -                from--; +                --from;              }          return -1;      } diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 04608b0d..ed389ea3 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -177,16 +177,16 @@ QString KConfigPrivate::expandString(const QString &value)              QStringRef aVarName;              if (aValue[nEndPos] == QLatin1Char('{')) {                  while ((nEndPos <= aValue.length()) && (aValue[nEndPos] != QLatin1Char('}'))) { -                    nEndPos++; +                    ++nEndPos;                  } -                nEndPos++; +                ++nEndPos;                  aVarName = aValue.midRef(nDollarPos + 2, nEndPos - nDollarPos - 3);              } else {                  while (nEndPos < aValue.length() &&                          (aValue[nEndPos].isNumber() ||                           aValue[nEndPos].isLetter() ||                           aValue[nEndPos] == QLatin1Char('_'))) { -                    nEndPos++; +                    ++nEndPos;                  }                  aVarName = aValue.midRef(nDollarPos + 1, nEndPos - nDollarPos - 1);              } @@ -219,7 +219,7 @@ QString KConfigPrivate::expandString(const QString &value)          } else {              // remove one of the dollar signs              aValue.remove(nDollarPos, 1); -            nDollarPos++; +            ++nDollarPos;          }          nDollarPos = aValue.indexOf(QLatin1Char('$'), nDollarPos);      } diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index b5f40373..96cd3763 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -111,7 +111,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry      while (startOfLine < len) {          BufferFragment line = contents.split('\n', &startOfLine);          line.trim(); -        lineNo++; +        ++lineNo;          // skip empty lines and lines beginning with '#'          if (line.isEmpty() || line.at(0) == '#') { @@ -122,7 +122,8 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry              groupOptionImmutable = fileOptionImmutable;              QByteArray newGroup; -            int start = 1, end; +            int start = 1; +            int end = 0;              do {                  end = start;                  for (;;) { @@ -134,7 +135,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry                      if (line.at(end) == ']') {                          break;                      } -                    end++; +                    ++end;                  }                  if (end + 1 == line.length() && start + 2 == end &&                          line.at(start) == '$' && line.at(start + 1) == 'i') { @@ -224,7 +225,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry                          default:                              break;                          } -                        i++; +                        ++i;                      }                  } else { // found a locale                      if (!locale.isNull()) { @@ -333,7 +334,7 @@ void KConfigIniBackend::writeEntries(const QByteArray &locale, QIODevice &file,                              }                          }                          file.write("\\x24"); -                        start++; +                        ++start;                      }                  nope:                      file.write(stringToPrintable(currentGroup.mid(start), GroupString)); @@ -758,7 +759,7 @@ QByteArray KConfigIniBackend::stringToPrintable(const QByteArray &aString, Strin      if (s[0] == ' ' && type != GroupString) {          *data++ = '\\';          *data++ = 's'; -        i++; +        ++i;      }      Utf8Char utf8; @@ -869,7 +870,7 @@ void KConfigIniBackend::printableToString(BufferFragment *aString, const QFile &              *r = str[i];          } else {              // Probable escape sequence -            i++; +            ++i;              if (i >= l) { // Line ends after backslash - stop.                  *r = '\\';                  break; @@ -894,13 +895,13 @@ void KConfigIniBackend::printableToString(BufferFragment *aString, const QFile &              case ';':                  // not really an escape sequence, but allowed in .desktop files, don't strip '\;' from the string                  *r = '\\'; -                r++; +                ++r;                  *r = ';';                  break;              case ',':                  // not really an escape sequence, but allowed in .desktop files, don't strip '\,' from the string                  *r = '\\'; -                r++; +                ++r;                  *r = ',';                  break;              case 'x': diff --git a/src/kconf_update/kconf_update.cpp b/src/kconf_update/kconf_update.cpp index 08b4e224..a1a1ac72 100644 --- a/src/kconf_update/kconf_update.cpp +++ b/src/kconf_update/kconf_update.cpp @@ -327,7 +327,7 @@ bool KonfUpdate::updateFile(const QString &filename)          if (m_line.startsWith(QLatin1String("Version=5"))) {              foundVersion = true;          } -        m_lineCount++; +        ++m_lineCount;          if (m_line.isEmpty() || (m_line[0] == QLatin1Char('#'))) {              continue;          } | 
