Fix "arithmetic on a pointer to void" warning.

Error appears when rolling Chromium in WebRTC:
https://ci.chromium.org/ui/p/webrtc/builders/try/mac_rel/76983/overview

Change-Id: Ibe9b15680efb00cac2333639a12c71cb76f6e71b
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367781
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43370}
This commit is contained in:
Jeremy Leconte 2024-11-07 11:34:56 +01:00 committed by WebRTC LUCI CQ
parent 4405d06b97
commit 04d97b6c52

View File

@ -1080,9 +1080,16 @@ static const uint8_t SRPayloadLenMask = 0x7F;
NSUInteger dataLength = _outputBuffer.length;
if (dataLength - _outputBufferOffset > 0 && _outputStream.hasSpaceAvailable) {
NSInteger bytesWritten = [_outputStream write:_outputBuffer.bytes + _outputBufferOffset maxLength:dataLength - _outputBufferOffset];
NSInteger bytesWritten =
[_outputStream write:(const unsigned char *)_outputBuffer.bytes + _outputBufferOffset
maxLength:dataLength - _outputBufferOffset];
if (bytesWritten == -1) {
[self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2145 userInfo:[NSDictionary dictionaryWithObject:@"Error writing to stream" forKey:NSLocalizedDescriptionKey]]];
[self _failWithError:
[NSError errorWithDomain:SRWebSocketErrorDomain
code:2145
userInfo:[NSDictionary
dictionaryWithObject:@"Error writing to stream"
forKey:NSLocalizedDescriptionKey]]];
return;
}