From f1b4a86cfea66e82c23de3cc35a5545402810864 Mon Sep 17 00:00:00 2001
From: Evgenii Zheltonozhskii <zheltonozhskiy@gmail.com>
Date: Sat, 20 Oct 2018 10:44:27 +0300
Subject: [PATCH] Fix unused variables, lambda captures.

---
 Telegram/SourceFiles/apiwrap.cpp              |  20 +-
 Telegram/SourceFiles/auth_session.cpp         |   2 +-
 Telegram/SourceFiles/boxes/confirm_box.cpp    |   2 +-
 Telegram/SourceFiles/boxes/peer_list_box.cpp  |   1 -
 .../history/history_admin_log_inner.cpp       | 177 +++++++++---------
 .../history/history_inner_widget.cpp          |   2 +-
 .../history/history_media_types.cpp           |  25 ++-
 Telegram/SourceFiles/layerwidget.cpp          |   7 +-
 Telegram/SourceFiles/mainwidget.cpp           |  56 +++---
 Telegram/SourceFiles/mediaview.cpp            |   4 +-
 Telegram/SourceFiles/mtproto/connection.cpp   |   2 +-
 .../SourceFiles/overview/overview_layout.cpp  |   1 -
 Telegram/SourceFiles/overviewwidget.cpp       |   1 -
 .../profile/profile_block_channel_members.cpp |   2 +-
 .../profile/profile_block_group_members.cpp   |   2 +-
 .../profile/profile_block_info.cpp            |   1 -
 .../profile/profile_block_invite_link.cpp     |   1 -
 .../profile/profile_common_groups_section.cpp |   2 -
 .../settings/settings_block_widget.cpp        |   1 -
 .../settings/settings_privacy_widget.cpp      |   2 +-
 .../ui/effects/panel_animation.cpp            |   3 -
 Telegram/SourceFiles/ui/images.cpp            |   3 +-
 Telegram/SourceFiles/ui/special_buttons.cpp   |   2 +-
 Telegram/SourceFiles/ui/text/text.cpp         |   2 +-
 .../window/notifications_manager.cpp          |   2 +-
 .../window/notifications_manager_default.cpp  |   2 -
 .../themes/window_theme_editor_block.cpp      |   4 +-
 .../window/themes/window_theme_preview.cpp    |   3 -
 .../SourceFiles/window/window_controller.cpp  |  21 +--
 .../window/window_slide_animation.cpp         |   1 -
 30 files changed, 161 insertions(+), 193 deletions(-)

diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp
index 2e376960b..cca1d3ec8 100644
--- a/Telegram/SourceFiles/apiwrap.cpp
+++ b/Telegram/SourceFiles/apiwrap.cpp
@@ -94,7 +94,7 @@ void ApiWrap::requestAppChangelogs() {
 
 void ApiWrap::addLocalChangelogs(int oldAppVersion) {
 	auto addedSome = false;
-	auto addLocalChangelog = [this, &addedSome](const QString &text) {
+	auto addLocalChangelog = [&addedSome](const QString &text) {
 		auto textWithEntities = TextWithEntities{text};
 		TextUtilities::ParseEntities(textWithEntities, TextParseLinks);
 		App::wnd()->serviceNotification(textWithEntities, MTP_messageMediaEmpty(), unixtime());
@@ -542,7 +542,7 @@ void ApiWrap::requestPeers(const QList<PeerData *> &peers) {
 			channels.push_back((*i)->asChannel()->inputChannel);
 		}
 	}
-	auto handleChats = [this](const MTPmessages_Chats &result) {
+	auto handleChats = [](const MTPmessages_Chats &result) {
 		if (auto chats = Api::getChatsFromMessagesChats(result)) {
 			App::feedChats(*chats);
 		}
@@ -555,7 +555,7 @@ void ApiWrap::requestPeers(const QList<PeerData *> &peers) {
 	}
 	if (!users.isEmpty()) {
 		request(MTPusers_GetUsers(MTP_vector<MTPInputUser>(users)))
-		    .done([this](const MTPVector<MTPUser> &result) { App::feedUsers(result); })
+		    .done([](const MTPVector<MTPUser> &result) { App::feedUsers(result); })
 		    .send();
 	}
 }
@@ -1192,7 +1192,7 @@ void ApiWrap::handlePrivacyChange(mtpTypeId keyTypeId, const MTPVector<MTPPrivac
 		}
 
 		auto now = unixtime();
-		App::enumerateUsers([&userRules, contactsRule, everyoneRule, now](UserData *user) {
+		App::enumerateUsers([now](UserData *user) {
 			if (user->isSelf() || user->loadedStatus != PeerData::FullLoaded) {
 				return;
 			}
@@ -1460,7 +1460,7 @@ void ApiWrap::resolveWebPages() {
 }
 
 void ApiWrap::requestParticipantsCountDelayed(ChannelData *channel) {
-	_participantsCountRequestTimer.call(kReloadChannelMembersTimeout, [this, channel] { channel->updateFullForced(); });
+	_participantsCountRequestTimer.call(kReloadChannelMembersTimeout, [channel] { channel->updateFullForced(); });
 }
 
 void ApiWrap::gotWebPages(ChannelData *channel, const MTPmessages_Messages &msgs, mtpRequestId req) {
@@ -1587,7 +1587,7 @@ void ApiWrap::requestStickers(TimeId now) {
 	};
 	_stickersUpdateRequest = request(MTPmessages_GetAllStickers(MTP_int(Local::countStickersHash(true))))
 	                             .done(onDone)
-	                             .fail([this, onDone](const RPCError &error) {
+	                             .fail([onDone](const RPCError &error) {
 		                             LOG(("App Fail: Failed to get stickers!"));
 		                             onDone(MTP_messages_allStickersNotModified());
 	                             })
@@ -1619,7 +1619,7 @@ void ApiWrap::requestRecentStickers(TimeId now) {
 	_recentStickersUpdateRequest =
 	    request(MTPmessages_GetRecentStickers(MTP_flags(0), MTP_int(Local::countRecentStickersHash())))
 	        .done(onDone)
-	        .fail([this, onDone](const RPCError &error) {
+	        .fail([onDone](const RPCError &error) {
 		        LOG(("App Fail: Failed to get recent stickers!"));
 		        onDone(MTP_messages_recentStickersNotModified());
 	        })
@@ -1650,7 +1650,7 @@ void ApiWrap::requestFavedStickers(TimeId now) {
 	};
 	_favedStickersUpdateRequest = request(MTPmessages_GetFavedStickers(MTP_int(Local::countFavedStickersHash())))
 	                                  .done(onDone)
-	                                  .fail([this, onDone](const RPCError &error) {
+	                                  .fail([onDone](const RPCError &error) {
 		                                  LOG(("App Fail: Failed to get faved stickers!"));
 		                                  onDone(MTP_messages_favedStickersNotModified());
 	                                  })
@@ -1682,7 +1682,7 @@ void ApiWrap::requestFeaturedStickers(TimeId now) {
 	_featuredStickersUpdateRequest =
 	    request(MTPmessages_GetFeaturedStickers(MTP_int(Local::countFeaturedStickersHash())))
 	        .done(onDone)
-	        .fail([this, onDone](const RPCError &error) {
+	        .fail([onDone](const RPCError &error) {
 		        LOG(("App Fail: Failed to get featured stickers!"));
 		        onDone(MTP_messages_featuredStickersNotModified());
 	        })
@@ -1712,7 +1712,7 @@ void ApiWrap::requestSavedGifs(TimeId now) {
 	};
 	_savedGifsUpdateRequest = request(MTPmessages_GetSavedGifs(MTP_int(Local::countSavedGifsHash())))
 	                              .done(onDone)
-	                              .fail([this, onDone](const RPCError &error) {
+	                              .fail([onDone](const RPCError &error) {
 		                              LOG(("App Fail: Failed to get saved gifs!"));
 		                              onDone(MTP_messages_savedGifsNotModified());
 	                              })
diff --git a/Telegram/SourceFiles/auth_session.cpp b/Telegram/SourceFiles/auth_session.cpp
index b0b832c8b..80dfb93cc 100644
--- a/Telegram/SourceFiles/auth_session.cpp
+++ b/Telegram/SourceFiles/auth_session.cpp
@@ -177,7 +177,7 @@ AuthSession::AuthSession(UserId userId)
     , _uploader(std::make_unique<Storage::Uploader>())
     , _notifications(std::make_unique<Window::Notifications::System>(this)) {
 	Expects(_userId != 0);
-	_saveDataTimer.setCallback([this] { Local::writeUserSettings(); });
+	_saveDataTimer.setCallback([] { Local::writeUserSettings(); });
 	subscribe(Messenger::Instance().passcodedChanged(), [this] {
 		_shouldLockAt = 0;
 		notifications().updateAll();
diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp
index 2b80c12c9..c8733f61c 100644
--- a/Telegram/SourceFiles/boxes/confirm_box.cpp
+++ b/Telegram/SourceFiles/boxes/confirm_box.cpp
@@ -643,7 +643,7 @@ ConfirmInviteBox::ConfirmInviteBox(QWidget *, const QString &title, bool isChann
 }
 
 void ConfirmInviteBox::prepare() {
-	addButton(langFactory(lng_group_invite_join), [this] {
+	addButton(langFactory(lng_group_invite_join), [] {
 		if (auto main = App::main()) {
 			main->onInviteImport();
 		}
diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp
index 16d208ea5..bec87c2f6 100644
--- a/Telegram/SourceFiles/boxes/peer_list_box.cpp
+++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp
@@ -921,7 +921,6 @@ void PeerListBox::Inner::paintRow(Painter &p, TimeMs ms, RowIndex index) {
 	row->lazyInitialize();
 
 	auto peer = row->peer();
-	auto user = peer->asUser();
 	auto active = (_pressed.index.value >= 0) ? _pressed : _selected;
 	auto selected = (active.index == index);
 	auto actionSelected = (selected && active.action);
diff --git a/Telegram/SourceFiles/history/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/history_admin_log_inner.cpp
index 5bcc444cf..7ca033c47 100644
--- a/Telegram/SourceFiles/history/history_admin_log_inner.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_inner.cpp
@@ -1431,12 +1431,12 @@ void InnerWidget::updateSelected() {
 			}
 		}
 	}
-
-	// if (_mouseAction == MouseAction::Selecting) {
-	//	_widget->checkSelectingScroll(mousePos);
-	//} else {
-	//	_widget->noSelectingScroll();
-	//} // TODO
+	/*
+	    if (_mouseAction == MouseAction::Selecting) {
+	        _widget->checkSelectingScroll(mousePos);
+	    } else {
+	        _widget->noSelectingScroll();
+	    } */ // TODO
 
 	if (_mouseAction == MouseAction::None && (lnkChanged || cursor != _cursor)) {
 		setCursor(_cursor = cursor);
@@ -1445,93 +1445,92 @@ void InnerWidget::updateSelected() {
 
 void InnerWidget::performDrag() {
 	if (_mouseAction != MouseAction::Dragging) return;
+	/*
+	    auto uponSelected = false;
+	    if (_mouseActionItem) {
+	        if (!_selected.isEmpty() && _selected.cbegin().value() == FullSelection) {
+	            uponSelected = _selected.contains(_mouseActionItem);
+	        } else {
+	            HistoryStateRequest request;
+	            request.flags |= Text::StateRequest::Flag::LookupSymbol;
+	            auto dragState = _mouseActionItem->getState(_dragStartPosition.x(), _dragStartPosition.y(), request);
+	            uponSelected = (dragState.cursor == HistoryInTextCursorState);
+	            if (uponSelected) {
+	                if (_selected.isEmpty() || _selected.cbegin().value() == FullSelection ||
+	                    _selected.cbegin().key() != _mouseActionItem) {
+	                    uponSelected = false;
+	                } else {
+	                    quint16 selFrom = _selected.cbegin().value().from, selTo = _selected.cbegin().value().to;
+	                    if (dragState.symbol < selFrom || dragState.symbol >= selTo) {
+	                        uponSelected = false;
+	                    }
+	                }
+	            }
+	        }
+	    }
+	    auto pressedHandler = ClickHandler::getPressed();
 
-	auto uponSelected = false;
-	// if (_mouseActionItem) {
-	//	if (!_selected.isEmpty() && _selected.cbegin().value() == FullSelection) {
-	//		uponSelected = _selected.contains(_mouseActionItem);
-	//	} else {
-	//		HistoryStateRequest request;
-	//		request.flags |= Text::StateRequest::Flag::LookupSymbol;
-	//		auto dragState = _mouseActionItem->getState(_dragStartPosition.x(), _dragStartPosition.y(), request);
-	//		uponSelected = (dragState.cursor == HistoryInTextCursorState);
-	//		if (uponSelected) {
-	//			if (_selected.isEmpty() ||
-	//				_selected.cbegin().value() == FullSelection ||
-	//				_selected.cbegin().key() != _mouseActionItem
-	//				) {
-	//				uponSelected = false;
-	//			} else {
-	//				quint16 selFrom = _selected.cbegin().value().from, selTo = _selected.cbegin().value().to;
-	//				if (dragState.symbol < selFrom || dragState.symbol >= selTo) {
-	//					uponSelected = false;
-	//				}
-	//			}
-	//		}
-	//	}
-	//}
-	// auto pressedHandler = ClickHandler::getPressed();
+	    if (dynamic_cast<VoiceSeekClickHandler *>(pressedHandler.data())) {
+	        return;
+	    }
 
-	// if (dynamic_cast<VoiceSeekClickHandler*>(pressedHandler.data())) {
-	//	return;
-	//}
+	    TextWithEntities sel;
+	    QList<QUrl> urls;
+	    if (uponSelected) {
+	        sel = getSelectedText();
+	    } else if (pressedHandler) {
+	        sel = {pressedHandler->dragText(), EntitiesInText()};
+	        // if (!sel.isEmpty() && sel.at(0) != '/' && sel.at(0) != '@' && sel.at(0) != '#') {
+	        //	urls.push_back(QUrl::fromEncoded(sel.toUtf8())); // Google Chrome crashes in Mac OS X O_o
+	        //}
+	    }
+	    if (auto mimeData = mimeDataFromTextWithEntities(sel)) {
+	        updateDragSelection(0, 0, false);
+	        _widget->noSelectingScroll();
 
-	// TextWithEntities sel;
-	// QList<QUrl> urls;
-	// if (uponSelected) {
-	//	sel = getSelectedText();
-	//} else if (pressedHandler) {
-	//	sel = { pressedHandler->dragText(), EntitiesInText() };
-	//	//if (!sel.isEmpty() && sel.at(0) != '/' && sel.at(0) != '@' && sel.at(0) != '#') {
-	//	//	urls.push_back(QUrl::fromEncoded(sel.toUtf8())); // Google Chrome crashes in Mac OS X O_o
-	//	//}
-	//}
-	// if (auto mimeData = mimeDataFromTextWithEntities(sel)) {
-	//	updateDragSelection(0, 0, false);
-	//	_widget->noSelectingScroll();
+	        if (!urls.isEmpty()) mimeData->setUrls(urls);
+	        if (uponSelected && !Adaptive::OneColumn()) {
+	            auto selectedState = getSelectionState();
+	            if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
+	                mimeData->setData(qsl("application/x-td-forward-selected"), "1");
+	            }
+	        }
+	        _controller->window()->launchDrag(std::move(mimeData));
+	        return;
+	    } else {
+	        auto forwardMimeType = QString();
+	        auto pressedMedia = static_cast<HistoryMedia *>(nullptr);
+	        if (auto pressedItem = App::pressedItem()) {
+	            pressedMedia = pressedItem->getMedia();
+	            if (_mouseCursorState == HistoryInDateCursorState || (pressedMedia && pressedMedia->dragItem())) {
+	                forwardMimeType = qsl("application/x-td-forward-pressed");
+	            }
+	        }
+	        if (auto pressedLnkItem = App::pressedLinkItem()) {
+	            if ((pressedMedia = pressedLnkItem->getMedia())) {
+	                if (forwardMimeType.isEmpty() && pressedMedia->dragItemByHandler(pressedHandler)) {
+	                    forwardMimeType = qsl("application/x-td-forward-pressed-link");
+	                }
+	            }
+	        }
+	        if (!forwardMimeType.isEmpty()) {
+	            auto mimeData = std::make_unique<QMimeData>();
+	            mimeData->setData(forwardMimeType, "1");
+	            if (auto document = (pressedMedia ? pressedMedia->getDocument() : nullptr)) {
+	                auto filepath = document->filepath(DocumentData::FilePathResolveChecked);
+	                if (!filepath.isEmpty()) {
+	                    QList<QUrl> urls;
+	                    urls.push_back(QUrl::fromLocalFile(filepath));
+	                    mimeData->setUrls(urls);
+	                }
+	            }
 
-	//	if (!urls.isEmpty()) mimeData->setUrls(urls);
-	//	if (uponSelected && !Adaptive::OneColumn()) {
-	//		auto selectedState = getSelectionState();
-	//		if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
-	//			mimeData->setData(qsl("application/x-td-forward-selected"), "1");
-	//		}
-	//	}
-	//	_controller->window()->launchDrag(std::move(mimeData));
-	//	return;
-	//} else {
-	//	auto forwardMimeType = QString();
-	//	auto pressedMedia = static_cast<HistoryMedia*>(nullptr);
-	//	if (auto pressedItem = App::pressedItem()) {
-	//		pressedMedia = pressedItem->getMedia();
-	//		if (_mouseCursorState == HistoryInDateCursorState || (pressedMedia && pressedMedia->dragItem())) {
-	//			forwardMimeType = qsl("application/x-td-forward-pressed");
-	//		}
-	//	}
-	//	if (auto pressedLnkItem = App::pressedLinkItem()) {
-	//		if ((pressedMedia = pressedLnkItem->getMedia())) {
-	//			if (forwardMimeType.isEmpty() && pressedMedia->dragItemByHandler(pressedHandler)) {
-	//				forwardMimeType = qsl("application/x-td-forward-pressed-link");
-	//			}
-	//		}
-	//	}
-	//	if (!forwardMimeType.isEmpty()) {
-	//		auto mimeData = std::make_unique<QMimeData>();
-	//		mimeData->setData(forwardMimeType, "1");
-	//		if (auto document = (pressedMedia ? pressedMedia->getDocument() : nullptr)) {
-	//			auto filepath = document->filepath(DocumentData::FilePathResolveChecked);
-	//			if (!filepath.isEmpty()) {
-	//				QList<QUrl> urls;
-	//				urls.push_back(QUrl::fromLocalFile(filepath));
-	//				mimeData->setUrls(urls);
-	//			}
-	//		}
-
-	//		// This call enters event loop and can destroy any QObject.
-	//		_controller->window()->launchDrag(std::move(mimeData));
-	//		return;
-	//	}
-	//} // TODO
+	            // This call enters event loop and can destroy any QObject.
+	            _controller->window()->launchDrag(std::move(mimeData));
+	            return;
+	        }
+	    }*/
+	// TODO
 }
 
 int InnerWidget::itemTop(not_null<const HistoryItem *> item) const {
diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp
index 791f43404..daf956faf 100644
--- a/Telegram/SourceFiles/history/history_inner_widget.cpp
+++ b/Telegram/SourceFiles/history/history_inner_widget.cpp
@@ -1488,7 +1488,7 @@ void HistoryInner::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");
 		                         }
diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp
index 0d933767e..403b725b4 100644
--- a/Telegram/SourceFiles/history/history_media_types.cpp
+++ b/Telegram/SourceFiles/history/history_media_types.cpp
@@ -1013,8 +1013,7 @@ void HistoryVideo::eraseFromOverview() {
 }
 
 void HistoryVideo::updateStatusText() const {
-	bool showPause = false;
-	qint32 statusSize = 0, realDuration = 0;
+	qint32 statusSize = 0;
 	if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) {
 		statusSize = FileStatusSizeFailed;
 	} else if (_data->status == FileUploading) {
@@ -1543,12 +1542,12 @@ 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(), outbg = out && !isPost;
+	bool out = _parent->out(), isPost = _parent->isPost();
 	bool loaded = _data->loaded();
 
 	bool showPause = updateStatusText();
 
-	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0, bottom = 0;
+	qint32 nameleft = 0, nametop = 0, nameright = 0, linktop = 0, bottom = 0;
 	auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
 	if (auto thumbed = Get<HistoryDocumentThumbed>()) {
 		nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right();
@@ -2603,8 +2602,7 @@ void HistoryGif::setStatusSize(qint32 newSize) const {
 }
 
 void HistoryGif::updateStatusText() const {
-	bool showPause = false;
-	qint32 statusSize = 0, realDuration = 0;
+	qint32 statusSize = 0;
 	if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) {
 		statusSize = FileStatusSizeFailed;
 	} else if (_data->status == FileUploading) {
@@ -3140,7 +3138,7 @@ void HistoryContact::initDimensions() {
 
 void HistoryContact::draw(Painter &p, const QRect &r, TextSelection selection, TimeMs ms) const {
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return;
-	qint32 skipx = 0, skipy = 0, width = _width, height = _height;
+	qint32 width = _width;
 
 	bool out = _parent->out(), isPost = _parent->isPost(), outbg = out && !isPost;
 	bool selected = (selection == FullSelection);
@@ -3202,9 +3200,9 @@ 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(), outbg = out && !isPost;
+	bool out = _parent->out(), isPost = _parent->isPost();
 
-	qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0;
+	qint32 nameleft = 0, linktop = 0;
 	auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
 	if (_userId) {
 		nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right();
@@ -3311,7 +3309,7 @@ void HistoryCall::initDimensions() {
 
 void HistoryCall::draw(Painter &p, const QRect &r, TextSelection selection, TimeMs ms) const {
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return;
-	auto skipx = 0, skipy = 0, width = _width, height = _height;
+	auto width = _width;
 
 	auto out = _parent->out(), isPost = _parent->isPost(), outbg = out && !isPost;
 	auto selected = (selection == FullSelection);
@@ -3328,7 +3326,6 @@ void HistoryCall::draw(Painter &p, const QRect &r, TextSelection selection, Time
 	nameright = st::msgFilePadding.left();
 	statustop = st::historyCallStatusTop - topMinus;
 
-	auto namewidth = width - nameleft - nameright;
 
 	p.setFont(st::semiboldFont);
 	p.setPen(outbg ? (selected ? st::historyFileNameOutFgSelected : st::historyFileNameOutFg) :
@@ -3674,7 +3671,7 @@ int HistoryWebPage::resizeGetHeight(int width) {
 
 void HistoryWebPage::draw(Painter &p, const QRect &r, TextSelection selection, TimeMs ms) const {
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return;
-	qint32 skipx = 0, skipy = 0, width = _width, height = _height;
+	qint32 width = _width;
 
 	bool out = _parent->out(), isPost = _parent->isPost(), outbg = out && !isPost;
 	bool selected = (selection == FullSelection);
@@ -3821,7 +3818,7 @@ HistoryTextState HistoryWebPage::getState(QPoint point, HistoryStateRequest requ
 	HistoryTextState result;
 
 	if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return result;
-	qint32 skipx = 0, skipy = 0, width = _width, height = _height;
+	qint32 width = _width;
 
 	QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
 	auto padding = inBubblePadding();
@@ -4678,7 +4675,7 @@ HistoryTextState HistoryInvoice::getState(QPoint point, HistoryStateRequest requ
 	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();
diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp
index 54be68c61..ee0842e17 100644
--- a/Telegram/SourceFiles/layerwidget.cpp
+++ b/Telegram/SourceFiles/layerwidget.cpp
@@ -931,9 +931,10 @@ QPixmap MediaPreviewWidget::currentImage() const {
 			if (_document->loaded()) {
 				if (!_gif && !_gif.isBad()) {
 					auto that = const_cast<MediaPreviewWidget *>(this);
-					that->_gif = Media::Clip::MakeReader(
-					    _document, FullMsgId(),
-					    [this, that](Media::Clip::Notification notification) { that->clipCallback(notification); });
+					that->_gif =
+					    Media::Clip::MakeReader(_document, FullMsgId(), [that](Media::Clip::Notification notification) {
+						    that->clipCallback(notification);
+					    });
 					if (_gif) _gif->setAutoplay();
 				}
 			}
diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp
index 364281084..97c336cc3 100644
--- a/Telegram/SourceFiles/mainwidget.cpp
+++ b/Telegram/SourceFiles/mainwidget.cpp
@@ -420,7 +420,7 @@ void MainWidget::updateFloatPlayerColumnCorner(QPoint center) {
 		auto right = rect.x() + rect.width() - (size.width() / 2);
 		auto top = rect.y() + (size.height() / 2);
 		auto bottom = rect.y() + rect.height() - (size.height() / 2);
-		auto checkCorner = [this, playerColumn, &min, &column, &corner](int distance, RectPart checked) {
+		auto checkCorner = [playerColumn, &min, &column, &corner](int distance, RectPart checked) {
 			if (min > distance) {
 				min = distance;
 				column = playerColumn;
@@ -952,28 +952,28 @@ void MainWidget::cancelUploadLayer() {
 
 void MainWidget::deletePhotoLayer(PhotoData *photo) {
 	if (!photo) return;
-	Ui::show(
-	    Box<ConfirmBox>(lang(lng_delete_photo_sure), lang(lng_box_delete), base::lambda_guarded(this, [this, photo] {
-		                    Ui::hideLayer();
+	Ui::show(Box<ConfirmBox>(lang(lng_delete_photo_sure), lang(lng_box_delete), base::lambda_guarded(this, [photo] {
+		                         Ui::hideLayer();
 
-		                    auto me = App::self();
-		                    if (!me) return;
+		                         auto me = App::self();
+		                         if (!me) return;
 
-		                    if (me->photoId == photo->id) {
-			                    Messenger::Instance().peerClearPhoto(me->id);
-		                    } else if (photo->peer && !photo->peer->isUser() && photo->peer->photoId == photo->id) {
-			                    Messenger::Instance().peerClearPhoto(photo->peer->id);
-		                    } else {
-			                    for (int i = 0, l = me->photos.size(); i != l; ++i) {
-				                    if (me->photos.at(i) == photo) {
-					                    me->photos.removeAt(i);
-					                    MTP::send(MTPphotos_DeletePhotos(MTP_vector<MTPInputPhoto>(
-					                        1, MTP_inputPhoto(MTP_long(photo->id), MTP_long(photo->access)))));
-					                    break;
-				                    }
-			                    }
-		                    }
-	                    })));
+		                         if (me->photoId == photo->id) {
+			                         Messenger::Instance().peerClearPhoto(me->id);
+		                         } else if (photo->peer && !photo->peer->isUser() &&
+		                                    photo->peer->photoId == photo->id) {
+			                         Messenger::Instance().peerClearPhoto(photo->peer->id);
+		                         } else {
+			                         for (int i = 0, l = me->photos.size(); i != l; ++i) {
+				                         if (me->photos.at(i) == photo) {
+					                         me->photos.removeAt(i);
+					                         MTP::send(MTPphotos_DeletePhotos(MTP_vector<MTPInputPhoto>(
+					                             1, MTP_inputPhoto(MTP_long(photo->id), MTP_long(photo->access)))));
+					                         break;
+				                         }
+			                         }
+		                         }
+	                         })));
 }
 
 void MainWidget::shareContactLayer(UserData *contact) {
@@ -1357,7 +1357,6 @@ void MainWidget::onCacheBackground() {
 		result.setDevicePixelRatio(cRetinaFactor());
 		{
 			QPainter p(&result);
-			auto bottom = _willCacheFor.height();
 			auto w = bg.width() / cRetinaFactor();
 			auto h = bg.height() / cRetinaFactor();
 			auto sx = 0;
@@ -1652,7 +1651,6 @@ void MainWidget::itemEdited(HistoryItem *item) {
 bool MainWidget::overviewFailed(PeerData *peer, const RPCError &error, mtpRequestId req) {
 	if (MTP::isDefaultHandledError(error)) return false;
 
-	MediaOverviewType type = OverviewCount;
 	for (qint32 i = 0; i < OverviewCount; ++i) {
 		OverviewsPreload::iterator j = _overviewPreload[i].find(peer);
 		if (j != _overviewPreload[i].end() && j.value() == req) {
@@ -1985,14 +1983,14 @@ void MainWidget::documentLoadFailed(FileLoader *loader, bool started) {
 	auto document = App::document(documentId);
 	if (started) {
 		auto failedFileName = loader->fileName();
-		Ui::show(Box<ConfirmBox>(lang(lng_download_finish_failed),
-		                         base::lambda_guarded(this, [this, document, failedFileName] {
-			                         Ui::hideLayer();
-			                         if (document) document->save(failedFileName);
-		                         })));
+		Ui::show(
+		    Box<ConfirmBox>(lang(lng_download_finish_failed), base::lambda_guarded(this, [document, failedFileName] {
+			                    Ui::hideLayer();
+			                    if (document) document->save(failedFileName);
+		                    })));
 	} else {
 		Ui::show(Box<ConfirmBox>(lang(lng_download_path_failed), lang(lng_download_path_settings),
-		                         base::lambda_guarded(this, [this] {
+		                         base::lambda_guarded(this, [] {
 			                         Global::SetDownloadPath(QString());
 			                         Global::SetDownloadPathBookmark(QByteArray());
 			                         Ui::show(Box<DownloadPathBox>());
diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp
index 67d43644d..ee11f1fcf 100644
--- a/Telegram/SourceFiles/mediaview.cpp
+++ b/Telegram/SourceFiles/mediaview.cpp
@@ -171,7 +171,7 @@ void MediaView::refreshLang() {
 }
 
 void MediaView::moveToScreen() {
-	auto widgetScreen = [this](auto &&widget) -> QScreen * {
+	auto widgetScreen = [](auto &&widget) -> QScreen * {
 		if (auto handle = widget ? widget->windowHandle() : nullptr) {
 			return handle->screen();
 		}
@@ -2127,7 +2127,7 @@ void MediaView::paintThemePreview(Painter &p, QRect clip) {
 		}
 	}
 
-	auto fillOverlay = [this, &p, clip](QRect fill) {
+	auto fillOverlay = [&p, clip](QRect fill) {
 		auto clipped = fill.intersected(clip);
 		if (!clipped.isEmpty()) {
 			p.setOpacity(st::themePreviewOverlayOpacity);
diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp
index 1e0dcd93b..b041c86b4 100644
--- a/Telegram/SourceFiles/mtproto/connection.cpp
+++ b/Telegram/SourceFiles/mtproto/connection.cpp
@@ -2151,7 +2151,7 @@ ConnectionPrivate::HandleResult ConnectionPrivate::handleOneReceived(const mtpPr
 mtpBuffer ConnectionPrivate::ungzip(const mtpPrime *from, const mtpPrime *end) const {
 	MTPstring packed;
 	packed.read(from, end); // read packed string as serialized mtp string type
-	quint32 packedLen = packed.v.size(), unpackedChunk = packedLen, unpackedLen = 0;
+	quint32 packedLen = packed.v.size(), unpackedChunk = packedLen;
 
 	mtpBuffer result; // * 4 because of mtpPrime type
 	result.resize(0);
diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp
index 8b9bad531..88509d4f3 100644
--- a/Telegram/SourceFiles/overview/overview_layout.cpp
+++ b/Telegram/SourceFiles/overview/overview_layout.cpp
@@ -488,7 +488,6 @@ void Video::getState(ClickHandlerPtr &link, HistoryCursorState &cursor, QPoint p
 }
 
 void Video::updateStatusText() {
-	bool showPause = false;
 	int statusSize = 0;
 	if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) {
 		statusSize = FileStatusSizeFailed;
diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp
index 26850e8de..64acf4034 100644
--- a/Telegram/SourceFiles/overviewwidget.cpp
+++ b/Telegram/SourceFiles/overviewwidget.cpp
@@ -1910,7 +1910,6 @@ void OverviewInner::repaintItem(const HistoryItem *msg) {
 int OverviewInner::countHeight() {
 	if (_type == OverviewPhotos || _type == OverviewVideos) {
 		auto count = _items.size();
-		auto migratedFullCount = _migrated ? _migrated->overviewCount(_type) : 0;
 		auto rows = (count / _photosInRow) + ((count % _photosInRow) ? 1 : 0);
 		return (_rowWidth + st::overviewPhotoSkip) * rows + st::overviewPhotoSkip;
 	}
diff --git a/Telegram/SourceFiles/profile/profile_block_channel_members.cpp b/Telegram/SourceFiles/profile/profile_block_channel_members.cpp
index 658e8ae8c..a3d21e8d3 100644
--- a/Telegram/SourceFiles/profile/profile_block_channel_members.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_channel_members.cpp
@@ -120,7 +120,7 @@ void ChannelMembersWidget::refreshVisibility() {
 int ChannelMembersWidget::resizeGetHeight(int newWidth) {
 	int newHeight = contentTop();
 
-	auto resizeButton = [this, &newHeight, newWidth](object_ptr<Ui::LeftOutlineButton> &button) {
+	auto resizeButton = [&newHeight, newWidth](object_ptr<Ui::LeftOutlineButton> &button) {
 		if (!button) {
 			return;
 		}
diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp
index dcc2789a6..47467d6d7 100644
--- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp
@@ -49,7 +49,7 @@ GroupMembersWidget::GroupMembersWidget(QWidget *parent, PeerData *peer, TitleVis
 	                                     [this](const Notify::PeerUpdate &update) { notifyPeerUpdated(update); }));
 
 	setRemovedCallback([this, peer](PeerData *selectedPeer) { removePeer(selectedPeer); });
-	setSelectedCallback([this](PeerData *selectedPeer) { Ui::showPeerProfile(selectedPeer); });
+	setSelectedCallback([](PeerData *selectedPeer) { Ui::showPeerProfile(selectedPeer); });
 	setUpdateItemCallback([this](Item *item) { updateItemStatusText(item); });
 	setPreloadMoreCallback([this] { preloadMore(); });
 
diff --git a/Telegram/SourceFiles/profile/profile_block_info.cpp b/Telegram/SourceFiles/profile/profile_block_info.cpp
index 509aa14a2..d8845930a 100644
--- a/Telegram/SourceFiles/profile/profile_block_info.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_info.cpp
@@ -79,7 +79,6 @@ int InfoWidget::resizeGetHeight(int newWidth) {
 	if (_about) {
 		int textWidth = _about->naturalWidth();
 		int availableWidth = newWidth - left - st::profileBlockMarginRight;
-		int maxWidth = st::msgMaxWidth;
 		accumulate_min(textWidth, availableWidth);
 		accumulate_min(textWidth, st::msgMaxWidth);
 		_about->resizeToWidth(textWidth + marginLeft + marginRight);
diff --git a/Telegram/SourceFiles/profile/profile_block_invite_link.cpp b/Telegram/SourceFiles/profile/profile_block_invite_link.cpp
index 09f7e6ea2..cfd59668e 100644
--- a/Telegram/SourceFiles/profile/profile_block_invite_link.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_invite_link.cpp
@@ -68,7 +68,6 @@ int InviteLinkWidget::resizeGetHeight(int newWidth) {
 	if (_link) {
 		int textWidth = _link->naturalWidth();
 		int availableWidth = newWidth - left - st::profileBlockMarginRight;
-		int maxWidth = st::msgMaxWidth;
 		accumulate_min(textWidth, availableWidth);
 		accumulate_min(textWidth, st::msgMaxWidth);
 		_link->resizeToWidth(textWidth + marginLeft + marginRight);
diff --git a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp
index 62c2adee7..8a89c54a7 100644
--- a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp
+++ b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp
@@ -63,7 +63,6 @@ void FixedBar::onBack() {
 int FixedBar::resizeGetHeight(int newWidth) {
 	auto newHeight = 0;
 
-	auto buttonLeft = newWidth;
 	_backButton->resizeToWidth(newWidth);
 	_backButton->moveToLeft(0, 0);
 	newHeight += _backButton->height();
@@ -263,7 +262,6 @@ void InnerWidget::keyPressEvent(QKeyEvent *e) {
 
 void InnerWidget::updateSelected(QPoint localPos) {
 	auto selected = -1;
-	auto selectedKick = false;
 
 	if (rtl()) localPos.setX(width() - localPos.x());
 	if (localPos.x() >= _contentLeft && localPos.x() < _contentLeft + _contentWidth && localPos.y() >= _contentTop) {
diff --git a/Telegram/SourceFiles/settings/settings_block_widget.cpp b/Telegram/SourceFiles/settings/settings_block_widget.cpp
index 67e294bac..25380c946 100644
--- a/Telegram/SourceFiles/settings/settings_block_widget.cpp
+++ b/Telegram/SourceFiles/settings/settings_block_widget.cpp
@@ -43,7 +43,6 @@ int BlockWidget::resizeGetHeight(int newWidth) {
 	int x = contentLeft(), result = contentTop();
 	int availw = newWidth - x;
 	for_const (auto &row, _rows) {
-		auto childMargins = row.child->getMargins();
 		row.child->moveToLeft(x + row.margin.left(), result + row.margin.top(), newWidth);
 		auto availRowWidth = availw - row.margin.left() - row.margin.right() - x;
 		auto natural = row.child->naturalWidth();
diff --git a/Telegram/SourceFiles/settings/settings_privacy_widget.cpp b/Telegram/SourceFiles/settings/settings_privacy_widget.cpp
index a65aa70e7..232c78c5b 100644
--- a/Telegram/SourceFiles/settings/settings_privacy_widget.cpp
+++ b/Telegram/SourceFiles/settings/settings_privacy_widget.cpp
@@ -221,7 +221,7 @@ void PrivacyWidget::autoLockUpdated() {
 void PrivacyWidget::onBlockedUsers() {
 	Ui::show(Box<PeerListBox>(std::make_unique<BlockedBoxController>(), [](not_null<PeerListBox *> box) {
 		box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
-		box->addLeftButton(langFactory(lng_blocked_list_add), [box] { BlockedBoxController::BlockNewUser(); });
+		box->addLeftButton(langFactory(lng_blocked_list_add), [] { BlockedBoxController::BlockNewUser(); });
 	}));
 }
 
diff --git a/Telegram/SourceFiles/ui/effects/panel_animation.cpp b/Telegram/SourceFiles/ui/effects/panel_animation.cpp
index cc4a42bf6..29284ce2a 100644
--- a/Telegram/SourceFiles/ui/effects/panel_animation.cpp
+++ b/Telegram/SourceFiles/ui/effects/panel_animation.cpp
@@ -421,7 +421,6 @@ void PanelAnimation::paintFrame(QPainter &p, int x, int y, int outerWidth, doubl
 			if (fadeTop != fadeBottom) {
 				auto painterFadeTop = fadeTop / cIntRetinaFactor();
 				auto painterFrameWidth = frameWidth / cIntRetinaFactor();
-				auto painterFrameHeight = frameHeight / cIntRetinaFactor();
 				p.drawPixmap(painterFrameLeft, painterFadeTop, painterFrameWidth, painterFadeBottom - painterFadeTop,
 				             _fadeMask, 0, fadeSkipLines, cIntRetinaFactor(), fadeBottom - fadeTop);
 			}
@@ -430,8 +429,6 @@ void PanelAnimation::paintFrame(QPainter &p, int x, int y, int outerWidth, doubl
 			}
 		}
 	}
-	auto frameInts = _frameInts + frameLeft + frameTop * _frameIntsPerLine;
-	auto frameIntsPerLineAdd = (_finalWidth - frameWidth) + _frameIntsPerLineAdded;
 
 	// Draw corners
 	paintCorner(_topLeft, frameLeft, frameTop);
diff --git a/Telegram/SourceFiles/ui/images.cpp b/Telegram/SourceFiles/ui/images.cpp
index eff8fd857..bb95950ad 100644
--- a/Telegram/SourceFiles/ui/images.cpp
+++ b/Telegram/SourceFiles/ui/images.cpp
@@ -230,8 +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 = [imageWidth, imageHeight, imageIntsPerPixel, imageIntsPerLine](quint32 *imageInts,
-	                                                                                 const QImage &mask) {
+	auto maskCorner = [imageIntsPerPixel, 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/special_buttons.cpp b/Telegram/SourceFiles/ui/special_buttons.cpp
index 8bb669eb2..7d37453e1 100644
--- a/Telegram/SourceFiles/ui/special_buttons.cpp
+++ b/Telegram/SourceFiles/ui/special_buttons.cpp
@@ -237,7 +237,7 @@ void SendButton::paintEvent(QPaintEvent *e) {
 		paintRipple(p, (width() - st::historyAttachEmoji.rippleAreaSize) / 2,
 		            st::historyAttachEmoji.rippleAreaPosition.y(), ms, &rippleColor);
 
-		auto fastIcon = [recordActive, over, this] {
+		auto fastIcon = [recordActive, over] {
 			if (recordActive == 1.) {
 				return &st::historyRecordVoiceActive;
 			} else if (over) {
diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp
index bb367d144..0957fad9a 100644
--- a/Telegram/SourceFiles/ui/text/text.cpp
+++ b/Telegram/SourceFiles/ui/text/text.cpp
@@ -2500,7 +2500,7 @@ void Text::recountNaturalSize(bool initial, Qt::LayoutDirection optionsDir) {
 
 	_maxWidth = _minHeight = 0;
 	qint32 lineHeight = 0;
-	qint32 result = 0, lastNewlineStart = 0;
+	qint32 lastNewlineStart = 0;
 	QFixed _width = 0, last_rBearing = 0, last_rPadding = 0;
 	for (auto i = _blocks.cbegin(), e = _blocks.cend(); i != e; ++i) {
 		auto b = i->get();
diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp
index b25bd45a9..bbc82e9ce 100644
--- a/Telegram/SourceFiles/window/notifications_manager.cpp
+++ b/Telegram/SourceFiles/window/notifications_manager.cpp
@@ -304,7 +304,7 @@ void System::showNext() {
 				    notifyItem->Has<HistoryMessageForwarded>() ? notifyItem : nullptr; // forwarded notify grouping
 				auto forwardedCount = 1;
 
-				auto ms = getms(true);
+				auto ms = getms(true); // TODO(Randl): should it be asignment and not declaration?
 				auto history = notifyItem->history();
 				auto j = _whenMaps.find(history);
 				if (j == _whenMaps.cend()) {
diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp
index 9a851949a..a5e7fa693 100644
--- a/Telegram/SourceFiles/window/notifications_manager_default.cpp
+++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp
@@ -226,7 +226,6 @@ void Manager::moveWidgets() {
 	}
 
 	if (count > 1 || !_queuedNotifications.empty()) {
-		auto deltaY = st::notifyHideAllHeight + st::notifyDeltaY;
 		if (!_hideAll) {
 			_hideAll = std::make_unique<HideAllButton>(this, notificationStartPosition(), lastShiftCurrent,
 			                                           notificationShiftDirection());
@@ -596,7 +595,6 @@ void Notification::paintEvent(QPaintEvent *e) {
 	p.setClipRect(e->rect());
 	p.drawPixmap(0, 0, _cache);
 
-	auto buttonsLeft = st::notifyPhotoPos.x() + st::notifyPhotoSize + st::notifyTextLeft;
 	auto buttonsTop = st::notifyTextTop + st::msgNameFont->height;
 	if (a_actionsOpacity.animating(getms())) {
 		p.setOpacity(a_actionsOpacity.current());
diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp
index 6a4139a1a..151ebb0a7 100644
--- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp
+++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp
@@ -149,7 +149,7 @@ void EditorBlock::Row::fillValueString() {
 			_valueString.append('a' + (code - 10));
 		}
 	};
-	auto addCode = [this, addHex](int code) {
+	auto addCode = [addHex](int code) {
 		addHex(code / 16);
 		addHex(code % 16);
 	};
@@ -468,7 +468,7 @@ template <typename Callback> void EditorBlock::enumerateRowsFrom(int top, Callba
 int EditorBlock::resizeGetHeight(int newWidth) {
 	auto result = 0;
 	auto descriptionWidth = newWidth - st::themeEditorMargin.left() - st::themeEditorMargin.right();
-	enumerateRows([this, &result, descriptionWidth](Row &row) {
+	enumerateRows([&result, descriptionWidth](Row &row) {
 		row.setTop(result);
 
 		auto height = row.height();
diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp
index af90c2543..0f156b464 100644
--- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp
+++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp
@@ -827,13 +827,10 @@ void Generator::paintBubble(const Bubble &bubble) {
 		auto icon = ([&bubble] { return &(bubble.outbg ? st::historyFileOutPlay : st::historyFileInPlay); })();
 		(*icon)[_palette].paintInCenter(*_p, inner);
 
-		auto namewidth = x + bubble.width - nameleft - nameright;
-
 		// rescale waveform by going in waveform.size * bar_count 1D grid
 		auto active = bubble.outbg ? st::msgWaveformOutActive[_palette] : st::msgWaveformInActive[_palette];
 		auto inactive = bubble.outbg ? st::msgWaveformOutInactive[_palette] : st::msgWaveformInInactive[_palette];
 		qint32 wf_size = bubble.waveform.size();
-		qint32 bar_count = wf_size;
 		qint32 max_delta = st::msgWaveformMax - st::msgWaveformMin;
 		auto wave_bottom = y + st::msgFilePadding.top() + st::msgWaveformMax;
 		_p->setPen(Qt::NoPen);
diff --git a/Telegram/SourceFiles/window/window_controller.cpp b/Telegram/SourceFiles/window/window_controller.cpp
index 92a6e6174..9b59fe157 100644
--- a/Telegram/SourceFiles/window/window_controller.cpp
+++ b/Telegram/SourceFiles/window/window_controller.cpp
@@ -69,23 +69,15 @@ Controller::ColumnLayout Controller::computeColumnLayout() const {
 	accumulate_max(chatWidth, st::windowMinWidth);
 	dialogsWidth = bodyWidth - chatWidth;
 
-	auto useOneColumnLayout = [this, bodyWidth, dialogsWidth] {
+	auto useOneColumnLayout = [bodyWidth, dialogsWidth] {
 		auto someSectionShown = !App::main()->selectingPeer() && App::main()->isSectionShown();
-		if (dialogsWidth < st::dialogsPadding.x() && (Adaptive::OneColumn() || someSectionShown)) {
-			return true;
-		}
-		if (bodyWidth < st::windowMinWidth + st::dialogsWidthMin) {
-			return true;
-		}
-		return false;
+		return (dialogsWidth < st::dialogsPadding.x() && (Adaptive::OneColumn() || someSectionShown)) ||
+		       (bodyWidth < st::windowMinWidth + st::dialogsWidthMin);
 	};
 
-	auto useSmallColumnLayout = [this, dialogsWidth] {
+	auto useSmallColumnLayout = [dialogsWidth] {
 		// Used if useOneColumnLayout() == false.
-		if (dialogsWidth < st::dialogsWidthMin / 2) {
-			return true;
-		}
-		return false;
+		return dialogsWidth < st::dialogsWidthMin / 2;
 	};
 
 	if (useOneColumnLayout()) {
@@ -177,8 +169,7 @@ void Controller::showJumpToDate(not_null<PeerData *> peer, QDate requestedDate)
 	};
 	auto highlighted = requestedDate.isNull() ? currentPeerDate() : requestedDate;
 	auto month = highlighted;
-	auto box =
-	    Box<CalendarBox>(month, highlighted, [this, peer](const QDate &date) { Auth().api().jumpToDate(peer, date); });
+	auto box = Box<CalendarBox>(month, highlighted, [peer](const QDate &date) { Auth().api().jumpToDate(peer, date); });
 	box->setMinDate(minPeerDate());
 	box->setMaxDate(maxPeerDate());
 	Ui::show(std::move(box));
diff --git a/Telegram/SourceFiles/window/window_slide_animation.cpp b/Telegram/SourceFiles/window/window_slide_animation.cpp
index 19f251400..56ebcce07 100644
--- a/Telegram/SourceFiles/window/window_slide_animation.cpp
+++ b/Telegram/SourceFiles/window/window_slide_animation.cpp
@@ -72,7 +72,6 @@ void SlideAnimation::setFinishedCallback(FinishedCallback &&callback) {
 }
 
 void SlideAnimation::start() {
-	auto delta = st::slideShift;
 	auto fromLeft = (_direction == SlideDirection::FromLeft);
 	if (fromLeft) std::swap(_cacheUnder, _cacheOver);
 	_animation.start([this] { animationCallback(); }, fromLeft ? 1. : 0., fromLeft ? 0. : 1., st::slideDuration,