Fix -Wunused-variable warnings with gcc

This commit is contained in:
Ilya Fedin 2021-07-14 01:40:28 +04:00 committed by John Preston
parent 0ad1d2c965
commit 51cfd0ba35
4 changed files with 3 additions and 9 deletions

View file

@ -147,7 +147,7 @@ private:
public: public:
UsedWordGuard(std::vector<small> &map, int index); UsedWordGuard(std::vector<small> &map, int index);
UsedWordGuard(const UsedWordGuard &other) = delete; UsedWordGuard(const UsedWordGuard &other) = delete;
UsedWordGuard(UsedWordGuard &&other); [[maybe_unused]] UsedWordGuard(UsedWordGuard &&other);
UsedWordGuard &operator=(const UsedWordGuard &other) = delete; UsedWordGuard &operator=(const UsedWordGuard &other) = delete;
UsedWordGuard &operator=(UsedWordGuard &&other) = delete; UsedWordGuard &operator=(UsedWordGuard &&other) = delete;
explicit operator bool() const; explicit operator bool() const;

View file

@ -174,7 +174,7 @@ void StartFonts() {
style_InitFontsResource(); style_InitFontsResource();
#ifndef DESKTOP_APP_USE_PACKAGED_FONTS #ifndef DESKTOP_APP_USE_PACKAGED_FONTS
bool areGood[FontTypesCount] = { false }; [[maybe_unused]] bool areGood[FontTypesCount] = { false };
for (auto i = 0; i != FontTypesCount; ++i) { for (auto i = 0; i != FontTypesCount; ++i) {
const auto file = FontTypeFiles[i]; const auto file = FontTypeFiles[i];
const auto name = FontTypeNames[i]; const auto name = FontTypeNames[i];

View file

@ -2763,20 +2763,14 @@ void String::recountNaturalSize(bool initial, Qt::LayoutDirection optionsDir) {
} }
int String::countMaxMonospaceWidth() const { int String::countMaxMonospaceWidth() const {
const NewlineBlock *lastNewline = nullptr;
auto result = QFixed(); auto result = QFixed();
auto paragraphWidth = QFixed(); auto paragraphWidth = QFixed();
auto lastNewlineStart = 0;
auto fullMonospace = true; auto fullMonospace = true;
QFixed _width = 0, last_rBearing = 0, last_rPadding = 0; QFixed _width = 0, last_rBearing = 0, last_rPadding = 0;
for (auto &block : _blocks) { for (auto &block : _blocks) {
auto b = block.get(); auto b = block.get();
auto _btype = b->type(); auto _btype = b->type();
if (_btype == TextBlockTNewline) { if (_btype == TextBlockTNewline) {
lastNewlineStart = b->from();
lastNewline = &block.unsafe<NewlineBlock>();
last_rBearing = b->f_rbearing(); last_rBearing = b->f_rbearing();
last_rPadding = b->f_rpadding(); last_rPadding = b->f_rpadding();

View file

@ -1481,7 +1481,7 @@ bool CutPart(TextWithEntities &sending, TextWithEntities &left, int32 limit) {
} }
int elen = 0; int elen = 0;
if (auto e = Ui::Emoji::Find(ch, end, &elen)) { if (Ui::Emoji::Find(ch, end, &elen)) {
for (int i = 0; i < elen; ++i, ++ch, ++s) { for (int i = 0; i < elen; ++i, ++ch, ++s) {
if (ch->isHighSurrogate() && i + 1 < elen && (ch + 1)->isLowSurrogate()) { if (ch->isHighSurrogate() && i + 1 < elen && (ch + 1)->isLowSurrogate()) {
++ch; ++ch;