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);
const auto peerIt = peers.find(info.peerId);
if (peerIt != end(peers)) {
using Type = DialogInfo::Type;
const auto &peer = peerIt->second;
info.type = peer.user()
? DialogTypeFromUser(*peer.user())

View File

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

View File

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

View File

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