Fix build for Xcode.

This commit is contained in:
John Preston 2018-06-21 22:25:14 +01:00
parent 856356ce75
commit 8c901d8f71
4 changed files with 8 additions and 7 deletions

View file

@ -1057,7 +1057,6 @@ DialogsInfo ParseDialogsInfo(const MTPmessages_Dialogs &data) {
info.peerId = ParsePeerId(fields.vpeer); info.peerId = ParsePeerId(fields.vpeer);
const auto peerIt = peers.find(info.peerId); const auto peerIt = peers.find(info.peerId);
if (peerIt != end(peers)) { if (peerIt != end(peers)) {
using Type = DialogInfo::Type;
const auto &peer = peerIt->second; const auto &peer = peerIt->second;
info.type = peer.user() info.type = peer.user()
? DialogTypeFromUser(*peer.user()) ? DialogTypeFromUser(*peer.user())

View file

@ -47,10 +47,12 @@ QByteArray SerializeString(const QByteArray &value) {
} else { } else {
result.append('0' + left); result.append('0' + left);
} }
} else if (ch == 0xE2 && (p + 2 < end) && *(p + 1) == 0x80) { } else if (ch == char(0xE2)
if (*(p + 2) == 0xA8) { // Line separator. && (p + 2 < end)
&& *(p + 1) == char(0x80)) {
if (*(p + 2) == char(0xA8)) { // Line separator.
result.append("\\u2028", 6); result.append("\\u2028", 6);
} else if (*(p + 2) == 0xA9) { // Paragraph separator. } else if (*(p + 2) == char(0xA9)) { // Paragraph separator.
result.append("\\u2029", 6); result.append("\\u2029", 6);
} else { } else {
result.append(ch); result.append(ch);

View file

@ -18,8 +18,8 @@ namespace details {
struct JsonContext { struct JsonContext {
using Type = bool; using Type = bool;
static const auto kObject = Type(true); static constexpr auto kObject = Type(true);
static const auto kArray = Type(false); static constexpr auto kArray = Type(false);
// Always fun to use std::vector<bool>. // Always fun to use std::vector<bool>.
std::vector<Type> nesting; std::vector<Type> nesting;

View file

@ -19,7 +19,7 @@ struct Result {
FatalError FatalError
}; };
Result(Type type, QString path) : type(type), path(path) { Result(Type type, QString path) : path(path), type(type) {
} }
static Result Success() { static Result Success() {