From 4b78d52194ffda4fbd585b941a1e4c5cb45e68f3 Mon Sep 17 00:00:00 2001
From: Evgenii Zheltonozhskii <zheltonozhskiy@gmail.com>
Date: Sun, 21 Oct 2018 19:55:59 +0300
Subject: [PATCH] Fix more warnings

---
 Telegram/SourceFiles/boxes/about_box.cpp      |  1 -
 .../boxes/edit_participant_box.cpp            |  2 +-
 .../chat_helpers/gifs_list_widget.cpp         |  1 -
 .../chat_helpers/stickers_list_widget.cpp     |  2 --
 .../SourceFiles/dialogs/dialogs_widget.cpp    |  1 -
 Telegram/SourceFiles/history/history.cpp      | 14 +++++-------
 .../history/history_admin_log_inner.cpp       |  9 +++-----
 .../history/history_admin_log_section.cpp     |  2 +-
 .../history/history_inner_widget.cpp          |  1 -
 Telegram/SourceFiles/history/history_item.cpp |  2 --
 .../history/history_media_types.cpp           | 22 +++----------------
 .../SourceFiles/history/history_message.cpp   |  6 ++---
 .../SourceFiles/history/history_widget.cpp    |  8 -------
 .../inline_bot_layout_internal.cpp            | 14 ++----------
 .../inline_bots/inline_results_widget.cpp     |  4 +---
 Telegram/SourceFiles/intro/introwidget.cpp    |  4 ++--
 .../SourceFiles/lang/lang_file_parser.cpp     |  1 -
 Telegram/SourceFiles/media/media_audio.cpp    |  1 -
 .../media/player/media_player_cover.cpp       | 10 ++++-----
 .../media/player/media_player_panel.cpp       |  1 -
 .../media/player/media_player_widget.cpp      |  9 ++++----
 .../media/view/media_clip_controller.cpp      |  2 +-
 Telegram/SourceFiles/mtproto/mtp_instance.cpp |  2 +-
 .../SourceFiles/overview/overview_layout.cpp  |  6 ++---
 Telegram/SourceFiles/overviewwidget.cpp       |  1 -
 .../profile/profile_block_group_members.cpp   | 15 +------------
 .../profile/profile_block_peer_list.cpp       |  1 -
 .../profile/profile_inner_widget.cpp          |  1 -
 Telegram/SourceFiles/storage/localstorage.cpp |  2 --
 .../SourceFiles/ui/effects/round_checkbox.cpp |  1 -
 Telegram/SourceFiles/ui/images.cpp            |  2 +-
 Telegram/SourceFiles/ui/text/text_block.cpp   |  2 --
 .../SourceFiles/ui/widgets/input_fields.cpp   | 13 +++++------
 Telegram/SourceFiles/ui/widgets/labels.cpp    |  1 -
 .../SourceFiles/ui/widgets/multi_select.cpp   |  2 +-
 Telegram/SourceFiles/ui/widgets/tooltip.cpp   |  2 +-
 .../themes/window_theme_editor_block.cpp      |  2 +-
 .../window/themes/window_theme_preview.cpp    |  1 -
 38 files changed, 43 insertions(+), 128 deletions(-)

diff --git a/Telegram/SourceFiles/boxes/about_box.cpp b/Telegram/SourceFiles/boxes/about_box.cpp
index 620e6b4bb..31777ee22 100644
--- a/Telegram/SourceFiles/boxes/about_box.cpp
+++ b/Telegram/SourceFiles/boxes/about_box.cpp
@@ -43,7 +43,6 @@ AboutBox::AboutBox(QWidget *parent)
     , _text3(this, st::aboutLabel) {}
 
 void AboutBox::prepare() {
-	constexpr auto test = std::is_convertible<const char *, QString>::value;
 	setTitle([] { return str_const_toString(AppName); });
 
 	addButton(langFactory(lng_close), [this] { closeBox(); });
diff --git a/Telegram/SourceFiles/boxes/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/edit_participant_box.cpp
index caa1a7b09..aabddf2f8 100644
--- a/Telegram/SourceFiles/boxes/edit_participant_box.cpp
+++ b/Telegram/SourceFiles/boxes/edit_participant_box.cpp
@@ -465,7 +465,7 @@ void EditRestrictedBox::createUntilVariants() {
 			_untilVariants.back()->setDisabled(true);
 		}
 	};
-	auto addCustomVariant = [this, addVariant](TimeId until, TimeId from, TimeId to) {
+	auto addCustomVariant = [addVariant](TimeId until, TimeId from, TimeId to) {
 		if (!ChannelData::IsRestrictedForever(until) && until > from && until <= to) {
 			addVariant(until, lng_rights_chat_banned_custom_date(lt_date, langDayOfMonthFull(date(until).date())));
 		}
diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp
index eae203371..c34f06a13 100644
--- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp
+++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp
@@ -860,7 +860,6 @@ void GifsListWidget::updateSelected() {
 		return;
 	}
 
-	auto newSelected = -1;
 	auto p = mapFromGlobal(_lastMousePos);
 
 	int sx = (rtl() ? width() - p.x() : p.x()) - (st::inlineResultsLeft - st::buttonRadius);
diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp
index 880cd5029..28e962b15 100644
--- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp
+++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp
@@ -489,7 +489,6 @@ object_ptr<TabbedSelector::InnerFooter> StickersListWidget::createFooter() {
 }
 
 void StickersListWidget::setVisibleTopBottom(int visibleTop, int visibleBottom) {
-	auto top = getVisibleTop();
 	Inner::setVisibleTopBottom(visibleTop, visibleBottom);
 	if (_section == Section::Featured) {
 		readVisibleSets();
@@ -1501,7 +1500,6 @@ void StickersListWidget::updateSelected() {
 					newSelected = OverGroupAdd{};
 				}
 			} else {
-				auto special = ((set.flags & MTPDstickerSet::Flag::f_official) != 0);
 				int rowIndex = std::floor(yOffset / st::stickerPanSize.height());
 				int columnIndex = std::floor(sx / st::stickerPanSize.width());
 				auto index = rowIndex * kStickersPanelPerRow + columnIndex;
diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp
index 08e7efbab..a38cd6a54 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp
@@ -240,7 +240,6 @@ void DialogsWidget::showAnimated(Window::SlideDirection direction, const Window:
 	_chooseFromUser->hideFast();
 	_lockUnlock->hide();
 
-	int delta = st::slideShift;
 	if (_showDirection == Window::SlideDirection::FromLeft) {
 		std::swap(_cacheUnder, _cacheOver);
 	}
diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp
index ed52c040a..d4614d87b 100644
--- a/Telegram/SourceFiles/history/history.cpp
+++ b/Telegram/SourceFiles/history/history.cpp
@@ -1532,7 +1532,6 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice) {
 		// If no items were added it means we've loaded everything old.
 		oldLoaded = true;
 	} else if (loadedAtBottom()) { // add photos to overview and authors to lastAuthors
-		bool channel = isChannel();
 		qint32 mask = 0;
 		QList<not_null<UserData *>> *lastAuthors = nullptr;
 		std::set<not_null<PeerData *>> *markupSenders = nullptr;
@@ -1540,12 +1539,10 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice) {
 			lastAuthors = &peer->asChat()->lastAuthors;
 			markupSenders = &peer->asChat()->markupSenders;
 		} else if (peer->isMegagroup()) {
-			// We don't add users to mgInfo->lastParticipants here.
-			// We're scrolling back and we see messages from users that
-			// could be gone from the megagroup already. It is fine for
-			// chat->lastAuthors, because they're used only for field
-			// autocomplete, but this is bad for megagroups, because its
-			// lastParticipants are displayed in Profile as members list.
+			// We don't add users to mgInfo->lastParticipants here. We're scrolling back and we see messages from users
+			// that could be gone from the megagroup already. It is fine for chat->lastAuthors, because they're used
+			// only for field autocomplete, but this is bad for megagroups, because its lastParticipants are displayed
+			// in Profile as members list.
 			markupSenders = &peer->asChannel()->mgInfo->markupSenders;
 		}
 		for (auto i = block->items.size(); i > 0; --i) {
@@ -1632,7 +1629,7 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice) {
 }
 
 void History::addNewerSlice(const QVector<MTPMessage> &slice) {
-	bool wasEmpty = isEmpty(), wasLoadedAtBottom = loadedAtBottom();
+	bool wasLoadedAtBottom = loadedAtBottom();
 
 	if (slice.isEmpty()) {
 		newLoaded = true;
@@ -1981,7 +1978,6 @@ HistoryBlock *History::finishBuildingFrontBlock() {
 	auto block = _buildingFrontBlock->block;
 	if (block) {
 		if (blocks.size() > 1) {
-			auto last = block->items.back(); // ... item, item, item, last ], [ first, item, item ...
 			auto first = blocks[1]->items.front();
 
 			// we've added a new front block, so previous item for
diff --git a/Telegram/SourceFiles/history/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/history_admin_log_inner.cpp
index 7ca033c47..465309ff4 100644
--- a/Telegram/SourceFiles/history/history_admin_log_inner.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_inner.cpp
@@ -724,7 +724,6 @@ void InnerWidget::clearAfterFilterChange() {
 }
 
 void InnerWidget::paintEmpty(Painter &p) {
-	style::font font(st::msgServiceFont);
 	auto rectWidth = st::historyAdminLogEmptyWidth;
 	auto innerWidth = rectWidth - st::historyAdminLogEmptyPadding.left() - st::historyAdminLogEmptyPadding.right();
 	auto rectHeight = st::historyAdminLogEmptyPadding.top() + _emptyText.countHeight(innerWidth) +
@@ -877,8 +876,6 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
 			suggestRestrictUser(user);
 		}
 	} else { // maybe cursor on some text history item?
-		bool canDelete = item && item->canDelete() && (item->id > 0 || !item->serviceMsg());
-		bool canForward = item && item->canForward();
 
 		auto msg = dynamic_cast<HistoryMessage *>(item);
 		if (isUponSelected > 0) {
@@ -966,7 +963,7 @@ void InnerWidget::savePhotoToFile(PhotoData *photo) {
 
 	auto filter = qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter();
 	FileDialog::GetWritePath(lang(lng_save_photo), filter, filedialogDefaultName(qsl("photo"), qsl(".jpg")),
-	                         base::lambda_guarded(this, [this, photo](const QString &result) {
+	                         base::lambda_guarded(this, [photo](const QString &result) {
 		                         if (!result.isEmpty()) {
 			                         photo->full->pix().toImage().save(result, "JPG");
 		                         }
@@ -1090,7 +1087,7 @@ void InnerWidget::suggestRestrictUser(not_null<UserData *> user) {
 			editRestrictions(true, MTP_channelBannedRights(MTP_flags(0), MTP_int(0)));
 		} else {
 			request(MTPchannels_GetParticipant(_channel->inputChannel, user->inputUser))
-			    .done([this, editRestrictions](const MTPchannels_ChannelParticipant &result) {
+			    .done([editRestrictions](const MTPchannels_ChannelParticipant &result) {
 				    Expects(result.type() == mtpc_channels_channelParticipant);
 				    auto &participant = result.c_channels_channelParticipant();
 				    App::feedUsers(participant.vusers);
@@ -1103,7 +1100,7 @@ void InnerWidget::suggestRestrictUser(not_null<UserData *> user) {
 					    editRestrictions(hasAdminRights, MTP_channelBannedRights(MTP_flags(0), MTP_int(0)));
 				    }
 			    })
-			    .fail([this, editRestrictions](const RPCError &error) {
+			    .fail([editRestrictions](const RPCError &error) {
 				    editRestrictions(false, MTP_channelBannedRights(MTP_flags(0), MTP_int(0)));
 			    })
 			    .send();
diff --git a/Telegram/SourceFiles/history/history_admin_log_section.cpp b/Telegram/SourceFiles/history/history_admin_log_section.cpp
index b8fe16534..26b5c0b00 100644
--- a/Telegram/SourceFiles/history/history_admin_log_section.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_section.cpp
@@ -261,7 +261,7 @@ Widget::Widget(QWidget *parent, not_null<Window::Controller *> controller, not_n
 
 	connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); });
 
-	_whatIsThis->setClickedCallback([this] { Ui::show(Box<InformBox>(lang(lng_admin_log_about_text))); });
+	_whatIsThis->setClickedCallback([] { Ui::show(Box<InformBox>(lang(lng_admin_log_about_text))); });
 }
 
 void Widget::showFilter() {
diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp
index daf956faf..6757d5933 100644
--- a/Telegram/SourceFiles/history/history_inner_widget.cpp
+++ b/Telegram/SourceFiles/history/history_inner_widget.cpp
@@ -668,7 +668,6 @@ void HistoryInner::touchDeaccelerate(qint32 elapsed) {
 }
 
 void HistoryInner::touchEvent(QTouchEvent *e) {
-	const Qt::TouchPointStates &states(e->touchPointStates());
 	if (e->type() == QEvent::TouchCancel) { // cancel
 		if (!_touchInProgress) return;
 		_touchInProgress = false;
diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp
index 4ca52fda5..f073e5759 100644
--- a/Telegram/SourceFiles/history/history_item.cpp
+++ b/Telegram/SourceFiles/history/history_item.cpp
@@ -133,7 +133,6 @@ void ReplyKeyboard::updateMessageId() {
 void ReplyKeyboard::resize(int width, int height) {
 	_width = width;
 
-	auto markup = _item->Get<HistoryMessageReplyMarkup>();
 	double y = 0,
 	       buttonHeight = _rows.isEmpty() ? _st->buttonHeight() : (double(height + _st->buttonSkip()) / _rows.size());
 	for (auto &row : _rows) {
@@ -522,7 +521,6 @@ void HistoryMessageUnreadBar::paint(Painter &p, int y, int w) const {
 	p.setFont(st::historyUnreadBarFont);
 	p.setPen(st::historyUnreadBarFg);
 
-	int left = st::msgServiceMargin.left();
 	int maxwidth = w;
 	if (Adaptive::ChatWide()) {
 		maxwidth = std::min(maxwidth, qint32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left()));
diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp
index 403b725b4..6a433b062 100644
--- a/Telegram/SourceFiles/history/history_media_types.cpp
+++ b/Telegram/SourceFiles/history/history_media_types.cpp
@@ -1542,10 +1542,8 @@ HistoryTextState HistoryDocument::getState(QPoint point, HistoryStateRequest req
 
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return result;
 
-	bool out = _parent->out(), isPost = _parent->isPost();
 	bool loaded = _data->loaded();
 
-	bool showPause = updateStatusText();
 
 	qint32 nameleft = 0, nametop = 0, nameright = 0, linktop = 0, bottom = 0;
 	auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
@@ -2842,7 +2840,6 @@ void HistorySticker::draw(Painter &p, const QRect &r, TextSelection selection, T
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return;
 
 	_data->checkSticker();
-	bool loaded = _data->loaded();
 	bool selected = (selection == FullSelection);
 
 	bool out = _parent->out(), isPost = _parent->isPost(), childmedia = (_parent->getMedia() != this);
@@ -3200,7 +3197,6 @@ void HistoryContact::draw(Painter &p, const QRect &r, TextSelection selection, T
 
 HistoryTextState HistoryContact::getState(QPoint point, HistoryStateRequest request) const {
 	HistoryTextState result;
-	bool out = _parent->out(), isPost = _parent->isPost();
 
 	qint32 nameleft = 0, linktop = 0;
 	auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
@@ -3506,7 +3502,6 @@ void HistoryWebPage::initDimensions() {
 	}
 
 	// init dimensions
-	auto l = st::msgPadding.left() + st::webPageLeft, r = st::msgPadding.right();
 	auto skipBlockWidth = _parent->skipBlockWidth();
 	_maxw = skipBlockWidth;
 	_minh = 0;
@@ -3680,8 +3675,6 @@ void HistoryWebPage::draw(Painter &p, const QRect &r, TextSelection selection, T
 	                         (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
 	auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) :
 	                            (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
-	auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) :
-	                           (outbg ? st::msgOutDateFg : st::msgInDateFg);
 
 	QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
 	auto padding = inBubblePadding();
@@ -4044,7 +4037,6 @@ void HistoryGame::initDimensions() {
 	}
 
 	// init dimensions
-	qint32 l = st::msgPadding.left() + st::webPageLeft, r = st::msgPadding.right();
 	qint32 skipBlockWidth = _parent->skipBlockWidth();
 	_maxw = skipBlockWidth;
 	_minh = 0;
@@ -4143,7 +4135,7 @@ int HistoryGame::resizeGetHeight(int width) {
 
 void HistoryGame::draw(Painter &p, const QRect &r, TextSelection selection, TimeMs ms) const {
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return;
-	qint32 width = _width, height = _height;
+	qint32 width = _width;
 
 	bool out = _parent->out(), isPost = _parent->isPost(), outbg = out && !isPost;
 	bool selected = (selection == FullSelection);
@@ -4152,8 +4144,6 @@ void HistoryGame::draw(Painter &p, const QRect &r, TextSelection selection, Time
 	                         (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
 	auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) :
 	                            (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
-	auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) :
-	                           (outbg ? st::msgOutDateFg : st::msgInDateFg);
 
 	QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
 	auto padding = inBubblePadding();
@@ -4226,7 +4216,7 @@ HistoryTextState HistoryGame::getState(QPoint point, HistoryStateRequest request
 	HistoryTextState result;
 
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return result;
-	qint32 width = _width, height = _height;
+	qint32 width = _width;
 
 	QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
 	auto padding = inBubblePadding();
@@ -4501,7 +4491,6 @@ void HistoryInvoice::initDimensions() {
 	}
 
 	// init dimensions
-	qint32 l = st::msgPadding.left(), r = st::msgPadding.right();
 	qint32 skipBlockWidth = _parent->skipBlockWidth();
 	_maxw = skipBlockWidth;
 	_minh = 0;
@@ -4589,17 +4578,13 @@ int HistoryInvoice::resizeGetHeight(int width) {
 
 void HistoryInvoice::draw(Painter &p, const QRect &r, TextSelection selection, TimeMs ms) const {
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return;
-	qint32 width = _width, height = _height;
+	qint32 width = _width;
 
 	bool out = _parent->out(), isPost = _parent->isPost(), outbg = out && !isPost;
 	bool selected = (selection == FullSelection);
 
-	auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) :
-	                         (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
 	auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) :
 	                            (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
-	auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) :
-	                           (outbg ? st::msgOutDateFg : st::msgInDateFg);
 
 	QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
 	auto padding = inBubblePadding();
@@ -4647,7 +4632,6 @@ void HistoryInvoice::draw(Painter &p, const QRect &r, TextSelection selection, T
 		p.translate(attachLeft, attachTop);
 		_attach->draw(p, r.translated(-attachLeft, -attachTop), attachSelection, ms);
 		auto pixwidth = _attach->currentWidth();
-		auto pixheight = _attach->height();
 
 		auto available = _status.maxWidth();
 		auto statusW = available + 2 * st::msgDateImgPadding.x();
diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp
index 6ba65c27b..9c8e62198 100644
--- a/Telegram/SourceFiles/history/history_message.cpp
+++ b/Telegram/SourceFiles/history/history_message.cpp
@@ -711,7 +711,7 @@ HistoryMessage::HistoryMessage(not_null<History *> history, MsgId id, MTPDmessag
 
 	createComponents(config);
 
-	auto cloneMedia = [this, history, mediaType] {
+	auto cloneMedia = [history, mediaType] {
 		if (mediaType == MediaTypeWebPage) {
 			if (auto channel = history->peer->asChannel()) {
 				if (channel->restrictedRights().is_embed_links()) {
@@ -1840,7 +1840,7 @@ void HistoryMessage::paintFromName(Painter &p, QRect &trect, bool selected) cons
 
 void HistoryMessage::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const {
 	if (displayForwardedFrom()) {
-		style::font serviceFont(st::msgServiceFont), serviceName(st::msgServiceNameFont);
+		style::font serviceFont(st::msgServiceFont);
 
 		auto outbg = hasOutLayout();
 		p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) :
@@ -2180,7 +2180,6 @@ void HistoryMessage::updatePressed(QPoint point) {
 
 	if (drawBubble()) {
 		auto mediaDisplayed = _media && _media->isDisplayed();
-		auto top = marginTop();
 		auto trect = g.marginsAdded(-st::msgPadding);
 		if (mediaDisplayed && _media->isBubbleTop()) {
 			trect.setY(trect.y() - st::msgPadding.top());
@@ -2205,7 +2204,6 @@ void HistoryMessage::updatePressed(QPoint point) {
 			trect.setHeight(trect.height() + st::msgPadding.bottom());
 		}
 
-		auto needDateCheck = true;
 		if (mediaDisplayed) {
 			auto mediaAboveText = _media->isAboveMessage();
 			auto mediaHeight = _media->height();
diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp
index 48dcd662b..fc2a2de87 100644
--- a/Telegram/SourceFiles/history/history_widget.cpp
+++ b/Telegram/SourceFiles/history/history_widget.cpp
@@ -4785,9 +4785,6 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, bool silent,
 
 void HistoryWidget::onPhotoProgress(const FullMsgId &newId) {
 	if (auto item = App::histItemById(newId)) {
-		auto photo = (item->getMedia() && item->getMedia()->type() == MediaTypePhoto) ?
-		                 static_cast<HistoryPhoto *>(item->getMedia())->photo() :
-		                 nullptr;
 		if (!item->isPost()) {
 			updateSendAction(item->history(), SendAction::Type::UploadPhoto, 0);
 		}
@@ -5570,7 +5567,6 @@ void HistoryWidget::onInlineResultSend(InlineBots::Result *result, UserData *bot
 
 	bool lastKeyboardUsed = lastForceReplyReplied();
 
-	bool out = !_peer->isSelf(), unread = !_peer->isSelf();
 	auto flags = NewMessageFlags(_peer) | MTPDmessage::Flag::f_media; // unread, out
 	auto sendFlags = MTPmessages_SendInlineBotResult::Flag::f_clear_draft | 0;
 	if (replyToId()) {
@@ -5753,7 +5749,6 @@ bool HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti
 
 	bool lastKeyboardUsed = lastForceReplyReplied();
 
-	bool out = !_peer->isSelf(), unread = !_peer->isSelf();
 	auto flags = NewMessageFlags(_peer) | MTPDmessage::Flag::f_media; // unread, out
 	auto sendFlags = MTPmessages_SendMedia::Flags(0);
 	if (replyToId()) {
@@ -5817,7 +5812,6 @@ void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption)
 
 	bool lastKeyboardUsed = lastForceReplyReplied();
 
-	bool out = !_peer->isSelf(), unread = !_peer->isSelf();
 	auto flags = NewMessageFlags(_peer) | MTPDmessage::Flag::f_media; // unread, out
 	auto sendFlags = MTPmessages_SendMedia::Flags(0);
 	if (replyToId()) {
@@ -6878,8 +6872,6 @@ void HistoryWidget::drawPinnedBar(Painter &p) {
 	Expects(_pinnedBar != nullptr);
 
 	auto top = _topBar->bottomNoMargins();
-	Text *from = 0, *text = 0;
-	bool serviceColor = false, hasForward = readyToForward();
 	ImagePtr preview;
 	p.fillRect(myrtlrect(0, top, _chatWidth, st::historyReplyHeight), st::historyPinnedBg);
 
diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
index 34b05b295..981e1e1dc 100644
--- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
+++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
@@ -396,8 +396,6 @@ void Sticker::preload() const {
 }
 
 void Sticker::paint(Painter &p, const QRect &clip, const PaintContext *context) const {
-	bool loaded = getShownDocument()->loaded();
-
 	auto over = _a_over.current(context->ms, _active ? 1. : 0.);
 	if (over > 0) {
 		p.setOpacity(over);
@@ -591,7 +589,6 @@ void Video::initDimensions() {
 	bool withThumb = !content_thumb()->isNull();
 
 	_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
-	qint32 textWidth = _maxw - (withThumb ? (st::inlineThumbSize + st::inlineThumbSkip) : 0);
 	TextParseOptions titleOpts = {0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto};
 	auto title = TextUtilities::SingleLine(_result->getLayoutTitle());
 	if (title.isEmpty()) {
@@ -609,7 +606,6 @@ void Video::initDimensions() {
 		description = _duration;
 	}
 	_description.setText(st::defaultTextStyle, description, descriptionOpts);
-	qint32 descriptionHeight = std::min(_description.countHeight(_maxw), descriptionLines * st::normalFont->height);
 
 	_minh = st::inlineThumbSize;
 	_minh += st::inlineRowMargin * 2 + st::inlineRowBorder;
@@ -716,7 +712,6 @@ File::File(not_null<Context *> context, Result *result)
 
 void File::initDimensions() {
 	_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
-	int textWidth = _maxw - (st::msgFileSize + st::inlineThumbSkip);
 
 	TextParseOptions titleOpts = {0, _maxw, st::semiboldFont->height, Qt::LayoutDirectionAuto};
 	_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
@@ -732,7 +727,7 @@ void File::paint(Painter &p, const QRect &clip, const PaintContext *context) con
 	qint32 left = st::msgFileSize + st::inlineThumbSkip;
 
 	DocumentData *document = getShownDocument();
-	bool loaded = document->loaded(), displayLoading = document->displayLoading();
+	bool displayLoading = document->displayLoading();
 	if (displayLoading) {
 		ensureAnimation();
 		if (!_animation->radial.animating()) {
@@ -934,14 +929,11 @@ Contact::Contact(not_null<Context *> context, Result *result)
 
 void Contact::initDimensions() {
 	_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
-	qint32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip);
 	TextParseOptions titleOpts = {0, _maxw, st::semiboldFont->height, Qt::LayoutDirectionAuto};
 	_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
-	qint32 titleHeight = std::min(_title.countHeight(_maxw), st::semiboldFont->height);
 
 	TextParseOptions descriptionOpts = {TextParseMultiline, _maxw, st::normalFont->height, Qt::LayoutDirectionAuto};
 	_description.setText(st::defaultTextStyle, _result->getLayoutDescription(), descriptionOpts);
-	qint32 descriptionHeight = std::min(_description.countHeight(_maxw), st::normalFont->height);
 
 	_minh = st::msgFileSize;
 	_minh += st::inlineRowMargin * 2 + st::inlineRowBorder;
@@ -1036,7 +1028,6 @@ Article::Article(not_null<Context *> context, Result *result, bool withThumb)
 
 void Article::initDimensions() {
 	_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
-	qint32 textWidth = _maxw - (_withThumb ? (st::inlineThumbSize + st::inlineThumbSkip) : 0);
 	TextParseOptions titleOpts = {0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto};
 	_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
 	qint32 titleHeight = std::min(_title.countHeight(_maxw), 2 * st::semiboldFont->height);
@@ -1213,7 +1204,6 @@ void Game::countFrameSize() {
 
 void Game::initDimensions() {
 	_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
-	qint32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip);
 	TextParseOptions titleOpts = {0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto};
 	_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
 	qint32 titleHeight = std::min(_title.countHeight(_maxw), 2 * st::semiboldFont->height);
@@ -1250,7 +1240,7 @@ void Game::paint(Painter &p, const QRect &clip, const PaintContext *context) con
 	if (animatedThumb) {
 		document->automaticLoad(nullptr);
 
-		bool loaded = document->loaded(), loading = document->loading(), displayLoading = document->displayLoading();
+		bool loaded = document->loaded(), displayLoading = document->displayLoading();
 		if (loaded && !_gif && !_gif.isBad()) {
 			auto that = const_cast<Game *>(this);
 			that->_gif = Media::Clip::MakeReader(document, FullMsgId(), [that](Media::Clip::Notification notification) {
diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp
index 2ea5810b1..469639516 100644
--- a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp
+++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp
@@ -448,7 +448,7 @@ int Inner::refreshInlineRows(PeerData *queryPeer, UserData *bot, const CacheEntr
 	_inlineBot = bot;
 	_inlineQueryPeer = queryPeer;
 	refreshSwitchPmButton(entry);
-	auto clearResults = [this, entry]() {
+	auto clearResults = [entry]() {
 		if (!entry) {
 			return true;
 		}
@@ -589,7 +589,6 @@ bool Inner::inlineItemVisible(const ItemBase *layout) {
 	int row = position / MatrixRowShift, col = position % MatrixRowShift;
 	Assert((row < _rows.size()) && (col < _rows[row].items.size()));
 
-	auto &inlineItems = _rows[row].items;
 	int top = st::stickerPanPadding;
 	for (qint32 i = 0; i < row; ++i) {
 		top += _rows.at(i).height;
@@ -603,7 +602,6 @@ void Inner::updateSelected() {
 		return;
 	}
 
-	auto newSelected = -1;
 	auto p = mapFromGlobal(_lastMousePos);
 
 	int sx = (rtl() ? width() - p.x() : p.x()) - (st::inlineResultsLeft - st::buttonRadius);
diff --git a/Telegram/SourceFiles/intro/introwidget.cpp b/Telegram/SourceFiles/intro/introwidget.cpp
index 74e50a88b..f185fad4e 100644
--- a/Telegram/SourceFiles/intro/introwidget.cpp
+++ b/Telegram/SourceFiles/intro/introwidget.cpp
@@ -105,7 +105,7 @@ void Widget::createLanguageLink() {
 		_changeLanguage->show();
 		_changeLanguage->hideFast();
 		_changeLanguage->entity()->setClickedCallback(
-		    [this, languageId] { Lang::CurrentCloudManager().switchToLanguage(languageId); });
+		    [languageId] { Lang::CurrentCloudManager().switchToLanguage(languageId); });
 		_changeLanguage->toggleAnimated(!_resetAccount);
 		updateControlsGeometry();
 	};
@@ -118,7 +118,7 @@ void Widget::createLanguageLink() {
 	} else if (!suggestedId.isEmpty() && suggestedId != currentId) {
 		request(
 		    MTPlangpack_GetStrings(MTP_string(suggestedId), MTP_vector<MTPstring>(1, MTP_string("lng_switch_to_this"))))
-		    .done([this, suggestedId, createLink](const MTPVector<MTPLangPackString> &result) {
+		    .done([suggestedId, createLink](const MTPVector<MTPLangPackString> &result) {
 			    auto strings = Lang::Instance::ParseStrings(result);
 			    auto it = strings.find(lng_switch_to_this);
 			    if (it != strings.end()) {
diff --git a/Telegram/SourceFiles/lang/lang_file_parser.cpp b/Telegram/SourceFiles/lang/lang_file_parser.cpp
index 775e0810f..3c4b648e7 100644
--- a/Telegram/SourceFiles/lang/lang_file_parser.cpp
+++ b/Telegram/SourceFiles/lang/lang_file_parser.cpp
@@ -181,7 +181,6 @@ QByteArray FileParser::ReadFile(const QString &absolutePath, const QString &rela
 	file.seek(0);
 
 	QByteArray data;
-	int skip = 0;
 	auto readUtf16Stream = [relativePath, absolutePath](auto &&stream) {
 		stream.setCodec("UTF-16");
 		auto string = stream.readAll();
diff --git a/Telegram/SourceFiles/media/media_audio.cpp b/Telegram/SourceFiles/media/media_audio.cpp
index 1408df743..723f2e5b9 100644
--- a/Telegram/SourceFiles/media/media_audio.cpp
+++ b/Telegram/SourceFiles/media/media_audio.cpp
@@ -1393,7 +1393,6 @@ public:
 			return false;
 		}
 
-		int res = 0;
 		char err[AV_ERROR_MAX_STRING_SIZE] = {0};
 
 		int videoStreamId = av_find_best_stream(fmtContext, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0);
diff --git a/Telegram/SourceFiles/media/player/media_player_cover.cpp b/Telegram/SourceFiles/media/player/media_player_cover.cpp
index b17954a04..cf20ad462 100644
--- a/Telegram/SourceFiles/media/player/media_player_cover.cpp
+++ b/Telegram/SourceFiles/media/player/media_player_cover.cpp
@@ -100,13 +100,13 @@ CoverWidget::CoverWidget(QWidget *parent)
 		_playback->setValue(value, false);
 		handleSeekFinished(value);
 	});
-	_playPause->setClickedCallback([this] { instance()->playPauseCancelClicked(AudioMsgId::Type::Song); });
+	_playPause->setClickedCallback([] { instance()->playPauseCancelClicked(AudioMsgId::Type::Song); });
 
 	updateRepeatTrackIcon();
-	_repeatTrack->setClickedCallback([this] { instance()->toggleRepeat(AudioMsgId::Type::Song); });
+	_repeatTrack->setClickedCallback([] { instance()->toggleRepeat(AudioMsgId::Type::Song); });
 
 	updateVolumeToggleIcon();
-	_volumeToggle->setClickedCallback([this]() {
+	_volumeToggle->setClickedCallback([]() {
 		Global::SetSongVolume((Global::SongVolume() > 0) ? 0. : Global::RememberedSongVolume());
 		mixer()->setSongVolume(Global::SongVolume());
 		Global::RefSongVolumeChanged().notify();
@@ -359,10 +359,10 @@ void CoverWidget::createPrevNextButtons() {
 	if (!_previousTrack) {
 		_previousTrack.create(this, st::mediaPlayerPanelPreviousButton);
 		_previousTrack->show();
-		_previousTrack->setClickedCallback([this]() { instance()->previous(); });
+		_previousTrack->setClickedCallback([]() { instance()->previous(); });
 		_nextTrack.create(this, st::mediaPlayerPanelNextButton);
 		_nextTrack->show();
-		_nextTrack->setClickedCallback([this]() { instance()->next(); });
+		_nextTrack->setClickedCallback([]() { instance()->next(); });
 		updatePlayPrevNextPositions();
 	}
 }
diff --git a/Telegram/SourceFiles/media/player/media_player_panel.cpp b/Telegram/SourceFiles/media/player/media_player_panel.cpp
index d0fa09093..241d50a9e 100644
--- a/Telegram/SourceFiles/media/player/media_player_panel.cpp
+++ b/Telegram/SourceFiles/media/player/media_player_panel.cpp
@@ -118,7 +118,6 @@ int Panel::bestPositionFor(int left) const {
 void Panel::scrollPlaylistToCurrentTrack() {
 	if (auto list = static_cast<ListWidget *>(_scroll->widget())) {
 		auto rect = list->getCurrentTrackGeometry();
-		auto top = _scroll->scrollTop(), bottom = top + _scroll->height();
 		_scroll->scrollToY(rect.y());
 	}
 }
diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp
index fcc4af657..1da8b804e 100644
--- a/Telegram/SourceFiles/media/player/media_player_widget.cpp
+++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp
@@ -124,7 +124,7 @@ Widget::Widget(QWidget *parent)
 	_playPause->setClickedCallback([this] { instance()->playPauseCancelClicked(_type); });
 
 	updateVolumeToggleIcon();
-	_volumeToggle->setClickedCallback([this] {
+	_volumeToggle->setClickedCallback([] {
 		Global::SetSongVolume((Global::SongVolume() > 0) ? 0. : Global::RememberedSongVolume());
 		mixer()->setSongVolume(Global::SongVolume());
 		Global::RefSongVolumeChanged().notify();
@@ -132,7 +132,7 @@ Widget::Widget(QWidget *parent)
 	subscribe(Global::RefSongVolumeChanged(), [this] { updateVolumeToggleIcon(); });
 
 	updateRepeatTrackIcon();
-	_repeatTrack->setClickedCallback([this] { instance()->toggleRepeat(AudioMsgId::Type::Song); });
+	_repeatTrack->setClickedCallback([] { instance()->toggleRepeat(AudioMsgId::Type::Song); });
 
 	subscribe(instance()->repeatChangedNotifier(), [this](AudioMsgId::Type type) {
 		if (type == _type) {
@@ -242,7 +242,6 @@ void Widget::handleSeekProgress(double progress) {
 void Widget::handleSeekFinished(double progress) {
 	if (!_lastDurationMs) return;
 
-	auto positionMs = snap(static_cast<TimeMs>(progress * _lastDurationMs), Q_INT64_C(0), _lastDurationMs);
 	_seekPositionMs = -1;
 
 	auto state = mixer()->currentState(_type);
@@ -538,10 +537,10 @@ void Widget::createPrevNextButtons() {
 	if (!_previousTrack) {
 		_previousTrack.create(this, st::mediaPlayerPreviousButton);
 		_previousTrack->show();
-		_previousTrack->setClickedCallback([this]() { instance()->previous(); });
+		_previousTrack->setClickedCallback([]() { instance()->previous(); });
 		_nextTrack.create(this, st::mediaPlayerNextButton);
 		_nextTrack->show();
-		_nextTrack->setClickedCallback([this]() { instance()->next(); });
+		_nextTrack->setClickedCallback([]() { instance()->next(); });
 		updatePlayPrevNextPositions();
 	}
 }
diff --git a/Telegram/SourceFiles/media/view/media_clip_controller.cpp b/Telegram/SourceFiles/media/view/media_clip_controller.cpp
index 7502b23b2..979f30be0 100644
--- a/Telegram/SourceFiles/media/view/media_clip_controller.cpp
+++ b/Telegram/SourceFiles/media/view/media_clip_controller.cpp
@@ -129,7 +129,7 @@ void Controller::updatePlayPauseResumeState(const Player::TrackState &state) {
 }
 
 void Controller::updateTimeTexts(const Player::TrackState &state) {
-	qint64 position = 0, length = state.length;
+	qint64 position = 0;
 
 	if (Player::IsStoppedAtEnd(state.state)) {
 		position = state.length;
diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp
index 0b3f9d984..641463253 100644
--- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp
+++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp
@@ -974,7 +974,7 @@ bool Instance::Private::onErrorDefault(mtpRequestId requestId, const RPCError &e
 	auto &err(error.type());
 	auto code = error.code();
 	if (!isFloodError(error) && err != qstr("AUTH_KEY_UNREGISTERED")) {
-		int breakpoint = 0;
+		// int breakpoint = 0;
 	}
 	auto badGuestDc = (code == 400) && (err == qsl("FILE_ID_INVALID"));
 	QRegularExpressionMatch m;
diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp
index 88509d4f3..b24f2b61d 100644
--- a/Telegram/SourceFiles/overview/overview_layout.cpp
+++ b/Telegram/SourceFiles/overview/overview_layout.cpp
@@ -555,7 +555,7 @@ void Voice::paint(Painter &p, const QRect &clip, TextSelection selection, const
 	}
 	bool radial = isRadialAnimation(context->ms);
 
-	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, datetop = -1;
+	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0;
 
 	nameleft = _st.songPadding.left() + _st.songThumbSize + _st.songPadding.right();
 	nameright = _st.songPadding.left();
@@ -639,7 +639,7 @@ void Voice::paint(Painter &p, const QRect &clip, TextSelection selection, const
 void Voice::getState(ClickHandlerPtr &link, HistoryCursorState &cursor, QPoint point) const {
 	bool loaded = _data->loaded();
 
-	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, datetop = 0;
+	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0;
 
 	nameleft = _st.songPadding.left() + _st.songThumbSize + _st.songPadding.right();
 	nameright = _st.songPadding.left();
@@ -932,8 +932,6 @@ void Document::getState(ClickHandlerPtr &link, HistoryCursorState &cursor, QPoin
 	bool loaded = _data->loaded() || Local::willStickerImageLoad(_data->mediaKey());
 
 	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, datetop = 0;
-	bool wthumb = withThumb();
-
 	if (_data->song()) {
 		nameleft = _st.songPadding.left() + _st.songThumbSize + _st.songPadding.right();
 		nameright = _st.songPadding.left();
diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp
index 64acf4034..eee36897c 100644
--- a/Telegram/SourceFiles/overviewwidget.cpp
+++ b/Telegram/SourceFiles/overviewwidget.cpp
@@ -368,7 +368,6 @@ void OverviewInner::touchDeaccelerate(qint32 elapsed) {
 }
 
 void OverviewInner::touchEvent(QTouchEvent *e) {
-	const Qt::TouchPointStates &states(e->touchPointStates());
 	if (e->type() == QEvent::TouchCancel) { // cancel
 		if (!_touchInProgress) return;
 		_touchInProgress = false;
diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp
index 47467d6d7..a14912309 100644
--- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp
@@ -48,7 +48,7 @@ GroupMembersWidget::GroupMembersWidget(QWidget *parent, PeerData *peer, TitleVis
 	          Notify::PeerUpdatedHandler(observeEvents,
 	                                     [this](const Notify::PeerUpdate &update) { notifyPeerUpdated(update); }));
 
-	setRemovedCallback([this, peer](PeerData *selectedPeer) { removePeer(selectedPeer); });
+	setRemovedCallback([this](PeerData *selectedPeer) { removePeer(selectedPeer); });
 	setSelectedCallback([](PeerData *selectedPeer) { Ui::showPeerProfile(selectedPeer); });
 	setUpdateItemCallback([this](Item *item) { updateItemStatusText(item); });
 	setPreloadMoreCallback([this] { preloadMore(); });
@@ -203,22 +203,9 @@ Ui::PopupMenu *GroupMembersWidget::fillPeerMenu(PeerData *selectedPeer) {
 	auto user = selectedPeer->asUser();
 	auto result = new Ui::PopupMenu(nullptr);
 	result->addAction(lang(lng_context_view_profile), [selectedPeer] { Ui::showPeerProfile(selectedPeer); });
-	auto chat = peer()->asChat();
 	auto channel = peer()->asMegagroup();
 	for_const (auto item, items()) {
 		if (item->peer == selectedPeer) {
-			auto canRemoveAdmin = [item, chat, channel] {
-				if ((item->adminState == Item::AdminState::Admin) && !item->peer->isSelf()) {
-					if (chat) {
-						// Adding of admins from context menu of chat participants
-						// is not supported, so the removing is also disabled.
-						return false; // chat->amCreator();
-					} else if (channel) {
-						return channel->amCreator();
-					}
-				}
-				return false;
-			};
 			if (channel) {
 				if (channel->canEditAdmin(user)) {
 					auto label = lang((item->adminState != Item::AdminState::None) ? lng_context_edit_permissions :
diff --git a/Telegram/SourceFiles/profile/profile_block_peer_list.cpp b/Telegram/SourceFiles/profile/profile_block_peer_list.cpp
index 7bac0600a..fdcb385ca 100644
--- a/Telegram/SourceFiles/profile/profile_block_peer_list.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_peer_list.cpp
@@ -67,7 +67,6 @@ void PeerListWidget::paintContents(Painter &p) {
 	auto ms = getms();
 	auto left = getListLeft();
 	auto top = getListTop();
-	auto memberRowWidth = rowWidth();
 
 	auto from = floorclamp(_visibleTop - top, st::profileMemberHeight, 0, _items.size());
 	auto to = ceilclamp(_visibleBottom - top, st::profileMemberHeight, 0, _items.size());
diff --git a/Telegram/SourceFiles/profile/profile_inner_widget.cpp b/Telegram/SourceFiles/profile/profile_inner_widget.cpp
index c8e28dff1..e9ab9d9ee 100644
--- a/Telegram/SourceFiles/profile/profile_inner_widget.cpp
+++ b/Telegram/SourceFiles/profile/profile_inner_widget.cpp
@@ -113,7 +113,6 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
 	p.fillRect(e->rect(), st::profileBg);
 
 	if (_mode == Mode::TwoColumn) {
-		int leftHeight = countBlocksHeight(RectPart::Left);
 		int rightHeight = countBlocksHeight(RectPart::Right);
 		int shadowHeight = rightHeight; // std::min(leftHeight, rightHeight);
 
diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp
index 7f4a2a4ea..2dec30df0 100644
--- a/Telegram/SourceFiles/storage/localstorage.cpp
+++ b/Telegram/SourceFiles/storage/localstorage.cpp
@@ -2762,7 +2762,6 @@ FileLocation readFileLocation(MediaKey location, bool check) {
 		location = aliasIt.value();
 	}
 
-	FileLocations::iterator i = _fileLocations.find(location);
 	for (FileLocations::iterator i = _fileLocations.find(location);
 	     (i != _fileLocations.end()) && (i.key() == location);) {
 		if (check) {
@@ -2857,7 +2856,6 @@ public:
 
 		QByteArray imageData;
 		quint64 locFirst, locSecond;
-		quint32 legacyTypeField = 0;
 		readFromStream(image.stream, locFirst, locSecond, imageData);
 
 		// we're saving files now before we have actual location
diff --git a/Telegram/SourceFiles/ui/effects/round_checkbox.cpp b/Telegram/SourceFiles/ui/effects/round_checkbox.cpp
index 65f5e66f8..101001f8a 100644
--- a/Telegram/SourceFiles/ui/effects/round_checkbox.cpp
+++ b/Telegram/SourceFiles/ui/effects/round_checkbox.cpp
@@ -90,7 +90,6 @@ void RoundCheckbox::paint(Painter &p, TimeMs ms, int x, int y, int outerWidth, d
 
 	auto cacheSize = kWideScale * _st.size * cIntRetinaFactor();
 	auto cacheFrom = QRect(0, 0, cacheSize, cacheSize);
-	auto displayInactive = !_inactiveCacheBg.isNull();
 	auto inactiveTo = cacheDestRect(x, y, masterScale);
 
 	PainterHighQualityEnabler hq(p);
diff --git a/Telegram/SourceFiles/ui/images.cpp b/Telegram/SourceFiles/ui/images.cpp
index bb95950ad..3ff602610 100644
--- a/Telegram/SourceFiles/ui/images.cpp
+++ b/Telegram/SourceFiles/ui/images.cpp
@@ -230,7 +230,7 @@ void prepareRound(QImage &image, QImage *cornerMasks, ImageRoundCorners corners)
 	auto intsTopRight = ints + imageWidth - cornerWidth;
 	auto intsBottomLeft = ints + (imageHeight - cornerHeight) * imageWidth;
 	auto intsBottomRight = ints + (imageHeight - cornerHeight + 1) * imageWidth - cornerWidth;
-	auto maskCorner = [imageIntsPerPixel, imageIntsPerLine](quint32 *imageInts, const QImage &mask) {
+	auto maskCorner = [imageIntsPerLine](quint32 *imageInts, const QImage &mask) {
 		auto maskWidth = mask.width();
 		auto maskHeight = mask.height();
 		auto maskBytesPerPixel = (mask.depth() >> 3);
diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp
index 635163714..551dc41e4 100644
--- a/Telegram/SourceFiles/ui/text/text_block.cpp
+++ b/Telegram/SourceFiles/ui/text/text_block.cpp
@@ -161,8 +161,6 @@ public:
 		int item = -1;
 		int newItem = eng->findItem(0);
 
-		style::align alignment = eng->option.alignment();
-
 		const QCharAttributes *attributes = eng->attributes();
 		if (!attributes) return;
 		int end = 0;
diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp
index ff5137d8f..497f1756a 100644
--- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp
+++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp
@@ -302,7 +302,7 @@ void FlatTextarea::touchEvent(QTouchEvent *e) {
 	case QEvent::TouchEnd:
 		if (!_touchPress) return;
 		if (!_touchMove && window()) {
-			QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
+			QPoint mapped(mapFromGlobal(_touchStart));
 
 			if (_touchRightButton) {
 				QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
@@ -1565,7 +1565,7 @@ void FlatInput::touchEvent(QTouchEvent *e) {
 	case QEvent::TouchEnd:
 		if (!_touchPress) return;
 		if (!_touchMove && window()) {
-			QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
+			QPoint mapped(mapFromGlobal(_touchStart));
 
 			if (_touchRightButton) {
 				QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
@@ -1901,8 +1901,7 @@ void InputArea::touchEvent(QTouchEvent *e) {
 	case QEvent::TouchEnd:
 		if (!_touchPress) return;
 		if (!_touchMove && window()) {
-			Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
-			QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
+			QPoint mapped(mapFromGlobal(_touchStart));
 
 			if (_touchRightButton) {
 				QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
@@ -2647,8 +2646,7 @@ void InputField::touchEvent(QTouchEvent *e) {
 	case QEvent::TouchEnd:
 		if (!_touchPress) return;
 		if (!_touchMove && window()) {
-			Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
-			QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
+			QPoint mapped(mapFromGlobal(_touchStart));
 
 			if (_touchRightButton) {
 				QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
@@ -3437,8 +3435,7 @@ void MaskedInputField::touchEvent(QTouchEvent *e) {
 	case QEvent::TouchEnd:
 		if (!_touchPress) return;
 		if (!_touchMove && window()) {
-			Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
-			QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
+			QPoint mapped(mapFromGlobal(_touchStart));
 
 			if (_touchRightButton) {
 				QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
diff --git a/Telegram/SourceFiles/ui/widgets/labels.cpp b/Telegram/SourceFiles/ui/widgets/labels.cpp
index 83a580f2f..ca76c1239 100644
--- a/Telegram/SourceFiles/ui/widgets/labels.cpp
+++ b/Telegram/SourceFiles/ui/widgets/labels.cpp
@@ -441,7 +441,6 @@ bool FlatLabel::event(QEvent *e) {
 }
 
 void FlatLabel::touchEvent(QTouchEvent *e) {
-	const Qt::TouchPointStates &states(e->touchPointStates());
 	if (e->type() == QEvent::TouchCancel) { // cancel
 		if (!_touchInProgress) return;
 		_touchInProgress = false;
diff --git a/Telegram/SourceFiles/ui/widgets/multi_select.cpp b/Telegram/SourceFiles/ui/widgets/multi_select.cpp
index 11586c429..7697479de 100644
--- a/Telegram/SourceFiles/ui/widgets/multi_select.cpp
+++ b/Telegram/SourceFiles/ui/widgets/multi_select.cpp
@@ -743,7 +743,7 @@ void MultiSelect::Inner::removeItem(quint64 itemId) {
 
 			item->hideAnimated();
 			_idsMap.erase(item->id());
-			auto inserted = _removingItems.insert(std::move(item));
+			_removingItems.insert(std::move(item));
 			_items.erase(_items.begin() + i);
 
 			if (_active == i) {
diff --git a/Telegram/SourceFiles/ui/widgets/tooltip.cpp b/Telegram/SourceFiles/ui/widgets/tooltip.cpp
index 7944d5330..895127b1d 100644
--- a/Telegram/SourceFiles/ui/widgets/tooltip.cpp
+++ b/Telegram/SourceFiles/ui/widgets/tooltip.cpp
@@ -59,7 +59,7 @@ Tooltip::Tooltip()
 	setAttribute(Qt::WA_TranslucentBackground, true);
 
 	_showTimer.setCallback([this] { performShow(); });
-	_hideByLeaveTimer.setCallback([this] { Hide(); });
+	_hideByLeaveTimer.setCallback([] { Hide(); });
 
 	connect(App::wnd()->windowHandle(), SIGNAL(activeChanged()), this, SLOT(onWndActiveChanged()));
 }
diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp
index 151ebb0a7..9558ce92b 100644
--- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp
+++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp
@@ -522,7 +522,7 @@ void EditorBlock::saveEditing(QColor value) {
 	auto &row = _data[_editing];
 	auto name = row.name();
 	if (_type == Type::New) {
-		auto removing = std::exchange(_editing, -1);
+		_editing = -1;
 		setSelected(-1);
 		setPressed(-1);
 
diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp
index 0f156b464..01bacc1d7 100644
--- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp
+++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp
@@ -814,7 +814,6 @@ void Generator::paintBubble(const Bubble &bubble) {
 		bubble.text.draw(*_p, trect.x(), trect.y(), trect.width());
 	} else if (!bubble.waveform.isEmpty()) {
 		auto nameleft = x + st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right();
-		auto nameright = st::msgFilePadding.left();
 		auto statustop = y + st::msgFileStatusTop;
 
 		auto inner = rtlrect(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), st::msgFileSize,