diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/archive.cpp | 2 | ||||
-rw-r--r-- | common/config-manager.cpp | 4 | ||||
-rw-r--r-- | common/config-manager.h | 4 | ||||
-rw-r--r-- | common/fs.h | 2 | ||||
-rw-r--r-- | common/hash-str.h | 8 | ||||
-rw-r--r-- | common/hashmap.cpp | 8 | ||||
-rw-r--r-- | common/hashmap.h | 12 | ||||
-rw-r--r-- | common/language.cpp | 2 | ||||
-rw-r--r-- | common/list.h | 2 | ||||
-rw-r--r-- | common/memorypool.cpp | 2 | ||||
-rw-r--r-- | common/memstream.h | 4 | ||||
-rw-r--r-- | common/recorderfile.cpp | 9 | ||||
-rw-r--r-- | common/rect.h | 8 | ||||
-rw-r--r-- | common/scummsys.h | 12 | ||||
-rw-r--r-- | common/serializer.h | 10 | ||||
-rw-r--r-- | common/str.cpp | 8 | ||||
-rw-r--r-- | common/str.h | 2 | ||||
-rw-r--r-- | common/stream.cpp | 6 | ||||
-rw-r--r-- | common/unzip.cpp | 32 | ||||
-rw-r--r-- | common/updates.cpp | 2 | ||||
-rw-r--r-- | common/updates.h | 2 | ||||
-rw-r--r-- | common/ustr.cpp | 4 | ||||
-rw-r--r-- | common/xmlparser.cpp | 2 | ||||
-rw-r--r-- | common/zlib.cpp | 4 |
24 files changed, 79 insertions, 72 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/language.cpp b/common/language.cpp index b7397bec6d..e4ecd28211 100644 --- a/common/language.cpp +++ b/common/language.cpp @@ -46,7 +46,7 @@ const LanguageDescription g_languages[] = { { "jp", "ja_JP", "Japanese", JA_JPN }, { "kr", "ko_KR", "Korean", KO_KOR }, { "lv", "lv_LV", "Latvian", LV_LAT }, - { "nb", "nb_NO", "Norwegian Bokm\xE5l", NB_NOR }, // TODO Someone should verify the unix locale + { "nb", "nb_NO", "Norwegian Bokm\xE5l", NB_NOR }, { "pl", "pl_PL", "Polish", PL_POL }, { "br", "pt_BR", "Portuguese", PT_BRA }, { "ru", "ru_RU", "Russian", RU_RUS }, 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 1f283715d0..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; @@ -608,10 +608,11 @@ Graphics::Surface *PlaybackFile::getScreenShot(int number) { if (screenCount == number) { screenCount++; _readStream->seek(-4, SEEK_CUR); - return Graphics::loadThumbnail(*_readStream); + Graphics::Surface *thumbnail; + 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/scummsys.h b/common/scummsys.h index 5486ba27c6..ce54f3b50e 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -398,6 +398,18 @@ #endif #endif +#ifndef WARN_UNUSED_RESULT + #if __cplusplus >= 201703L + #define WARN_UNUSED_RESULT [[nodiscard]] + #elif GCC_ATLEAST(3, 4) + #define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #elif defined(_Check_return_) + #define WARN_UNUSED_RESULT _Check_return_ + #else + #define WARN_UNUSED_RESULT + #endif +#endif + #ifndef STRINGBUFLEN #if defined(__N64__) || defined(__DS__) || defined(__3DS__) #define STRINGBUFLEN 256 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/unzip.cpp b/common/unzip.cpp index 1f4e601989..f585eb387d 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -485,13 +485,13 @@ static uLong unzlocal_SearchCentralDir(Common::SeekableReadStream &fin) { uBackRead = 4; while (uBackRead<uMaxBack) { - uLong uReadSize,uReadPos ; + uLong uReadSize,uReadPos; int i; if (uBackRead+BUFREADCOMMENT>uMaxBack) uBackRead = uMaxBack; else uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; + uReadPos = uSizeFile-uBackRead; uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); @@ -670,13 +670,13 @@ int unzGetGlobalInfo(unzFile file, unz_global_info *pglobal_info) { static void unzlocal_DosDateToTmuDate(uLong ulDosDate, tm_unz* ptm) { uLong uDate; uDate = (uLong)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + ptm->tm_mday = (uInt)(uDate&0x1f); + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1); + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980); ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20); + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)); } /* @@ -772,7 +772,7 @@ static int unzlocal_GetCurrentFileInfoInternal(unzFile file, lSeek+=file_info.size_filename; if ((err==UNZ_OK) && (szFileName!=NULL)) { - uLong uSizeRead ; + uLong uSizeRead; if (file_info.size_filename<fileNameBufferSize) { *(szFileName+file_info.size_filename)='\0'; uSizeRead = file_info.size_filename; @@ -787,7 +787,7 @@ static int unzlocal_GetCurrentFileInfoInternal(unzFile file, if ((err==UNZ_OK) && (extraField!=NULL)) { - uLong uSizeRead ; + uLong uSizeRead; if (file_info.size_file_extra<extraFieldBufferSize) uSizeRead = file_info.size_file_extra; else @@ -810,7 +810,7 @@ static int unzlocal_GetCurrentFileInfoInternal(unzFile file, if ((err==UNZ_OK) && (szComment!=NULL)) { - uLong uSizeRead ; + uLong uSizeRead; if (file_info.size_file_comment<commentBufferSize) { *(szComment+file_info.size_file_comment)='\0'; uSizeRead = file_info.size_file_comment; @@ -897,7 +897,7 @@ int unzGoToNextFile(unzFile file) { return UNZ_END_OF_LIST_OF_FILE; s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment; s->num_file++; err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, &s->cur_file_info_internal, @@ -1185,11 +1185,11 @@ int unzReadCurrentFile(unzFile file, voidp buf, unsigned len) { } if (pfile_in_zip_read_info->compression_method==0) { - uInt uDoCopy,i ; + uInt uDoCopy,i; if (pfile_in_zip_read_info->stream.avail_out < pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + uDoCopy = pfile_in_zip_read_info->stream.avail_out; else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + uDoCopy = pfile_in_zip_read_info->stream.avail_in; for (i=0;i<uDoCopy;i++) *(pfile_in_zip_read_info->stream.next_out+i) = *(pfile_in_zip_read_info->stream.next_in+i); @@ -1327,7 +1327,7 @@ int unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len) { if (len>size_to_read) read_now = (uInt)size_to_read; else - read_now = (uInt)len ; + read_now = (uInt)len; if (read_now==0) return 0; @@ -1392,7 +1392,7 @@ int unzCloseCurrentFile(unzFile file) { */ int unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf) { unz_s* s; - uLong uReadThis ; + uLong uReadThis; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; 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 } }; |