From f3b83d2c8b36e001569ce5944ea77fbb322dd4a7 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Mon, 4 Nov 2019 19:49:09 +0700 Subject: [PATCH] Fix formatting in TxCache.cpp --- src/GLideNHQ/TxCache.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/GLideNHQ/TxCache.cpp b/src/GLideNHQ/TxCache.cpp index 539262d7..21cb8385 100644 --- a/src/GLideNHQ/TxCache.cpp +++ b/src/GLideNHQ/TxCache.cpp @@ -104,8 +104,8 @@ private: }; TxMemoryCache::TxMemoryCache(uint32 & options, - uint64 cacheLimit, - dispInfoFuncExt callback) + uint64 cacheLimit, + dispInfoFuncExt callback) : _options(options) , _cacheLimit(cacheLimit) , _callback(callback) @@ -156,8 +156,7 @@ bool TxMemoryCache::add(Checksum checksum, GHQTexInfo *info, int dataSize) if (compress2(dest, &destLen, info->data, dataSize, 1) != Z_OK) { dest = info->data; DBG_INFO(80, wst("Error: zlib compression failed!\n")); - } - else { + } else { DBG_INFO(80, wst("zlib compressed: %.02fkb->%.02fkb\n"), (float)dataSize / 1000, (float)destLen / 1000); dataSize = destLen; format |= GL_TEXFMT_GZ; @@ -165,7 +164,7 @@ bool TxMemoryCache::add(Checksum checksum, GHQTexInfo *info, int dataSize) } } - /* if cache size exceeds limit, remove old cache */ + /* if cache size exceeds limit, remove old cache */ if (_cacheLimit != 0) { _totalSize += dataSize; if ((_totalSize > _cacheLimit) && !_cachelist.empty()) { @@ -410,8 +409,7 @@ bool TxMemoryCache::load(const wchar_t *path, const wchar_t *filename, int confi add(checksum, &tmpInfo, (tmpInfo.format & GL_TEXFMT_GZ) ? dataSize : 0); free(tmpInfo.data); - } - else { + } else { gzseek(gzfp, dataSize, SEEK_CUR); } @@ -510,7 +508,7 @@ private: uint32 _options; tx_wstring _cachePath; - tx_wstring _filename; + tx_wstring _filename; std::string _fullPath; dispInfoFuncExt _callback; uint64 _totalSize = 0; @@ -522,8 +520,8 @@ private: uint8 *_gzdest1 = nullptr; uint32 _gzdestLen = 0; - std::ifstream _infile; - std::ofstream _outfile; + std::ifstream _infile; + std::ofstream _outfile; int64 _storagePos = 0; bool _dirty = false; static const int _fakeConfig; @@ -564,9 +562,9 @@ TxFileStorage::TxFileStorage(uint32 & options, void TxFileStorage::buildFullPath() { - char cbuf[MAX_PATH*2]; + char cbuf[MAX_PATH * 2]; tx_wstring filename = _cachePath + OSAL_DIR_SEPARATOR_STR + _filename; - wcstombs(cbuf, filename.c_str(), MAX_PATH*2); + wcstombs(cbuf, filename.c_str(), MAX_PATH * 2); _fullPath = cbuf; } @@ -670,8 +668,7 @@ bool TxFileStorage::readData(GHQTexInfo & info) info.data = _gzdest1; info.format &= ~GL_TEXFMT_GZ; DBG_INFO(80, wst("zlib decompressed: %.02gkb->%.02gkb\n"), dataSize / 1024.0, destLen / 1024.0); - } - else { + } else { info.data = _gzdest0; } @@ -713,8 +710,7 @@ bool TxFileStorage::add(Checksum checksum, GHQTexInfo *info, int dataSize) if (compress2(dest, &destLen, info->data, dataSize, 1) != Z_OK) { dest = info->data; DBG_INFO(80, wst("Error: zlib compression failed!\n")); - } - else { + } else { DBG_INFO(80, wst("zlib compressed: %.02fkb->%.02fkb\n"), dataSize / 1024.0, destLen / 1024.0); dataSize = destLen; format |= GL_TEXFMT_GZ; @@ -825,7 +821,7 @@ bool TxFileStorage::load(const wchar_t *path, const wchar_t *filename, int confi if (tmpconfig == _fakeConfig) { if (_storagePos != _initialPos) return false; - } else if (tmpconfig != config && !force) + } else if (tmpconfig != config && !force) return false; if (_storagePos <= sizeof(config) + sizeof(_storagePos))