Skip to content

Commit 8bbb85e

Browse files
authored
Fixed unused warnings building in release config (#10313)
1 parent 5d9f06a commit 8bbb85e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

FirebaseDatabase/Sources/third_party/SocketRocket/FSRWebSocket.m

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ - (void)didConnect
543543
_url.host, _url.port] : _url.host));
544544

545545
NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16];
546-
int result = SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);
546+
int __unused result =
547+
SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes);
547548
assert(result == 0);
548549
_secKey = [FSRUtilities base64EncodedStringFromData:keyBytes];
549550
assert([_secKey length] == 24);
@@ -688,7 +689,14 @@ - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
688689

689690
NSUInteger usedLength = 0;
690691

691-
BOOL success = [reason getBytes:(char *)mutablePayload.mutableBytes + sizeof(uint16_t) maxLength:payload.length - sizeof(uint16_t) usedLength:&usedLength encoding:NSUTF8StringEncoding options:NSStringEncodingConversionExternalRepresentation range:NSMakeRange(0, reason.length) remainingRange:&remainingRange];
692+
BOOL __unused success =
693+
[reason getBytes:(char *)mutablePayload.mutableBytes + sizeof(uint16_t)
694+
maxLength:payload.length - sizeof(uint16_t)
695+
usedLength:&usedLength
696+
encoding:NSUTF8StringEncoding
697+
options:NSStringEncodingConversionExternalRepresentation
698+
range:NSMakeRange(0, reason.length)
699+
remainingRange:&remainingRange];
692700

693701
assert(success);
694702
assert(remainingRange.length == 0);
@@ -1055,7 +1063,7 @@ - (void)_readFrameContinue;
10551063
[self _handleFrameHeader:header curData:self->_currentFrameData];
10561064
} else {
10571065
[self _addConsumerWithDataLength:extra_bytes_needed callback:^(FSRWebSocket *self, NSData *data) {
1058-
size_t mapped_size = data.length;
1066+
size_t __unused mapped_size = data.length;
10591067
const void *mapped_buffer = data.bytes;
10601068
size_t offset = 0;
10611069

@@ -1425,7 +1433,8 @@ - (void)_sendFrameWithOpcode:(FSROpCode)opcode data:(id)data;
14251433
}
14261434
} else {
14271435
uint8_t *mask_key = frame_buffer + frame_buffer_size;
1428-
int result = SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
1436+
int __unused result =
1437+
SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
14291438
assert(result == 0);
14301439
frame_buffer_size += sizeof(uint32_t);
14311440

0 commit comments

Comments
 (0)