From f5a08101e59abef6a4696bcaa2b5381e133dfbb4 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Tue, 31 May 2016 10:49:23 +0200 Subject: Fix serialization code in response to VS 2013 warning cl.exe from VS 2013 warns about a negative integral constant converted to unsigned type (C4308). This is worked around by using the & operator instead of the << operator, which also allows serialization but does not cause the warning. Test-Information: Tested on Windows 8 with Visual Studio 2013. The build does not cause the warnings on the affected files anymore. Change-Id: I53d82361cb07e36e96e0ff1398e6fb1b35bb01fa diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index be0af3e..e8b85c4 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -230,7 +230,7 @@ void ChatsManager::saveRecents() { recentsLimited.erase(std::remove_if(recentsLimited.begin(), recentsLimited.end(), RemoveRecent::ifPrivateMessage), recentsLimited.end()); - oa << recentsLimited; + oa & recentsLimited; std::string serializedStr = Base64::encode(createByteArray(serializeStream.str())); profileSettings_->storeString(RECENT_CHATS, serializedStr); } diff --git a/Swift/Controllers/HighlightManager.cpp b/Swift/Controllers/HighlightManager.cpp index fab0ac5..2afaf49 100644 --- a/Swift/Controllers/HighlightManager.cpp +++ b/Swift/Controllers/HighlightManager.cpp @@ -65,7 +65,7 @@ void HighlightManager::handleSettingChanged(const std::string& settingPath) { std::string HighlightManager::rulesToString() const { std::stringstream stream; boost::archive::text_oarchive archive(stream); - archive << rules_->list_; + archive & rules_->list_; return stream.str(); } -- cgit v0.10.2-6-g49f6