From 6537e524b8cc1d08b32f23f86d743cfac32a7e37 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 21 Jun 2019 10:58:31 +0200 Subject: [PATCH] Fix build for GCC. --- Telegram/SourceFiles/codegen/lang/generator.cpp | 4 ++-- Telegram/SourceFiles/lang/lang_instance.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/codegen/lang/generator.cpp b/Telegram/SourceFiles/codegen/lang/generator.cpp index 640056acf..bcffbc468 100644 --- a/Telegram/SourceFiles/codegen/lang/generator.cpp +++ b/Telegram/SourceFiles/codegen/lang/generator.cpp @@ -350,7 +350,7 @@ ushort GetTagIndex(QLatin1String tag) {\n\ } writeSetSearch(tagsSet, [](const QString &tag) { - return "lt_" + tag; + return "ushort(lt_" + tag + ")"; }, "kTagsCount"); source_->stream() << "\ @@ -427,7 +427,7 @@ bool IsTagReplaced(ushort key, ushort tag) {\n\ }\n\ \n\ QString GetOriginalValue(ushort key) {\n\ - Expects(key >= 0 && key < kKeysCount);\n\ + Expects(key < kKeysCount);\n\ \n\ const auto offset = Offsets[key];\n\ return QString::fromRawData(DefaultData + offset, Offsets[key + 1] - offset);\n\ diff --git a/Telegram/SourceFiles/lang/lang_instance.h b/Telegram/SourceFiles/lang/lang_instance.h index 7ce7b8c7e..e90a026d7 100644 --- a/Telegram/SourceFiles/lang/lang_instance.h +++ b/Telegram/SourceFiles/lang/lang_instance.h @@ -103,13 +103,13 @@ public: } QString getValue(ushort key) const { - Expects(key >= 0 && key < _values.size()); + Expects(key < _values.size()); return _values[key]; } QString getNonDefaultValue(const QByteArray &key) const; bool isNonDefaultPlural(ushort key) const { - Expects(key >= 0 && key + 5 < _nonDefaultSet.size()); + Expects(key + 5 < _nonDefaultSet.size()); return _nonDefaultSet[key] || _nonDefaultSet[key + 1]