Skip to content

Commit d253652

Browse files
committed
Apply patch from Sean McBride for some compiler warnings and other trivialities. Resolves issue robbiehanson#97.
1 parent 2c0f2d1 commit d253652

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

GCD/GCDAsyncSocket.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ - (NSUInteger)readLengthForTermWithPreBuffer:(NSData *)preBuffer found:(BOOL *)f
592592
maxPreBufferLength = preBufferLength;
593593
}
594594

595-
Byte seq[termLength];
595+
uint8_t seq[termLength];
596596
const void *termBuf = [term bytes];
597597

598598
NSUInteger bufLen = MIN(bytesDone, (termLength - 1));
@@ -820,9 +820,9 @@ - (id)initWithDelegate:(id)aDelegate delegateQueue:(dispatch_queue_t)dq socketQu
820820
{
821821
NSString *assertMsg = @"The given socketQueue parameter must not be a concurrent queue.";
822822

823-
NSAssert(sq != dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), assertMsg);
824-
NSAssert(sq != dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), assertMsg);
825-
NSAssert(sq != dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), assertMsg);
823+
NSAssert(sq != dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), @"%@", assertMsg);
824+
NSAssert(sq != dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), @"%@", assertMsg);
825+
NSAssert(sq != dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), @"%@", assertMsg);
826826

827827
dispatch_retain(sq);
828828
socketQueue = sq;
@@ -1789,7 +1789,7 @@ - (BOOL)connectToHost:(NSString *)host
17891789
onPort:(UInt16)port
17901790
viaInterface:(NSString *)interface
17911791
withTimeout:(NSTimeInterval)timeout
1792-
error:(NSError **)errPtr;
1792+
error:(NSError **)errPtr
17931793
{
17941794
LogTrace();
17951795

@@ -3625,7 +3625,7 @@ - (void)readDataToData:(NSData *)data
36253625
maxLength:(NSUInteger)length
36263626
tag:(long)tag
36273627
{
3628-
if (data == nil || [data length] == 0) return;
3628+
if ([data length] == 0) return;
36293629
if (offset > [buffer length]) return;
36303630
if (length > 0 && length < [data length]) return;
36313631

@@ -4567,7 +4567,7 @@ - (void)doReadTimeoutWithExtension:(NSTimeInterval)timeoutExtension
45674567

45684568
- (void)writeData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag
45694569
{
4570-
if (data == nil || [data length] == 0) return;
4570+
if ([data length] == 0) return;
45714571

45724572
GCDAsyncWritePacket *packet = [[GCDAsyncWritePacket alloc] initWithData:data timeout:timeout tag:tag];
45734573

@@ -5421,7 +5421,7 @@ - (OSStatus)sslWriteWithBuffer:(const void *)buffer length:(size_t *)bufferLengt
54215421
return errSSLWouldBlock;
54225422
}
54235423

5424-
OSStatus SSLReadFunction(SSLConnectionRef connection, void *data, size_t *dataLength)
5424+
static OSStatus SSLReadFunction(SSLConnectionRef connection, void *data, size_t *dataLength)
54255425
{
54265426
GCDAsyncSocket *asyncSocket = (GCDAsyncSocket *)connection;
54275427

@@ -5430,7 +5430,7 @@ OSStatus SSLReadFunction(SSLConnectionRef connection, void *data, size_t *dataLe
54305430
return [asyncSocket sslReadWithBuffer:data length:dataLength];
54315431
}
54325432

5433-
OSStatus SSLWriteFunction(SSLConnectionRef connection, const void *data, size_t *dataLength)
5433+
static OSStatus SSLWriteFunction(SSLConnectionRef connection, const void *data, size_t *dataLength)
54345434
{
54355435
GCDAsyncSocket *asyncSocket = (GCDAsyncSocket *)connection;
54365436

0 commit comments

Comments
 (0)