diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-26 00:51:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-11-27 20:33:15 +0300 |
commit | 0c20db8d108c4123fcc3ecb343759e68567a4d4e (patch) | |
tree | f577edeae7b4866d68c084a1eaa229e98c80ea8f /src/fs/virtfs | |
parent | 2be4fc5b4eee97938657c9c8be73c4b91c8b9826 (diff) | |
download | manaverse-0c20db8d108c4123fcc3ecb343759e68567a4d4e.tar.gz manaverse-0c20db8d108c4123fcc3ecb343759e68567a4d4e.tar.bz2 manaverse-0c20db8d108c4123fcc3ecb343759e68567a4d4e.tar.xz manaverse-0c20db8d108c4123fcc3ecb343759e68567a4d4e.zip |
Remove extra ; from different code.
Diffstat (limited to 'src/fs/virtfs')
-rw-r--r-- | src/fs/virtfs/fs.cpp | 66 | ||||
-rw-r--r-- | src/fs/virtfs/fsdir.cpp | 32 | ||||
-rw-r--r-- | src/fs/virtfs/fsdirrwops.cpp | 12 | ||||
-rw-r--r-- | src/fs/virtfs/fszip.cpp | 6 | ||||
-rw-r--r-- | src/fs/virtfs/rwops.cpp | 2 | ||||
-rw-r--r-- | src/fs/virtfs/zipreader.cpp | 28 |
6 files changed, 73 insertions, 73 deletions
diff --git a/src/fs/virtfs/fs.cpp b/src/fs/virtfs/fs.cpp index c4faf02ed..697f28579 100644 --- a/src/fs/virtfs/fs.cpp +++ b/src/fs/virtfs/fs.cpp @@ -42,9 +42,9 @@ const char *dirSeparator = nullptr; #ifdef UNITTESTS -#define reportNonTests logger->log +#define reportNonTests(a, b) logger->log(a, b); #else // UNITTESTS -#define reportNonTests reportAlways +#define reportNonTests(a, b) reportAlways(a, b) #endif // UNITTESTS namespace VirtFs @@ -126,7 +126,7 @@ namespace VirtFs if (checkPath(name) == false) { reportAlways("FsDir::exists invalid path: %s", - name.c_str()); + name.c_str()) return false; } @@ -150,7 +150,7 @@ namespace VirtFs if (checkPath(dirName) == false) { reportAlways("VirtFs::enumerateFiles invalid path: %s", - dirName.c_str()); + dirName.c_str()) return list; } @@ -175,7 +175,7 @@ namespace VirtFs if (checkPath(dirName) == false) { reportAlways("VirtFs::enumerateFiles invalid path: %s", - dirName.c_str()); + dirName.c_str()) return; } @@ -197,7 +197,7 @@ namespace VirtFs if (checkPath(dirName) == false) { reportAlways("VirtFs::enumerateFiles invalid path: %s", - dirName.c_str()); + dirName.c_str()) return; } @@ -220,7 +220,7 @@ namespace VirtFs if (checkPath(dirName) == false) { reportAlways("VirtFs::enumerateFiles invalid path: %s", - dirName.c_str()); + dirName.c_str()) return; } @@ -241,7 +241,7 @@ namespace VirtFs if (checkPath(name) == false) { reportAlways("VirtFs::isDirectory invalid path: %s", - name.c_str()); + name.c_str()) return false; } std::string dirName = STD_MOVE(name); @@ -276,7 +276,7 @@ namespace VirtFs if (checkPath(filename) == false) { reportAlways("VirtFs::openRead invalid path: %s", - filename.c_str()); + filename.c_str()) return nullptr; } FOR_EACH (STD_VECTOR<FsEntry*>::const_iterator, it, mEntries) @@ -295,7 +295,7 @@ namespace VirtFs if (checkPath(filename) == false) { reportAlways("VirtFs::openWrite invalid path: %s", - filename.c_str()); + filename.c_str()) return nullptr; } FOR_EACH (STD_VECTOR<FsEntry*>::const_iterator, it, mEntries) @@ -314,7 +314,7 @@ namespace VirtFs if (checkPath(filename) == false) { reportAlways("VirtFs::openAppend invalid path: %s", - filename.c_str()); + filename.c_str()) return nullptr; } FOR_EACH (STD_VECTOR<FsEntry*>::const_iterator, it, mEntries) @@ -347,7 +347,7 @@ namespace VirtFs { if (newDir.find(".zip") != std::string::npos) { - reportAlways("Called FsDir::mount with zip archive"); + reportAlways("Called FsDir::mount with zip archive") return false; } std::string rootDir = newDir; @@ -366,7 +366,7 @@ namespace VirtFs if (entry != nullptr) { reportAlways("VirtFs::mount already exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } if (subDir.empty()) @@ -396,7 +396,7 @@ namespace VirtFs if (Files::existsLocal(newDir) == false) { reportNonTests("VirtFs::mount directory not exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } return mountDirInternal(newDir, dirSeparator, append); @@ -411,7 +411,7 @@ namespace VirtFs if (Files::existsLocal(newDir) == false) { reportNonTests("VirtFs::mount directory not exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } return mountDirInternal(newDir, subDir, append); @@ -519,13 +519,13 @@ namespace VirtFs prepareFsPath(oldDir); if (oldDir.find(".zip") != std::string::npos) { - reportAlways("Called unmount with zip archive"); + reportAlways("Called unmount with zip archive") return false; } if (unmountDirInternal(oldDir, std::string()) == false) { reportAlways("VirtFs::unmountDir not exists: %s", - oldDir.c_str()); + oldDir.c_str()) return false; } return true; @@ -537,14 +537,14 @@ namespace VirtFs prepareFsPath(oldDir); if (oldDir.find(".zip") != std::string::npos) { - reportAlways("Called unmount with zip archive"); + reportAlways("Called unmount with zip archive") return false; } prepareFsPath(subDir); if (unmountDirInternal(oldDir, subDir) == false) { reportAlways("VirtFs::unmountDir not exists: %s", - oldDir.c_str()); + oldDir.c_str()) return false; } return true; @@ -555,7 +555,7 @@ namespace VirtFs prepareFsPath(oldDir); if (oldDir.find(".zip") != std::string::npos) { - reportAlways("Called unmount with zip archive"); + reportAlways("Called unmount with zip archive") return false; } if (unmountDirInternal(oldDir, std::string()) == false) @@ -573,7 +573,7 @@ namespace VirtFs prepareFsPath(oldDir); if (oldDir.find(".zip") != std::string::npos) { - reportAlways("Called unmount with zip archive"); + reportAlways("Called unmount with zip archive") return false; } prepareFsPath(subDir); @@ -593,19 +593,19 @@ namespace VirtFs if (Files::existsLocal(newDir) == false) { reportNonTests("FsZip::mount file not exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } if (findLast(newDir, ".zip") == false) { reportAlways("Called VirtFs::mount without " - "zip archive"); + "zip archive") return false; } if (searchByRootInternal(newDir, std::string()) != nullptr) { reportAlways("FsZip::mount already exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } ZipEntry *const entry = new ZipEntry(newDir, @@ -630,13 +630,13 @@ namespace VirtFs if (Files::existsLocal(newDir) == false) { reportNonTests("FsZip::mount file not exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } if (findLast(newDir, ".zip") == false) { reportAlways("Called VirtFs::mount without " - "zip archive"); + "zip archive") return false; } prepareFsPath(subDir); @@ -652,7 +652,7 @@ namespace VirtFs if (searchByRootInternal(newDir, subDir) != nullptr) { reportAlways("FsZip::mount already exists: %s", - newDir.c_str()); + newDir.c_str()) return false; } ZipEntry *const entry = new ZipEntry(newDir, @@ -676,7 +676,7 @@ namespace VirtFs prepareFsPath(oldDir); if (findLast(oldDir, ".zip") == false) { - reportAlways("Called unmount without zip archive"); + reportAlways("Called unmount without zip archive") return false; } FOR_EACH (STD_VECTOR<FsEntry*>::iterator, it, mEntries) @@ -696,7 +696,7 @@ namespace VirtFs } reportAlways("VirtFs::unmountZip not exists: %s", - oldDir.c_str()); + oldDir.c_str()) return false; } @@ -706,7 +706,7 @@ namespace VirtFs prepareFsPath(oldDir); if (findLast(oldDir, ".zip") == false) { - reportAlways("Called unmount without zip archive"); + reportAlways("Called unmount without zip archive") return false; } prepareFsPath(subDir); @@ -738,7 +738,7 @@ namespace VirtFs } reportAlways("VirtFs::unmountZip not exists: %s", - oldDir.c_str()); + oldDir.c_str()) return false; } @@ -748,7 +748,7 @@ namespace VirtFs if (checkPath(fileName) == false) { reportAlways("FsDir::getRealDir invalid path: %s", - fileName.c_str()); + fileName.c_str()) return std::string(); } @@ -862,7 +862,7 @@ namespace VirtFs if (checkPath(filename) == false) { reportAlways("VirtFs::loadFile invalid path: %s", - filename.c_str()); + filename.c_str()) return nullptr; } FOR_EACH (STD_VECTOR<FsEntry*>::const_iterator, it, mEntries) diff --git a/src/fs/virtfs/fsdir.cpp b/src/fs/virtfs/fsdir.cpp index dae2a9eb1..d6beae6c4 100644 --- a/src/fs/virtfs/fsdir.cpp +++ b/src/fs/virtfs/fsdir.cpp @@ -73,7 +73,7 @@ namespace FsDir if (fd == FILEHDEFAULT) { reportAlways("VirtFs::open file open error: %s", - filename.c_str()); + filename.c_str()) return nullptr; } return new File(&funcs, fd); @@ -252,7 +252,7 @@ namespace FsDir if (checkPath(name) == false) { reportAlways("FsDir::isSymbolicLink invalid path: %s", - name.c_str()); + name.c_str()) return false; } #ifndef WIN32 @@ -286,7 +286,7 @@ namespace FsDir prepareFsPath(dirname); if (mWriteDir.empty()) { - reportAlways("FsDir::mkdir write dir is empty"); + reportAlways("FsDir::mkdir write dir is empty") return false; } return mkdir_r((mWriteDir + dirname).c_str()) != -1; @@ -297,7 +297,7 @@ namespace FsDir prepareFsPath(filename); if (mWriteDir.empty()) { - reportAlways("FsDir::remove write dir is empty"); + reportAlways("FsDir::remove write dir is empty") return false; } return ::remove((mWriteDir + filename).c_str()) != 0; @@ -326,7 +326,7 @@ namespace FsDir FILEHTYPE fd = file->mFd; if (fd == FILEHDEFAULT) { - reportAlways("FsDir::read file not opened."); + reportAlways("FsDir::read file not opened.") return 0; } #ifdef USE_FILE_FOPEN @@ -350,7 +350,7 @@ namespace FsDir FILEHTYPE fd = file->mFd; if (fd == FILEHDEFAULT) { - reportAlways("FsDir::write file not opened."); + reportAlways("FsDir::write file not opened.") return 0; } #ifdef USE_FILE_FOPEN @@ -371,14 +371,14 @@ namespace FsDir FILEHTYPE fd = file->mFd; if (fd == FILEHDEFAULT) { - reportAlways("FsDir::fileLength file not opened."); + reportAlways("FsDir::fileLength file not opened.") return 0; } #ifdef USE_FILE_FOPEN const long pos = ftell(fd); if (pos < 0) { - reportAlways("FsDir::fileLength ftell error."); + reportAlways("FsDir::fileLength ftell error.") return -1; } fseek(fd, 0, SEEK_END); @@ -389,7 +389,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") return -1; } return static_cast<int64_t>(statbuf.st_size); @@ -404,7 +404,7 @@ namespace FsDir FILEHTYPE fd = file->mFd; if (fd == FILEHDEFAULT) { - reportAlways("FsDir::tell file not opened."); + reportAlways("FsDir::tell file not opened.") return 0; } #ifdef USE_FILE_FOPEN @@ -423,7 +423,7 @@ namespace FsDir FILEHTYPE fd = file->mFd; if (fd == FILEHDEFAULT) { - reportAlways("FsDir::seek file not opened."); + reportAlways("FsDir::seek file not opened.") return 0; } const int64_t res = FILESEEK(fd, pos, SEEK_SET); @@ -440,7 +440,7 @@ namespace FsDir FILEHTYPE fd = file->mFd; if (fd == FILEHDEFAULT) { - reportAlways("FsDir::eof file not opened."); + reportAlways("FsDir::eof file not opened.") return 0; } #ifdef USE_FILE_FOPEN @@ -454,7 +454,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") return -1; } const int64_t len = static_cast<int64_t>(statbuf.st_size); @@ -475,7 +475,7 @@ namespace FsDir if (fd == FILEHDEFAULT) { reportAlways("VirtFs::loadFile file open error: %s", - filename.c_str()); + filename.c_str()) return nullptr; } @@ -488,7 +488,7 @@ namespace FsDir const long sz = ftell(fd); if (sz < 0) { - reportAlways("FsDir::fileLength ftell error."); + reportAlways("FsDir::fileLength ftell error.") if (fd != FILEHDEFAULT) FILECLOSE(fd); return nullptr; @@ -499,7 +499,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") if (fd != FILEHDEFAULT) FILECLOSE(fd); return nullptr; diff --git a/src/fs/virtfs/fsdirrwops.cpp b/src/fs/virtfs/fsdirrwops.cpp index 9906e1895..480567288 100644 --- a/src/fs/virtfs/fsdirrwops.cpp +++ b/src/fs/virtfs/fsdirrwops.cpp @@ -87,7 +87,7 @@ namespace FsDir const long curpos = ftell(fd); if (curpos < 0) { - reportAlways("FsDir::fileLength ftell error."); + reportAlways("FsDir::fileLength ftell error.") return -1; } fseek(fd, 0, SEEK_END); @@ -97,7 +97,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") len = -1; } else @@ -111,7 +111,7 @@ namespace FsDir #ifdef USE_FILE_FOPEN if (fseek(fd, curpos, SEEK_SET) < 0) { - reportAlways("FsDir::fileLength fseek error."); + reportAlways("FsDir::fileLength fseek error.") } #endif // USE_FILE_FOPEN logger->assertLog( @@ -184,7 +184,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") return CAST_S32(rc); } } @@ -220,7 +220,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") return CAST_S32(rc); } } @@ -256,7 +256,7 @@ namespace FsDir struct stat statbuf; if (fstat(fd, &statbuf) == -1) { - reportAlways("FsDir::fileLength error."); + reportAlways("FsDir::fileLength error.") return -1; } return static_cast<int64_t>(statbuf.st_size); diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp index 871e3cc1a..42fe808d0 100644 --- a/src/fs/virtfs/fszip.cpp +++ b/src/fs/virtfs/fszip.cpp @@ -568,14 +568,14 @@ namespace FsZip File *openWrite(FsEntry *restrict const entry A_UNUSED, const std::string &filename A_UNUSED) { - reportAlways("VirtFs::openWrite for zip not implemented."); + reportAlways("VirtFs::openWrite for zip not implemented.") return nullptr; } File *openAppend(FsEntry *restrict const entry A_UNUSED, const std::string &filename A_UNUSED) { - reportAlways("VirtFs::openAppend for zip not implemented."); + reportAlways("VirtFs::openAppend for zip not implemented.") return nullptr; } @@ -600,7 +600,7 @@ namespace FsZip } if (buffer == nullptr) { - reportAlways("FsZip::read buffer is null"); + reportAlways("FsZip::read buffer is null") return 0; } const size_t pos = file->mPos; diff --git a/src/fs/virtfs/rwops.cpp b/src/fs/virtfs/rwops.cpp index 96c3cddd6..c6ad34eff 100644 --- a/src/fs/virtfs/rwops.cpp +++ b/src/fs/virtfs/rwops.cpp @@ -69,7 +69,7 @@ SDL_RWops *create_rwops(File *const file, if (file == nullptr) { reportAlways("VirtFs::rwops_seek: create rwops error: %s", - fname.c_str()); + fname.c_str()) } else { diff --git a/src/fs/virtfs/zipreader.cpp b/src/fs/virtfs/zipreader.cpp index e76b219b2..ec3420946 100644 --- a/src/fs/virtfs/zipreader.cpp +++ b/src/fs/virtfs/zipreader.cpp @@ -51,8 +51,8 @@ extern const char *dirSeparator; if (cnt != (sz)) \ { \ reportAlways("Error reading " msg " in file %s", \ - archiveName.c_str()); \ - delete2(header); \ + archiveName.c_str()) \ + delete2(header) \ delete [] buf; \ fclose(arcFile); \ return false; \ @@ -75,7 +75,7 @@ namespace ZipReader { if (entry == nullptr) { - reportAlways("Entry is null."); + reportAlways("Entry is null.") return false; } const std::string archiveName = entry->root; @@ -86,7 +86,7 @@ namespace ZipReader if (arcFile == nullptr) { reportAlways("Can't open zip file %s", - archiveName.c_str()); + archiveName.c_str()) return false; } uint8_t *const buf = new uint8_t[65535 + 10]; @@ -104,7 +104,7 @@ namespace ZipReader size_t cnt = 0U; // file header pointer on 0 // read file header signature - readVal(buf, 4, "zip file header"); // + 4 + readVal(buf, 4, "zip file header") // + 4 // pointer on 4 if (buf[0] == 0x50 && @@ -138,7 +138,7 @@ namespace ZipReader if (fileNameLen > 1000) { reportAlways("Error too long file name in file %s", - archiveName.c_str()); + archiveName.c_str()) delete header; delete [] buf; fclose(arcFile); @@ -148,7 +148,7 @@ namespace ZipReader swapVal16(val16) // file header pointer on 30 const uint32_t extraFieldLen = CAST_U32(val16); - readVal(buf, fileNameLen, "file name"); + readVal(buf, fileNameLen, "file name") // file header pointer on 30 + fileNameLen buf[fileNameLen] = 0; header->fileName = std::string( @@ -178,7 +178,7 @@ namespace ZipReader header->fileName.c_str()); #endif // DEBUG_ZIP dirs.push_back(header->fileName); - delete2(header); + delete2(header) } } else if (buf[0] == 0x50 && @@ -209,7 +209,7 @@ namespace ZipReader buf[1], buf[2], buf[3], - archiveName.c_str()); + archiveName.c_str()) delete [] buf; fclose(arcFile); return false; @@ -225,7 +225,7 @@ namespace ZipReader { reportAlways("Zlib error: '%s' in %s", text.c_str(), - getZlibError(err).c_str()); + getZlibError(err).c_str()) } std::string getZlibError(const int err) @@ -243,7 +243,7 @@ namespace ZipReader { if (header == nullptr) { - reportAlways("ZipReader::readCompressedFile: header is null"); + reportAlways("ZipReader::readCompressedFile: header is null") return nullptr; } FILE *restrict const arcFile = fopen( @@ -252,7 +252,7 @@ namespace ZipReader if (arcFile == nullptr) { reportAlways("Can't open zip file %s", - header->zipEntry->root.c_str()); + header->zipEntry->root.c_str()) return nullptr; } @@ -263,7 +263,7 @@ namespace ZipReader compressSize) { reportAlways("Read zip compressed file error from archive: %s", - header->zipEntry->root.c_str()); + header->zipEntry->root.c_str()) fclose(arcFile); delete [] buf; return nullptr; @@ -276,7 +276,7 @@ namespace ZipReader { if (header == nullptr) { - reportAlways("Open zip file error. header is null."); + reportAlways("Open zip file error. header is null.") return nullptr; } uint8_t *restrict const in = readCompressedFile(header); |