From 67f2daa43c96f9ee489449887caadc1e3cb76f2f Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 28 Jun 2017 10:31:39 +0300 Subject: [PATCH] Closed beta 1001007003: Fix build for old OS X. --- Telegram/SourceFiles/lang/lang_instance.cpp | 7 +++++-- Telegram/SourceFiles/mtproto/special_config_request.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/lang/lang_instance.cpp b/Telegram/SourceFiles/lang/lang_instance.cpp index 1a48700b9cb64a..08a7f75f7a98b1 100644 --- a/Telegram/SourceFiles/lang/lang_instance.cpp +++ b/Telegram/SourceFiles/lang/lang_instance.cpp @@ -59,7 +59,9 @@ class ValueParser { bool _failed = true; - const char *_begin, *_ch, *_end; + const char *_begin = nullptr; + const char *_ch = nullptr; + const char *_end = nullptr; QString _result; OrderedSet _tagsUsed; @@ -69,6 +71,7 @@ class ValueParser { ValueParser::ValueParser(const QByteArray &key, LangKey keyIndex, const QByteArray &value) : _key(key) , _keyIndex(keyIndex) +, _currentTag("") , _begin(value.constData()) , _ch(_begin) , _end(_begin + value.size()) { @@ -146,7 +149,7 @@ bool ValueParser::parse() { _result.append(_currentTagReplacer); _begin = _ch + 1; - _currentTag = QLatin1String(); + _currentTag = QLatin1String(""); } } appendToResult(_end); diff --git a/Telegram/SourceFiles/mtproto/special_config_request.cpp b/Telegram/SourceFiles/mtproto/special_config_request.cpp index 3bb2ea2580e0c0..92c4b9250e01ff 100644 --- a/Telegram/SourceFiles/mtproto/special_config_request.cpp +++ b/Telegram/SourceFiles/mtproto/special_config_request.cpp @@ -104,10 +104,10 @@ void SpecialConfigRequest::dnsFinished() { auto answerIt = response.find(qsl("Answer")); if (answerIt == response.constEnd()) { LOG(("Config Error: Could not find Answer in dns response JSON.")); - } else if (!answerIt->isArray()) { + } else if (!(*answerIt).isArray()) { LOG(("Config Error: Not an array received in Answer in dns response JSON.")); } else { - for (auto elem : answerIt->toArray()) { + for (auto elem : (*answerIt).toArray()) { if (!elem.isObject()) { LOG(("Config Error: Not an object found in Answer array in dns response JSON.")); } else { @@ -115,10 +115,10 @@ void SpecialConfigRequest::dnsFinished() { auto dataIt = object.find(qsl("data")); if (dataIt == object.constEnd()) { LOG(("Config Error: Could not find data in Answer array entry in dns response JSON.")); - } else if (!dataIt->isString()) { + } else if (!(*dataIt).isString()) { LOG(("Config Error: Not a string data found in Answer array entry in dns response JSON.")); } else { - auto data = dataIt->toString(); + auto data = (*dataIt).toString(); entries.insertMulti(INT_MAX - data.size(), data); } }