From 9713abc002c83674877597dbd2f41d330ff91d08 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Oct 2024 13:18:10 +0400 Subject: [PATCH] Fix build with GCC. --- .../history/view/controls/history_view_voice_record_bar.cpp | 4 ---- Telegram/SourceFiles/ui/controls/round_video_recorder.cpp | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp index 9d64c9ed7c..de06fb53e5 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp @@ -138,10 +138,6 @@ void SoundedPreview::subscribeToUpdates(Fn callback) { return std::clamp(float64(low) / high, 0., 1.); } -[[nodiscard]] crl::time Duration(int samples) { - return samples * crl::time(1000) / ::Media::Player::kDefaultFrequency; -} - [[nodiscard]] auto FormatVoiceDuration(int samples) { const int duration = kPrecision * (float64(samples) / ::Media::Player::kDefaultFrequency); diff --git a/Telegram/SourceFiles/ui/controls/round_video_recorder.cpp b/Telegram/SourceFiles/ui/controls/round_video_recorder.cpp index 3993d089df..0009f62141 100644 --- a/Telegram/SourceFiles/ui/controls/round_video_recorder.cpp +++ b/Telegram/SourceFiles/ui/controls/round_video_recorder.cpp @@ -56,7 +56,7 @@ struct ReadBytesWrap { } return toRead; }; - static int64 Seek(void *opaque, int64_t offset, int whence) { + static int64_t Seek(void *opaque, int64_t offset, int whence) { auto wrap = static_cast(opaque); auto updated = int64(-1); switch (whence) { @@ -253,9 +253,9 @@ int RoundVideoRecorder::Private::write(uint8_t *buf, int buf_size) { int64_t RoundVideoRecorder::Private::seek(int64_t offset, int whence) { const auto checkedSeek = [&](int64_t offset) { if (offset < 0 || offset > int64(_result.size())) { - return int64(-1); + return int64_t(-1); } - return (_resultOffset = offset); + return int64_t(_resultOffset = offset); }; switch (whence) { case SEEK_SET: return checkedSeek(offset);