Skip to content

Commit

Permalink
Version 5.7: Fix build with Xcode.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 31, 2024
1 parent a75d7f0 commit 8c3c8f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/core/core_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ void LogPosition(const WindowPosition &position, const QString &name) {
[[nodiscard]] quint32 SerializeVideoQuality(Media::VideoQuality quality) {
static_assert(sizeof(Media::VideoQuality) == sizeof(uint32));
auto result = uint32();
memcpy(&result, &quality, sizeof(quality));
const auto data = static_cast<const void*>(&quality);
memcpy(&result, data, sizeof(quality));
return result;
}

[[nodiscard]] Media::VideoQuality DeserializeVideoQuality(quint32 value) {
auto result = Media::VideoQuality();
memcpy(&result, &value, sizeof(result));
const auto data = static_cast<void*>(&result);
memcpy(data, &value, sizeof(result));
return (result.height <= 4320) ? result : Media::VideoQuality();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void InnerWidget::fill() {
);

auto creditsStateValue = bot
? rpl::single(Data::CreditsEarnStatistics())
? rpl::single(Data::CreditsEarnStatistics()) | rpl::type_erased()
: rpl::single(creditsData) | rpl::then(
_stateUpdated.events(
) | rpl::map([this] { return _state.creditsEarn; })
Expand Down
6 changes: 3 additions & 3 deletions Telegram/SourceFiles/iv/iv_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ItemZoom final

AbstractButton::setDisabled(true);

const auto processTooltip = [=, this](not_null<Ui::RpWidget*> w) {
const auto processTooltip = [=](not_null<Ui::RpWidget*> w) {
w->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
if (e->type() == QEvent::Enter) {
Ui::Tooltip::Show(1000, this);
Expand Down Expand Up @@ -171,7 +171,7 @@ class ItemZoom final
rpl::combine(
sizeValue(),
reset->sizeValue()
) | rpl::start_with_next([=, this](const QSize &size, const QSize &) {
) | rpl::start_with_next([=](const QSize &size, const QSize &) {
reset->setFullWidth(0
+ resetLabel->width()
+ st::ivResetZoomInnerPadding);
Expand Down Expand Up @@ -658,7 +658,7 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
_delegate->ivSetZoom(value);
}, lifetime());
_delegate->ivZoomValue(
) | rpl::start_with_next([=, this](int value) {
) | rpl::start_with_next([=](int value) {
webviewZoomController->setZoom(value);
}, lifetime());
}
Expand Down

0 comments on commit 8c3c8f8

Please sign in to comment.