aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-04-15 14:00:56 +0200
committerAdrian Frühwirth2018-04-15 16:31:31 +0200
commit3747d852eecb9e510a0b5cf0d03674f657f1b9e0 (patch)
treea6c7d53c342c748b84cde84292d4d866597b9b94 /common
parentcaba18856914daac4339f040b39b7b73795c6310 (diff)
downloadscummvm-rg350-3747d852eecb9e510a0b5cf0d03674f657f1b9e0.tar.gz
scummvm-rg350-3747d852eecb9e510a0b5cf0d03674f657f1b9e0.tar.bz2
scummvm-rg350-3747d852eecb9e510a0b5cf0d03674f657f1b9e0.zip
JANITORIAL: Fix whitespace
Diffstat (limited to 'common')
-rw-r--r--common/archive.cpp2
-rw-r--r--common/config-manager.cpp4
-rw-r--r--common/config-manager.h4
-rw-r--r--common/fs.h2
-rw-r--r--common/hash-str.h8
-rw-r--r--common/hashmap.cpp8
-rw-r--r--common/hashmap.h12
-rw-r--r--common/list.h2
-rw-r--r--common/memorypool.cpp2
-rw-r--r--common/memstream.h4
-rw-r--r--common/recorderfile.cpp6
-rw-r--r--common/rect.h8
-rw-r--r--common/serializer.h10
-rw-r--r--common/str.cpp8
-rw-r--r--common/str.h2
-rw-r--r--common/stream.cpp6
-rw-r--r--common/updates.cpp2
-rw-r--r--common/updates.h2
-rw-r--r--common/ustr.cpp4
-rw-r--r--common/xmlparser.cpp2
-rw-r--r--common/zlib.cpp4
21 files changed, 48 insertions, 54 deletions
diff --git a/common/archive.cpp b/common/archive.cpp
index 5a339900b6..b4fc7c12c7 100644
--- a/common/archive.cpp
+++ b/common/archive.cpp
@@ -267,7 +267,7 @@ SeekableReadStream *SearchSet::createReadStreamForMember(const String &name) con
SearchManager::SearchManager() {
- clear(); // Force a reset
+ clear(); // Force a reset
}
void SearchManager::clear() {
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index fdd0c6f033..082f261f51 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -85,7 +85,7 @@ void ConfigManager::loadDefaultConfigFile() {
// Open the default config file
assert(g_system);
SeekableReadStream *stream = g_system->createConfigReadStream();
- _filename.clear(); // clear the filename to indicate that we are using the default config file
+ _filename.clear(); // clear the filename to indicate that we are using the default config file
// ... load it, if available ...
if (stream) {
@@ -321,7 +321,7 @@ void ConfigManager::flushToDisk() {
void ConfigManager::writeDomain(WriteStream &stream, const String &name, const Domain &domain) {
if (domain.empty())
- return; // Don't bother writing empty domains.
+ return; // Don't bother writing empty domains.
// WORKAROUND: Fix for bug #1972625 "ALL: On-the-fly targets are
// written to the config file": Do not save domains that came from
diff --git a/common/config-manager.h b/common/config-manager.h
index 669faaaf88..58f4373dde 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -171,7 +171,7 @@ public:
DomainMap::iterator beginGameDomains() { return _gameDomains.begin(); }
DomainMap::iterator endGameDomains() { return _gameDomains.end(); }
- static void defragment(); // move in memory to reduce fragmentation
+ static void defragment(); // move in memory to reduce fragmentation
void copyFrom(ConfigManager &source);
private:
@@ -185,7 +185,7 @@ private:
Domain _transientDomain;
DomainMap _gameDomains;
- DomainMap _miscDomains; // Any other domains
+ DomainMap _miscDomains; // Any other domains
Domain _appDomain;
Domain _defaultsDomain;
diff --git a/common/fs.h b/common/fs.h
index f516bf7a9c..ed287cc17a 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -269,7 +269,7 @@ public:
class FSDirectory : public Archive {
FSNode _node;
- String _prefix; // string that is prepended to each cache item key
+ String _prefix; // string that is prepended to each cache item key
void setPrefix(const String &prefix);
// Caches are case insensitive, clashes are dealt with when creating
diff --git a/common/hash-str.h b/common/hash-str.h
index 82af6cca93..fcd41ab6a7 100644
--- a/common/hash-str.h
+++ b/common/hash-str.h
@@ -29,11 +29,10 @@
namespace Common {
uint hashit(const char *str);
-uint hashit_lower(const char *str); // Generate a hash based on the lowercase version of the string
+uint hashit_lower(const char *str); // Generate a hash based on the lowercase version of the string
inline uint hashit(const String &str) { return hashit(str.c_str()); }
inline uint hashit_lower(const String &str) { return hashit_lower(str.c_str()); }
-
// FIXME: The following functors obviously are not consistently named
struct CaseSensitiveString_EqualTo {
@@ -53,8 +52,6 @@ struct IgnoreCase_Hash {
uint operator()(const String& x) const { return hashit_lower(x.c_str()); }
};
-
-
// Specalization of the Hash functor for String objects.
// We do case sensitve hashing here, because that is what
// the default EqualTo is compatible with. If one wants to use
@@ -78,9 +75,6 @@ struct Hash<const char *> {
// String map -- by default case insensitive
typedef HashMap<String, String, IgnoreCase_Hash, IgnoreCase_EqualTo> StringMap;
-
-
} // End of namespace Common
-
#endif
diff --git a/common/hashmap.cpp b/common/hashmap.cpp
index 99840993ce..e9eac9fc94 100644
--- a/common/hashmap.cpp
+++ b/common/hashmap.cpp
@@ -95,10 +95,10 @@ void updateHashCollisionStats(int collisions, int dummyHits, int lookups, int ar
g_size / g_totalHashmaps, g_max_size,
g_capacity / g_totalHashmaps, g_max_capacity);
debug(" %d less than %d; %d less than %d; %d less than %d; %d less than %d",
- g_stats[0], 2*8/3,
- g_stats[1],2*16/3,
- g_stats[2],2*32/3,
- g_stats[3],2*64/3);
+ g_stats[0], 2 * 8 / 3,
+ g_stats[1], 2 * 16 / 3,
+ g_stats[2], 2 * 32 / 3,
+ g_stats[3], 2 * 64 / 3);
// TODO:
// * Should record the maximal size of the map during its lifetime, not that at its death
diff --git a/common/hashmap.h b/common/hashmap.h
index d7ba100571..08651a8b01 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -355,7 +355,7 @@ HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
delete[] _storage;
#ifdef DEBUG_HASH_COLLISIONS
extern void updateHashCollisionStats(int, int, int, int, int);
- updateHashCollisionStats(_collisions, _dummyHits, _lookups, _mask+1, _size);
+ updateHashCollisionStats(_collisions, _dummyHits, _lookups, _mask + 1, _size);
#endif
}
@@ -369,9 +369,9 @@ HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t &map) {
_mask = map._mask;
- _storage = new Node *[_mask+1];
+ _storage = new Node *[_mask + 1];
assert(_storage != NULL);
- memset(_storage, 0, (_mask+1) * sizeof(Node *));
+ memset(_storage, 0, (_mask + 1) * sizeof(Node *));
// Simply clone the map given to us, one by one.
_size = 0;
@@ -418,7 +418,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::clear(bool shrinkArray) {
template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity) {
- assert(newCapacity > _mask+1);
+ assert(newCapacity > _mask + 1);
#ifndef NDEBUG
const size_type old_size = _size;
@@ -487,7 +487,7 @@ typename HashMap<Key, Val, HashFunc, EqualFunc>::size_type HashMap<Key, Val, Has
_lookups++;
debug("collisions %d, dummies hit %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d",
_collisions, _dummyHits, _lookups, ((double) _collisions / (double)_lookups),
- (const void *)this, _mask+1, _size);
+ (const void *)this, _mask + 1, _size);
#endif
return ctr;
@@ -525,7 +525,7 @@ typename HashMap<Key, Val, HashFunc, EqualFunc>::size_type HashMap<Key, Val, Has
_lookups++;
debug("collisions %d, dummies hit %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d",
_collisions, _dummyHits, _lookups, ((double) _collisions / (double)_lookups),
- (const void *)this, _mask+1, _size);
+ (const void *)this, _mask + 1, _size);
#endif
if (!found && first_free != _mask + 1)
diff --git a/common/list.h b/common/list.h
index 1bb4a2a5df..31cf161d22 100644
--- a/common/list.h
+++ b/common/list.h
@@ -170,7 +170,7 @@ public:
const_iterator i2;
const_iterator e2 = list.end();
- for (i = begin(), i2 = list.begin(); (i != e) && (i2 != e2) ; ++i, ++i2) {
+ for (i = begin(), i2 = list.begin(); (i != e) && (i2 != e2); ++i, ++i2) {
static_cast<Node *>(i._node)->_data = static_cast<const Node *>(i2._node)->_data;
}
diff --git a/common/memorypool.cpp b/common/memorypool.cpp
index 1a9bfe2e29..b947b38306 100644
--- a/common/memorypool.cpp
+++ b/common/memorypool.cpp
@@ -64,7 +64,7 @@ void MemoryPool::allocPage() {
// Allocate a new page
page.numChunks = _chunksPerPage;
- assert(page.numChunks * _chunkSize < 16*1024*1024); // Refuse to allocate pages bigger than 16 MB
+ assert(page.numChunks * _chunkSize < 16*1024*1024); // Refuse to allocate pages bigger than 16 MB
page.start = ::malloc(page.numChunks * _chunkSize);
assert(page.start);
diff --git a/common/memstream.h b/common/memstream.h
index f6bf990208..0d7375b6b5 100644
--- a/common/memstream.h
+++ b/common/memstream.h
@@ -289,8 +289,8 @@ public:
return dataSize;
}
- int32 pos() const { return _pos - _length; } //'read' position in the stream
- int32 size() const { return _size; } //that's also 'write' position in the stream, as it's append-only
+ int32 pos() const { return _pos - _length; } // 'read' position in the stream
+ int32 size() const { return _size; } // that's also 'write' position in the stream, as it's append-only
bool seek(int32, int) { return false; }
bool eos() const { return _eos; }
void clearErr() { _eos = false; }
diff --git a/common/recorderfile.cpp b/common/recorderfile.cpp
index 7552cd45b3..3db017ea8b 100644
--- a/common/recorderfile.cpp
+++ b/common/recorderfile.cpp
@@ -335,7 +335,7 @@ RecorderEvent PlaybackFile::getNextEvent() {
case kScreenShotTag:
_readStream->seek(-4, SEEK_CUR);
header.len = _readStream->readUint32BE();
- _readStream->skip(header.len-8);
+ _readStream->skip(header.len - 8);
break;
case kMD5Tag:
checkRecordedMD5();
@@ -575,7 +575,7 @@ int PlaybackFile::getScreensCount() {
int result = 0;
while (skipToNextScreenshot()) {
uint32 size = _readStream->readUint32BE();
- _readStream->skip(size-8);
+ _readStream->skip(size - 8);
++result;
}
return result;
@@ -612,7 +612,7 @@ Graphics::Surface *PlaybackFile::getScreenShot(int number) {
return Graphics::loadThumbnail(*_readStream, thumbnail) ? thumbnail : NULL;
} else {
uint32 size = _readStream->readUint32BE();
- _readStream->skip(size-8);
+ _readStream->skip(size - 8);
screenCount++;
}
}
diff --git a/common/rect.h b/common/rect.h
index 6c4292c7af..135076bf1e 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -40,10 +40,10 @@ struct Point {
Point() : x(0), y(0) {}
Point(int16 x1, int16 y1) : x(x1), y(y1) {}
- bool operator==(const Point &p) const { return x == p.x && y == p.y; }
- bool operator!=(const Point &p) const { return x != p.x || y != p.y; }
- Point operator+(const Point &delta) const { return Point(x + delta.x, y + delta.y); }
- Point operator-(const Point &delta) const { return Point(x - delta.x, y - delta.y); }
+ bool operator==(const Point &p) const { return x == p.x && y == p.y; }
+ bool operator!=(const Point &p) const { return x != p.x || y != p.y; }
+ Point operator+(const Point &delta) const { return Point(x + delta.x, y + delta.y); }
+ Point operator-(const Point &delta) const { return Point(x - delta.x, y - delta.y); }
void operator+=(const Point &delta) {
x += delta.x;
diff --git a/common/serializer.h b/common/serializer.h
index e8db40923a..18fb38563b 100644
--- a/common/serializer.h
+++ b/common/serializer.h
@@ -34,7 +34,7 @@ namespace Common {
template<typename T> \
void syncAs ## SUFFIX(T &val, Version minVersion = 0, Version maxVersion = kLastVersion) { \
if (_version < minVersion || _version > maxVersion) \
- return; \
+ return; \
if (_loadStream) \
val = static_cast<T>(_loadStream->read ## SUFFIX()); \
else { \
@@ -178,7 +178,7 @@ public:
*/
void skip(uint32 size, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return; // Ignore anything which is not supposed to be present in this save game version
+ return; // Ignore anything which is not supposed to be present in this save game version
_bytesSynced += size;
if (isLoading())
@@ -194,7 +194,7 @@ public:
*/
void syncBytes(byte *buf, uint32 size, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return; // Ignore anything which is not supposed to be present in this save game version
+ return; // Ignore anything which is not supposed to be present in this save game version
if (isLoading())
_loadStream->read(buf, size);
@@ -217,7 +217,7 @@ public:
*/
bool matchBytes(const char *magic, byte size, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return true; // Ignore anything which is not supposed to be present in this save game version
+ return true; // Ignore anything which is not supposed to be present in this save game version
bool match;
if (isSaving()) {
@@ -238,7 +238,7 @@ public:
*/
void syncString(String &str, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return; // Ignore anything which is not supposed to be present in this save game version
+ return; // Ignore anything which is not supposed to be present in this save game version
if (isLoading()) {
char c;
diff --git a/common/str.cpp b/common/str.cpp
index 2ef67175cd..7d40aebf94 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -63,7 +63,7 @@ void String::initWithCStr(const char *str, uint32 len) {
if (len >= _builtinCapacity) {
// Not enough internal storage, so allocate more
- _extern._capacity = computeCapacity(len+1);
+ _extern._capacity = computeCapacity(len + 1);
_extern._refCount = 0;
_str = new char[_extern._capacity];
assert(_str != 0);
@@ -593,7 +593,7 @@ String String::vformat(const char *fmt, va_list args) {
// vsnprintf didn't have enough space, so grow buffer
output.ensureCapacity(len, false);
scumm_va_copy(va, args);
- int len2 = vsnprintf(output._str, len+1, fmt, va);
+ int len2 = vsnprintf(output._str, len + 1, fmt, va);
va_end(va);
assert(len == len2);
output._size = len2;
@@ -741,7 +741,7 @@ String lastPathComponent(const String &path, const char sep) {
const char *last = str + path.size();
// Skip over trailing slashes
- while (last > str && *(last-1) == sep)
+ while (last > str && *(last - 1) == sep)
--last;
// Path consisted of only slashes -> return empty string
@@ -1010,7 +1010,7 @@ int scumm_strnicmp(const char *s1, const char *s2, uint n) {
byte l1, l2;
do {
if (n-- == 0)
- return 0; // no difference found so far -> signal equality
+ return 0; // no difference found so far -> signal equality
// Don't use ++ inside tolower, in case the macro uses its
// arguments more than once.
diff --git a/common/str.h b/common/str.h
index fd77fa90c8..cf7fc34f6b 100644
--- a/common/str.h
+++ b/common/str.h
@@ -285,7 +285,7 @@ public:
* except that it stores the result in (variably sized) String
* instead of a fixed size buffer.
*/
- static String format(const char *fmt, ...) GCC_PRINTF(1,2);
+ static String format(const char *fmt, ...) GCC_PRINTF(1, 2);
/**
* Print formatted data into a String object. Similar to vsprintf,
diff --git a/common/stream.cpp b/common/stream.cpp
index 8d93888020..0a5fa94ac3 100644
--- a/common/stream.cpp
+++ b/common/stream.cpp
@@ -99,7 +99,7 @@ bool MemoryReadStream::seek(int32 offs, int whence) {
// Reset end-of-stream flag on a successful seek
_eos = false;
- return true; // FIXME: STREAM REWRITE
+ return true; // FIXME: STREAM REWRITE
}
bool MemoryWriteStreamDynamic::seek(int32 offs, int whence) {
@@ -124,7 +124,7 @@ bool MemoryWriteStreamDynamic::seek(int32 offs, int whence) {
// Post-Condition
assert(_pos <= _size);
- return true; // FIXME: STREAM REWRITE
+ return true; // FIXME: STREAM REWRITE
}
#pragma mark -
@@ -413,7 +413,7 @@ BufferedSeekableReadStream::BufferedSeekableReadStream(SeekableReadStream *paren
bool BufferedSeekableReadStream::seek(int32 offset, int whence) {
// If it is a "local" seek, we may get away with "seeking" around
// in the buffer only.
- _eos = false; // seeking always cancels EOS
+ _eos = false; // seeking always cancels EOS
int relOffset = 0;
switch (whence) {
diff --git a/common/updates.cpp b/common/updates.cpp
index 087002a7d3..4e4ed53b8f 100644
--- a/common/updates.cpp
+++ b/common/updates.cpp
@@ -47,7 +47,7 @@ int UpdateManager::normalizeInterval(int interval) {
val++;
}
- return val[-1]; // Return maximal acceptable value
+ return val[-1]; // Return maximal acceptable value
}
const char *UpdateManager::updateIntervalToString(int interval) {
diff --git a/common/updates.h b/common/updates.h
index 3a3049d4df..812aac718e 100644
--- a/common/updates.h
+++ b/common/updates.h
@@ -50,7 +50,7 @@ public:
kUpdateIntervalNotSupported = 0,
kUpdateIntervalOneDay = 86400,
kUpdateIntervalOneWeek = 604800,
- kUpdateIntervalOneMonth = 2628000 // average seconds per month (60*60*24*365)/12
+ kUpdateIntervalOneMonth = 2628000 // average seconds per month (60*60*24*365)/12
};
UpdateManager() {}
diff --git a/common/ustr.cpp b/common/ustr.cpp
index 35b5502a6d..e5c674f595 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -239,7 +239,7 @@ void U32String::ensureCapacity(uint32 new_size, bool keep_old) {
if (new_size < curCapacity)
newCapacity = curCapacity;
else
- newCapacity = MAX(curCapacity * 2, computeCapacity(new_size+1));
+ newCapacity = MAX(curCapacity * 2, computeCapacity(new_size + 1));
// Allocate new storage
newStorage = new value_type[newCapacity];
@@ -316,7 +316,7 @@ void U32String::initWithCStr(const value_type *str, uint32 len) {
if (len >= _builtinCapacity) {
// Not enough internal storage, so allocate more
- _extern._capacity = computeCapacity(len+1);
+ _extern._capacity = computeCapacity(len + 1);
_extern._refCount = 0;
_str = new value_type[_extern._capacity];
assert(_str != 0);
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp
index 4470180710..84646ffa95 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -373,7 +373,7 @@ bool XMLParser::parse() {
break;
}
} else {
- ParserNode *node = allocNode(); //new ParserNode;
+ ParserNode *node = allocNode(); // new ParserNode;
node->name = _token;
node->ignore = false;
node->header = activeHeader;
diff --git a/common/zlib.cpp b/common/zlib.cpp
index 39130beb4e..8ea5d6c424 100644
--- a/common/zlib.cpp
+++ b/common/zlib.cpp
@@ -281,7 +281,7 @@ public:
_wrapped->seek(0, SEEK_SET);
_zlibErr = inflateReset(&_stream);
if (_zlibErr != Z_OK)
- return false; // FIXME: STREAM REWRITE
+ return false; // FIXME: STREAM REWRITE
_stream.next_in = _buf;
_stream.avail_in = 0;
}
@@ -297,7 +297,7 @@ public:
}
_eos = false;
- return true; // FIXME: STREAM REWRITE
+ return true; // FIXME: STREAM REWRITE
}
};