From 4226eb2ea56a13f1e499b80e51cb73748cff82a1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 7 Jun 2017 17:23:50 +0200 Subject: Core/Misc: Some /W4 warning fixes --- src/server/shared/JSON/ProtobufJSON.cpp | 2 +- src/server/shared/Realm/RealmList.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/shared/JSON/ProtobufJSON.cpp b/src/server/shared/JSON/ProtobufJSON.cpp index dcf7dc0436f..540d18c7b3f 100644 --- a/src/server/shared/JSON/ProtobufJSON.cpp +++ b/src/server/shared/JSON/ProtobufJSON.cpp @@ -325,7 +325,7 @@ bool Deserializer::Double(double d) switch (field->cpp_type()) { case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT: - SET_FIELD(message, field, Float, d); + SET_FIELD(message, field, Float, float(d)); break; case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE: SET_FIELD(message, field, Double, d); diff --git a/src/server/shared/Realm/RealmList.cpp b/src/server/shared/Realm/RealmList.cpp index c579b741d8e..66346614278 100644 --- a/src/server/shared/Realm/RealmList.cpp +++ b/src/server/shared/Realm/RealmList.cpp @@ -278,11 +278,11 @@ std::vector RealmList::GetRealmEntryJSON(Battlenet::RealmHandle const& id std::string json = "JamJSONRealmEntry:" + JSON::Serialize(realmEntry); - uLong compressedLength = compressBound(json.length()); + uLong compressedLength = compressBound(uLong(json.length())); compressed.resize(compressedLength + 4); - *reinterpret_cast(compressed.data()) = json.length() + 1; + *reinterpret_cast(compressed.data()) = uint32(json.length() + 1); - if (compress(compressed.data() + 4, &compressedLength, reinterpret_cast(json.c_str()), json.length() + 1) == Z_OK) + if (compress(compressed.data() + 4, &compressedLength, reinterpret_cast(json.c_str()), uLong(json.length() + 1)) == Z_OK) compressed.resize(compressedLength + 4); else compressed.clear(); @@ -337,12 +337,12 @@ std::vector RealmList::GetRealmList(uint32 build, std::string const& subR std::string json = "JSONRealmListUpdates:" + JSON::Serialize(realmList); - uLong compressedLength = compressBound(json.length()); + uLong compressedLength = compressBound(uLong(json.length())); std::vector compressed; compressed.resize(4 + compressedLength); - *reinterpret_cast(compressed.data()) = json.length() + 1; + *reinterpret_cast(compressed.data()) = uint32(json.length() + 1); - compress(compressed.data() + 4, &compressedLength, reinterpret_cast(json.c_str()), json.length() + 1); + compress(compressed.data() + 4, &compressedLength, reinterpret_cast(json.c_str()), uLong(json.length() + 1)); compressed.resize(compressedLength + 4); @@ -367,12 +367,12 @@ uint32 RealmList::JoinRealm(uint32 realmAddress, uint32 build, boost::asio::ip:: std::string json = "JSONRealmListServerIPAddresses:" + JSON::Serialize(serverAddresses); - uLong compressedLength = compressBound(json.length()); + uLong compressedLength = compressBound(uLong(json.length())); std::vector compressed; compressed.resize(4 + compressedLength); - *reinterpret_cast(compressed.data()) = json.length() + 1; + *reinterpret_cast(compressed.data()) = uint32(json.length() + 1); - if (compress(compressed.data() + 4, &compressedLength, reinterpret_cast(json.c_str()), json.length() + 1) != Z_OK) + if (compress(compressed.data() + 4, &compressedLength, reinterpret_cast(json.c_str()), uLong(json.length() + 1)) != Z_OK) return ERROR_UTIL_SERVER_FAILED_TO_SERIALIZE_RESPONSE; BigNumber serverSecret; -- cgit v1.2.3