diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-04-30 19:53:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-04-30 19:53:58 +0300 |
commit | 12389c8441c748996962412201af9e21d66f9e55 (patch) | |
tree | ccfb01e0b4b3c2eda3d6cf55369bae61e98a4486 /src | |
parent | bbc9697a153b30503d9d12c120505ec81adeacf1 (diff) | |
download | plus-12389c8441c748996962412201af9e21d66f9e55.tar.gz plus-12389c8441c748996962412201af9e21d66f9e55.tar.bz2 plus-12389c8441c748996962412201af9e21d66f9e55.tar.xz plus-12389c8441c748996962412201af9e21d66f9e55.zip |
Fix code style in utils.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/base64.cpp | 6 | ||||
-rw-r--r-- | src/utils/physfsrwops.cpp | 8 | ||||
-rw-r--r-- | src/utils/xml.cpp | 6 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp index bd20496b3..57bc68a7c 100644 --- a/src/utils/base64.cpp +++ b/src/utils/base64.cpp @@ -180,7 +180,8 @@ std::string encodeBase64String(std::string value) int sz = 0; const unsigned char *const str = reinterpret_cast<unsigned char*>( const_cast<char*>(value.c_str())); - unsigned char *const buf = php3_base64_encode(str, value.size(), &sz); + unsigned char *const buf = php3_base64_encode( + str, static_cast<int>(value.size()), &sz); if (!buf) return std::string(); @@ -194,7 +195,8 @@ std::string decodeBase64String(std::string value) int sz = 0; const unsigned char *const str = reinterpret_cast<unsigned char*>( const_cast<char*>(value.c_str())); - unsigned char *const buf = php3_base64_decode(str, value.size(), &sz); + unsigned char *const buf = php3_base64_decode( + str, static_cast<int>(value.size()), &sz); if (buf) value = std::string(reinterpret_cast<char*>(buf), sz); diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index 0faab8f20..94172cd71 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -121,7 +121,9 @@ static PHYSFSSIZE physfsrwops_read(SDL_RWops *const rw, void *ptr, { PHYSFS_file *const handle = static_cast<PHYSFS_file *const>( rw->hidden.unknown.data1); - const PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, size, maxnum); + const PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, + static_cast<unsigned int>(size), + static_cast<unsigned int>(maxnum)); if (rc != static_cast<PHYSFS_sint64>(maxnum)) { if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */ @@ -137,7 +139,9 @@ static PHYSFSSIZE physfsrwops_write(SDL_RWops *const rw, const void *ptr, { PHYSFS_file *const handle = static_cast<PHYSFS_file *const>( rw->hidden.unknown.data1); - const PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, size, num); + const PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, + static_cast<unsigned int>(size), + static_cast<unsigned int>(num)); if (rc != static_cast<PHYSFS_sint64>(num)) SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 94fc18f98..3d98fda61 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -46,10 +46,10 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg A_UNUSED, ...) static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...) { - unsigned size = 1024; - const unsigned msgSize = strlen(msg); + size_t size = 1024; + const size_t msgSize = strlen(msg); if (msgSize * 3 > size) - size = static_cast<unsigned>(msgSize * 3); + size = msgSize * 3; char* buf = new char[size + 1]; va_list ap; |