diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-14 19:17:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-14 19:17:03 +0300 |
commit | ec8845e596facf709d2a0ac19f518452b8382260 (patch) | |
tree | 0165d4965a103ed289c3ad202aa643605d688046 | |
parent | 928103c5d9c716dbfe0ba2c8ea13b1426b3e768c (diff) | |
download | manaplus-ec8845e596facf709d2a0ac19f518452b8382260.tar.gz manaplus-ec8845e596facf709d2a0ac19f518452b8382260.tar.bz2 manaplus-ec8845e596facf709d2a0ac19f518452b8382260.tar.xz manaplus-ec8845e596facf709d2a0ac19f518452b8382260.zip |
Fix code style.
-rw-r--r-- | src/chatlogger.cpp | 2 | ||||
-rw-r--r-- | src/fs/files.cpp | 2 | ||||
-rw-r--r-- | src/fs/files.h | 2 | ||||
-rw-r--r-- | src/fs/virtfs/virtfsdir.cpp | 2 | ||||
-rw-r--r-- | src/fs/virtfs/virtfszip.cpp | 4 | ||||
-rw-r--r-- | src/fs/virtfs/virtfsziprwops.cpp | 2 | ||||
-rw-r--r-- | src/fs/virtfs/zip.cpp | 4 | ||||
-rw-r--r-- | src/resources/db/textdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.h | 1 | ||||
-rw-r--r-- | src/utils/copynpaste.cpp | 4 |
10 files changed, 11 insertions, 14 deletions
diff --git a/src/chatlogger.cpp b/src/chatlogger.cpp index 1b0b7052d..7cb0586e7 100644 --- a/src/chatlogger.cpp +++ b/src/chatlogger.cpp @@ -36,8 +36,6 @@ #include "fs/mkdir.h" -#include "fs/virtfs/virtfs.h" - #include "debug.h" ChatLogger *chatLogger = nullptr; diff --git a/src/fs/files.cpp b/src/fs/files.cpp index 215076b99..3bb3262da 100644 --- a/src/fs/files.cpp +++ b/src/fs/files.cpp @@ -249,7 +249,7 @@ bool Files::loadTextFileLocal(const std::string &fileName, return true; } -void Files::saveTextFile(std::string path, +void Files::saveTextFile(const std::string &path, const std::string &restrict name, const std::string &restrict text) { diff --git a/src/fs/files.h b/src/fs/files.h index 4b55292de..fa6833da4 100644 --- a/src/fs/files.h +++ b/src/fs/files.h @@ -58,7 +58,7 @@ namespace Files bool loadTextFileLocal(const std::string &fileName, StringVect &lines); - void saveTextFile(std::string path, + void saveTextFile(const std::string &path, const std::string &restrict name, const std::string &restrict text); diff --git a/src/fs/virtfs/virtfsdir.cpp b/src/fs/virtfs/virtfsdir.cpp index 7f693b8ae..9eac0896b 100644 --- a/src/fs/virtfs/virtfsdir.cpp +++ b/src/fs/virtfs/virtfsdir.cpp @@ -493,7 +493,7 @@ namespace VirtFsDir buffer[fileSize - 1] = 0; #ifdef USE_FILE_FOPEN - const int cnt = fread(buffer, 1, fileSize, fd); + const int cnt = CAST_S32(fread(buffer, 1, fileSize, fd)); #else // USE_FILE_FOPEN const int cnt = ::read(fd, buffer, fileSize); #endif // USE_FILE_FOPEN diff --git a/src/fs/virtfs/virtfszip.cpp b/src/fs/virtfs/virtfszip.cpp index 8999cb54c..f2cacc34f 100644 --- a/src/fs/virtfs/virtfszip.cpp +++ b/src/fs/virtfs/virtfszip.cpp @@ -277,8 +277,8 @@ namespace VirtFsZip reportAlways("VirtFsZip::read buffer is null"); return 0; } - const uint32_t pos = file->mPos; - const uint32_t sz = file->mSize; + const uint32_t pos = CAST_S32(file->mPos); + const uint32_t sz = CAST_S32(file->mSize); // if outside of buffer, return if (pos >= sz) return 0; diff --git a/src/fs/virtfs/virtfsziprwops.cpp b/src/fs/virtfs/virtfsziprwops.cpp index 098b409e3..717227e46 100644 --- a/src/fs/virtfs/virtfsziprwops.cpp +++ b/src/fs/virtfs/virtfsziprwops.cpp @@ -73,7 +73,7 @@ namespace VirtFsZip } else if (whence == SEEK_END) { - pos = mSize + offset; + pos = static_cast<RWOPSINT>(mSize + offset); } else { diff --git a/src/fs/virtfs/zip.cpp b/src/fs/virtfs/zip.cpp index 4ff58d584..f10f8f70d 100644 --- a/src/fs/virtfs/zip.cpp +++ b/src/fs/virtfs/zip.cpp @@ -150,7 +150,7 @@ namespace Zip header->fileName = std::string( reinterpret_cast<char*>(buf)); prepareFsPath(header->fileName); - header->dataOffset = ftell(arcFile) + extraFieldLen; + header->dataOffset = CAST_S32(ftell(arcFile) + extraFieldLen); fseek(arcFile, extraFieldLen + header->compressSize, SEEK_CUR); // pointer on 30 + fileNameLen + extraFieldLen + compressSize if (findLast(header->fileName, dirSeparator) == false) @@ -292,7 +292,7 @@ namespace Zip strm.next_in = in; strm.avail_in = header->compressSize; strm.next_out = out; - strm.avail_out = outSize; + strm.avail_out = CAST_U32(outSize); int ret = inflateInit2(&strm, -MAX_WBITS); if (ret != Z_OK) diff --git a/src/resources/db/textdb.cpp b/src/resources/db/textdb.cpp index 8a8771535..24a5f2a38 100644 --- a/src/resources/db/textdb.cpp +++ b/src/resources/db/textdb.cpp @@ -42,7 +42,7 @@ void TextDb::load() } void TextDb::loadXmlFile(const std::string &fileName, - const SkipError skipError) + const SkipError skipError) { XML::Document *doc = new XML::Document(fileName, UseVirtFs_true, diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h index 128de487b..1ca9aecf1 100644 --- a/src/resources/resourcemanager/resourcemanager.h +++ b/src/resources/resourcemanager/resourcemanager.h @@ -36,7 +36,6 @@ class Resource; struct SDL_Surface; -struct SDL_RWops; namespace ResourceManager { diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp index 2a898e9c5..10b43e811 100644 --- a/src/utils/copynpaste.cpp +++ b/src/utils/copynpaste.cpp @@ -470,8 +470,8 @@ static bool runxsel(const std::string &text, const char *p1, const char *p2) // parent close(fd[0]); - const int len = text.length(); - if (write(fd[1], text.c_str(), len) != len) + const size_t len = text.length(); + if (write(fd[1], text.c_str(), len) != static_cast<ssize_t>(len)) { close(fd[1]); return false; |