From d181a2fb30ac73173fba851d4b2f7ca6f7d46ca0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Aug 2017 23:27:33 +0300 Subject: Remove useless variables. --- src/fs/virtfs/fsdir.cpp | 8 +++----- src/fs/virtfs/fszip.cpp | 3 +-- src/gui/windows/inventorywindow.cpp | 3 +-- src/net/ea/beingrecv.cpp | 3 +-- src/resources/image/subimage.cpp | 3 +-- src/resources/loaders/rescaledloader.cpp | 3 +-- src/resources/loaders/xmlloader.cpp | 3 +-- 7 files changed, 9 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/fs/virtfs/fsdir.cpp b/src/fs/virtfs/fsdir.cpp index be980ae65..f32cbba4b 100644 --- a/src/fs/virtfs/fsdir.cpp +++ b/src/fs/virtfs/fsdir.cpp @@ -76,8 +76,7 @@ namespace FsDir filename.c_str()); return nullptr; } - File *restrict const file = new File(&funcs, fd); - return file; + return new File(&funcs, fd); } File *openRead(FsEntry *restrict const entry, @@ -409,11 +408,10 @@ namespace FsDir return 0; } #ifdef USE_FILE_FOPEN - const int64_t pos = ftell(fd); + return ftell(fd); #else // USE_FILE_FOPEN - const int64_t pos = lseek(fd, 0, SEEK_CUR); + return lseek(fd, 0, SEEK_CUR); #endif // USE_FILE_FOPEN - return pos; } int seek(File *restrict const file, diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp index 148df66fc..fcb726173 100644 --- a/src/fs/virtfs/fszip.cpp +++ b/src/fs/virtfs/fszip.cpp @@ -557,10 +557,9 @@ namespace FsZip ZipReader::readFile(header); if (buf == nullptr) return nullptr; - File *restrict const file = new File(&funcs, + return new File(&funcs, buf, header->uncompressSize); - return file; } } return nullptr; diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 9fc6b6b38..27caa2019 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -934,9 +934,8 @@ InventoryWindow *InventoryWindow::getFirstVisible() if (((*it) != nullptr) && (*it)->isWindowVisible()) list.insert(*it); } - InventoryWindow *const window = dynamic_cast( + return dynamic_cast( windowContainer->findFirstWidget(list)); - return window; } void InventoryWindow::nextTab() diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp index bf7ae32ba..b2859d76f 100644 --- a/src/net/ea/beingrecv.cpp +++ b/src/net/ea/beingrecv.cpp @@ -513,9 +513,8 @@ Being *BeingRecv::createBeing(const BeingId id, else if (job == 45) type = ActorType::Portal; - Being *const being = actorManager->createBeing( + return actorManager->createBeing( id, type, fromInt(job, BeingTypeId)); - return being; } } // namespace Ea diff --git a/src/resources/image/subimage.cpp b/src/resources/image/subimage.cpp index 9eda05164..0b14b788e 100644 --- a/src/resources/image/subimage.cpp +++ b/src/resources/image/subimage.cpp @@ -227,8 +227,7 @@ void SubImage::decRef() int SubImage::calcMemoryLocal() const { - int sz = static_cast(sizeof(SubImage) + + return static_cast(sizeof(SubImage) + sizeof(std::map)) + Resource::calcMemoryLocal(); - return sz; } diff --git a/src/resources/loaders/rescaledloader.cpp b/src/resources/loaders/rescaledloader.cpp index cea73b382..e69814d27 100644 --- a/src/resources/loaders/rescaledloader.cpp +++ b/src/resources/loaders/rescaledloader.cpp @@ -71,7 +71,6 @@ Image *Loader::getRescaled(const Image *const image, const std::string idPath = image->mIdPath + strprintf( "_rescaled%dx%d", width, height); const RescaledLoader rl = { image, width, height }; - Image *const img = static_cast( + return static_cast( ResourceManager::get(idPath, RescaledLoader::load, &rl)); - return img; } diff --git a/src/resources/loaders/xmlloader.cpp b/src/resources/loaders/xmlloader.cpp index 2374e44d1..2d06d8128 100644 --- a/src/resources/loaders/xmlloader.cpp +++ b/src/resources/loaders/xmlloader.cpp @@ -44,10 +44,9 @@ namespace return nullptr; const ResourceLoader *const rl = static_cast(v); - Resource *const res = new XML::Document(rl->path, + return new XML::Document(rl->path, rl->useResman, rl->skipError); - return res; } }; -- cgit v1.2.3-70-g09d2