diff --git a/submodules/MosaicLayout/Sources/ChatMessageBubbleMosaicLayout.swift b/submodules/MosaicLayout/Sources/ChatMessageBubbleMosaicLayout.swift index 134a758464..58c940fb9a 100644 --- a/submodules/MosaicLayout/Sources/ChatMessageBubbleMosaicLayout.swift +++ b/submodules/MosaicLayout/Sources/ChatMessageBubbleMosaicLayout.swift @@ -302,7 +302,7 @@ public func chatMessageBubbleMosaicLayout(maxSize: CGSize, itemSizes: [CGSize], innerPositionFlags.insert(.right) } - if positionFlags == .none { + if positionFlags == [] { innerPositionFlags = .inside } diff --git a/submodules/TelegramAnimatedStickerNode/Sources/AnimatedStickerUtils.swift b/submodules/TelegramAnimatedStickerNode/Sources/AnimatedStickerUtils.swift index dcfd793e92..5c52b35437 100644 --- a/submodules/TelegramAnimatedStickerNode/Sources/AnimatedStickerUtils.swift +++ b/submodules/TelegramAnimatedStickerNode/Sources/AnimatedStickerUtils.swift @@ -72,8 +72,8 @@ public func fetchCompressedLottieFirstFrameAJpeg(data: Data, size: CGSize, fitzM let alphaData = NSMutableData() if let colorDestination = CGImageDestinationCreateWithData(colorData as CFMutableData, kUTTypeJPEG, 1, nil), let alphaDestination = CGImageDestinationCreateWithData(alphaData as CFMutableData, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) - CGImageDestinationSetProperties(alphaDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) + CGImageDestinationSetProperties(alphaDestination, NSDictionary() as CFDictionary) let colorQuality: Float let alphaQuality: Float diff --git a/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift b/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift index 9af33d1ca0..f468a4bada 100644 --- a/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift +++ b/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift @@ -286,11 +286,11 @@ private extension CurrentImpl { case .mediaStream: let ssrcId = UInt32.random(in: 0 ..< UInt32(Int32.max - 1)) let dict: [String: Any] = [ - "fingerprints": [], + "fingerprints": [] as [Any], "ufrag": "", "pwd": "", "ssrc": Int32(bitPattern: ssrcId), - "ssrc-groups": [] + "ssrc-groups": [] as [Any] ] guard let jsonString = (try? JSONSerialization.data(withJSONObject: dict, options: [])).flatMap({ String(data: $0, encoding: .utf8) }) else { return .never() diff --git a/submodules/TelegramCore/Sources/State/PeerInputActivity.swift b/submodules/TelegramCore/Sources/State/PeerInputActivity.swift index 2f761b47a7..267fa01d44 100644 --- a/submodules/TelegramCore/Sources/State/PeerInputActivity.swift +++ b/submodules/TelegramCore/Sources/State/PeerInputActivity.swift @@ -52,7 +52,7 @@ public struct EmojiInteraction: Equatable { fileprivate let roundingBehavior = NSDecimalNumberHandler(roundingMode: .plain, scale: 2, raiseOnExactness: false, raiseOnOverflow: false, raiseOnUnderflow: false, raiseOnDivideByZero: true) public var apiDataJson: Api.DataJSON { - let dict = ["v": 1, "a": self.animations.map({ ["i": $0.index, "t": NSDecimalNumber(value: $0.timeOffset).rounding(accordingToBehavior: roundingBehavior)] })] as [String : Any] + let dict = ["v": 1, "a": self.animations.map({ ["i": $0.index, "t": NSDecimalNumber(value: $0.timeOffset).rounding(accordingToBehavior: roundingBehavior)] as [String : Any] })] as [String : Any] if let data = try? JSONSerialization.data(withJSONObject: dict, options: []), let dataString = String(data: data, encoding: .utf8) { return .dataJSON(data: dataString) } else { diff --git a/submodules/TelegramUI/Sources/FetchCachedRepresentations.swift b/submodules/TelegramUI/Sources/FetchCachedRepresentations.swift index be5e680b97..bea052c9e8 100644 --- a/submodules/TelegramUI/Sources/FetchCachedRepresentations.swift +++ b/submodules/TelegramUI/Sources/FetchCachedRepresentations.swift @@ -205,8 +205,8 @@ private func fetchCachedStickerAJpegRepresentation(account: Account, resource: M }, scale: 1.0) if let alphaImage = alphaImage, let colorDestination = CGImageDestinationCreateWithData(colorData as CFMutableData, kUTTypeJPEG, 1, nil), let alphaDestination = CGImageDestinationCreateWithData(alphaData as CFMutableData, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) - CGImageDestinationSetProperties(alphaDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) + CGImageDestinationSetProperties(alphaDestination, NSDictionary() as CFDictionary) let colorQuality: Float let alphaQuality: Float @@ -270,7 +270,7 @@ private func fetchCachedScaledImageRepresentation(resource: MediaResource, resou }, scale: 1.0)! if let colorDestination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) let colorQuality: Float = 0.5 @@ -330,7 +330,7 @@ private func fetchCachedVideoFirstFrameRepresentation(account: Account, resource let url = URL(fileURLWithPath: path) if let colorDestination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) let colorQuality: Float = 0.6 @@ -371,7 +371,7 @@ private func fetchCachedScaledVideoFirstFrameRepresentation(account: Account, re }, scale: 1.0)! if let colorDestination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) let colorQuality: Float = 0.5 @@ -399,7 +399,7 @@ private func fetchCachedBlurredWallpaperRepresentation(resource: MediaResource, let url = URL(fileURLWithPath: path) if let colorImage = blurredImage(image, radius: 20.0), let colorDestination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) let colorQuality: Float = 0.5 @@ -448,7 +448,7 @@ private func fetchCachedBlurredWallpaperRepresentation(account: Account, resourc let url = URL(fileURLWithPath: path) if let colorImage = blurredImage(image, radius: 20.0), let colorDestination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) let colorQuality: Float = 0.5 @@ -491,7 +491,7 @@ private func fetchCachedAlbumArtworkRepresentation(account: Account, resource: M })! if let colorDestination = CGImageDestinationCreateWithURL(url as CFURL, kUTTypeJPEG, 1, nil) { - CGImageDestinationSetProperties(colorDestination, [:] as CFDictionary) + CGImageDestinationSetProperties(colorDestination, NSDictionary() as CFDictionary) let colorQuality: Float = 0.5 diff --git a/submodules/TelegramUniversalVideoContent/Sources/YoutubeEmbedImplementation.swift b/submodules/TelegramUniversalVideoContent/Sources/YoutubeEmbedImplementation.swift index d58ba3931b..c972da599d 100644 --- a/submodules/TelegramUniversalVideoContent/Sources/YoutubeEmbedImplementation.swift +++ b/submodules/TelegramUniversalVideoContent/Sources/YoutubeEmbedImplementation.swift @@ -653,10 +653,10 @@ public final class YoutubeEmbedFramePreview: FramePreview { let frame: Int32 = globalFrame % framesOnStoryboard let num: Int32 = Int32(floor(Double(globalFrame) / Double(framesOnStoryboard))) - let url = storyboardUrl(spec: storyboardSpec, sizeIndex: bestSize.0, num: num) + let url = strongSelf.storyboardUrl(spec: storyboardSpec, sizeIndex: bestSize.0, num: num) strongSelf.framePipe.putNext(.waitingForData) - strongSelf.currentFrameDisposable.set(youtubeEmbedStoryboardImage(account: strongSelf.context.account, resource: YoutubeEmbedStoryboardMediaResource(videoId: youtubeImpl.videoId, storyboardId: num, url: url), frame: frame, size: bestSize.1).start(next: { [weak self] image in + strongSelf.currentFrameDisposable.set(youtubeEmbedStoryboardImage(account: strongSelf.context.account, resource: YoutubeEmbedStoryboardMediaResource(videoId: youtubeImpl.videoId, storyboardId: num, url: url), frame: frame, size: bestSize.1).start(next: { image in if let strongSelf = self { if let image = image { strongSelf.framePipe.putNext(.image(image)) diff --git a/submodules/WatchBridge/Sources/WatchRequestHandlers.swift b/submodules/WatchBridge/Sources/WatchRequestHandlers.swift index d53893b6ee..ad8cf26836 100644 --- a/submodules/WatchBridge/Sources/WatchRequestHandlers.swift +++ b/submodules/WatchBridge/Sources/WatchRequestHandlers.swift @@ -60,7 +60,7 @@ final class WatchChatListHandler: WatchRequestHandler { users = users.merging(chatUsers, uniquingKeysWith: { (_, last) in last }) } } - subscriber.putNext([ TGBridgeChatsArrayKey: chats, TGBridgeUsersDictionaryKey: users ]) + subscriber.putNext([ TGBridgeChatsArrayKey: chats, TGBridgeUsersDictionaryKey: users ] as [String: Any]) }) return SBlockDisposable { @@ -108,7 +108,7 @@ final class WatchChatMessagesHandler: WatchRequestHandler { users = users.merging(messageUsers, uniquingKeysWith: { (_, last) in last }) } } - subscriber.putNext([ TGBridgeMessagesArrayKey: messages, TGBridgeUsersDictionaryKey: users ]) + subscriber.putNext([ TGBridgeMessagesArrayKey: messages, TGBridgeUsersDictionaryKey: users ] as [String: Any]) }) return SBlockDisposable { @@ -295,7 +295,7 @@ final class WatchPeerInfoHandler: WatchRequestHandler { }) let disposable = signal.start(next: { view in let (chat, users) = makeBridgeChat(peerViewMainPeer(view), view: view) - subscriber.putNext([ TGBridgeChatKey: chat, TGBridgeUsersDictionaryKey: users ]) + subscriber.putNext([ TGBridgeChatKey: chat, TGBridgeUsersDictionaryKey: users ] as [String: Any]) }) return SBlockDisposable { diff --git a/third-party/boringssl/BUILD b/third-party/boringssl/BUILD index be357e69ca..d7972a8355 100644 --- a/third-party/boringssl/BUILD +++ b/third-party/boringssl/BUILD @@ -51,6 +51,7 @@ posix_copts = [ "-Wwrite-strings", "-Wshadow", "-fno-common", + "-Wno-unused-but-set-variable", # Modern build environments should be able to set this to use atomic # operations for reference counting rather than locks. However, it's