[Scummvm-git-logs] scummvm master -> 0d7ab6cd64183ed824db89477996a9e6c001012b
phcoder
phcoder at gmail.com
Sun Nov 1 14:19:46 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0d7ab6cd64 COMMON: compilation fix on some older compilers
Commit: 0d7ab6cd64183ed824db89477996a9e6c001012b
https://github.com/scummvm/scummvm/commit/0d7ab6cd64183ed824db89477996a9e6c001012b
Author: Vladimir Serbinenko (phcoder at google.com)
Date: 2020-11-01T14:58:46+01:00
Commit Message:
COMMON: compilation fix on some older compilers
Changed paths:
common/base-str.cpp
diff --git a/common/base-str.cpp b/common/base-str.cpp
index 9a2fb7ffd2..09bed97409 100644
--- a/common/base-str.cpp
+++ b/common/base-str.cpp
@@ -420,17 +420,17 @@ TEMPLATE bool BASESTRING::contains(const BaseString &otherString) const {
return false;
}
- uint32 size = 0;
- BaseString::const_iterator itr = otherString.begin();
+ uint32 sizeMatch = 0;
+ typename BASESTRING::const_iterator itr = otherString.begin();
- for (BaseString::const_iterator itr2 = begin(); itr != otherString.end() && itr2 != end(); itr2++) {
+ for (typename BASESTRING::const_iterator itr2 = begin(); itr != otherString.end() && itr2 != end(); itr2++) {
if (*itr == *itr2) {
itr++;
- size++;
- if (size == otherString.size())
+ sizeMatch++;
+ if (sizeMatch == otherString.size())
return true;
} else {
- size = 0;
+ sizeMatch = 0;
itr = otherString.begin();
}
}
@@ -790,11 +790,11 @@ TEMPLATE uint BASESTRING::getUnsignedValue(uint pos) const {
// Hash function for strings, taken from CPython.
TEMPLATE uint BASESTRING::hash() const {
- uint hash = getUnsignedValue(0) << 7;
+ uint hashResult = getUnsignedValue(0) << 7;
for (uint i = 0; i < _size; i++) {
- hash = (1000003 * hash) ^ getUnsignedValue(i);
+ hashResult = (1000003 * hashResult) ^ getUnsignedValue(i);
}
- return hash ^ _size;
+ return hashResult ^ _size;
}
template class BaseString<char>;
More information about the Scummvm-git-logs
mailing list