diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp index d530e4779..eebbb1848 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp @@ -76,9 +76,9 @@ namespace { return rpl::single(ContentWithoutPreview(item, repaint)); } constexpr auto kFullLoaded = 2; - constexpr auto kSomeLoaded = 1; - constexpr auto kNotLoaded = 0; const auto loadedLevel = [=] { + constexpr auto kSomeLoaded = 1; + constexpr auto kNotLoaded = 0; const auto preview = media->replyPreview(); return media->replyPreviewLoaded() ? kFullLoaded diff --git a/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp b/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp index 05a03df4d..aa14b12c1 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_similar_channels.cpp @@ -167,7 +167,7 @@ void SimilarChannels::draw(Painter &p, const PaintContext &context) const { _hasHeavyPart = 1; validateLastPremiumLock(); const auto drawOne = [&](const Channel &channel) { - const auto geometry = channel.geometry.translated(-_scrollLeft, 0); + const auto geometry = channel.geometry.translated(-int(_scrollLeft), 0); const auto right = geometry.x() + geometry.width(); if (right <= 0) { return; @@ -501,7 +501,7 @@ TextState SimilarChannels::textState( return result; } for (const auto &channel : _channels) { - if (channel.geometry.translated(-_scrollLeft, 0).contains(point)) { + if (channel.geometry.translated(-int(_scrollLeft), 0).contains(point)) { result.link = channel.link; _lastPoint = point + QPoint(_scrollLeft, 0) diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index 7a3b133c4..a35cfd3c4 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -98,7 +98,6 @@ BOOL CALLBACK FindToActivate(HWND hwnd, LPARAM lParam) { return TRUE; } // Found a Top-Level window. - auto level = 0; if (WindowIdFromHWND(hwnd) == request->windowId) { request->result = hwnd; request->resultLevel = 3; @@ -310,8 +309,8 @@ void psDoFixPrevious() { if (oldKeyRes2 == ERROR_SUCCESS) RegCloseKey(oldKey2); if (existNew1 || existNew2) { - const auto deleteKeyRes1 = existOld1 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.c_str()) : ERROR_SUCCESS; - const auto deleteKeyRes2 = existOld2 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.c_str()) : ERROR_SUCCESS; + if (existOld1) RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.c_str()); + if (existOld2) RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.c_str()); } QString userDesktopLnk, commonDesktopLnk; @@ -326,7 +325,7 @@ void psDoFixPrevious() { } QFile userDesktopFile(userDesktopLnk), commonDesktopFile(commonDesktopLnk); if (QFile::exists(userDesktopLnk) && QFile::exists(commonDesktopLnk) && userDesktopLnk != commonDesktopLnk) { - bool removed = QFile::remove(commonDesktopLnk); + QFile::remove(commonDesktopLnk); } } catch (...) { } diff --git a/Telegram/SourceFiles/platform/win/tray_win.h b/Telegram/SourceFiles/platform/win/tray_win.h index cb79c3beb..aed4cc6e3 100644 --- a/Telegram/SourceFiles/platform/win/tray_win.h +++ b/Telegram/SourceFiles/platform/win/tray_win.h @@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/unique_qptr.h" namespace Window { -class CounterLayerArgs; +struct CounterLayerArgs; } // namespace Window namespace Ui { diff --git a/Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp b/Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp index 9baca321c..695f8f58a 100644 --- a/Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp +++ b/Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp @@ -553,7 +553,7 @@ bool ReadSetting( const auto proxy = readProxy(); if (proxy) { list.push_back(proxy); - } else if (index < -list.size()) { + } else if (index < -int64(list.size())) { ++index; } else if (index > list.size()) { --index; diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake index 886cd9935..fbae70966 100644 --- a/Telegram/cmake/lib_tgvoip.cmake +++ b/Telegram/cmake/lib_tgvoip.cmake @@ -134,20 +134,13 @@ PRIVATE ) if (WIN32) - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_compile_options(lib_tgvoip_bundled - PRIVATE - /wd4005 - /wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc) - /wd5055 # operator '>' deprecated between enumerations and floating-point types - ) - else() - target_compile_definitions(lib_tgvoip_bundled - PUBLIC - # Doesn't build with mingw for now - TGVOIP_NO_DSP - ) - endif() + target_compile_options_if_exists(lib_tgvoip_bundled + PRIVATE + /wd4005 # 'identifier' : macro redefinition + /wd4068 # unknown pragma + /wd4996 # deprecated + /wd5055 # operator '>' deprecated between enumerations and floating-point types + ) elseif (APPLE) target_compile_definitions(lib_tgvoip_bundled PUBLIC