From 339fb7a1315dcb744ebb3e6b87f8711a4201861d Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Mon, 18 Sep 2023 23:08:41 +0200 Subject: [PATCH] suppress various warnings --- Source/NSSocketPort.m | 52 +++++++++++++++++++++++-------------------- Source/NSTask.m | 4 ++-- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m index ea6523d3a..6eedb276d 100644 --- a/Source/NSSocketPort.m +++ b/Source/NSSocketPort.m @@ -1266,18 +1266,20 @@ static Class runLoopClass; cLength = 0; #if defined(HAVE_GNUTLS) - NSDictionary *opts = [p clientOptionsForTLS]; - DESTROY(session); - if (opts) - { - session = [[GSTLSSession alloc] initWithOptions: opts - direction: YES // as client - transport: self - push: GSTLSHandlePush - pull: GSTLSHandlePull]; - NSDebugMLLog(@"GSTcpHandle", - @"%@ is connecting using %@", self, session); - } + { + NSDictionary *opts = [p clientOptionsForTLS]; + DESTROY(session); + if (opts) + { + session = [[GSTLSSession alloc] initWithOptions: opts + direction: YES // as client + transport: self + push: GSTLSHandlePush + pull: GSTLSHandlePull]; + NSDebugMLLog(@"GSTcpHandle", + @"%@ is connecting using %@", self, session); + } + } #endif } } @@ -2425,18 +2427,20 @@ static Class tcpPortClass; ASSIGN(handle->defaultAddress, GSPrivateSockaddrHost(&sockAddr)); [handle setState: GS_H_ACCEPT]; #if defined(HAVE_GNUTLS) - NSDictionary *o; - if ((o = [self serverOptionsForTLS]) != nil) - { - handle->session = [[GSTLSSession alloc] - initWithOptions: o - direction: NO // as server - transport: handle - push: GSTLSHandlePush - pull: GSTLSHandlePull]; - NSDebugMLLog(@"GSTcpHandle", - @"%@ is accepting using %@", handle, handle->session); - } + { + NSDictionary *o; + if ((o = [self serverOptionsForTLS]) != nil) + { + handle->session = [[GSTLSSession alloc] + initWithOptions: o + direction: NO // as server + transport: handle + push: GSTLSHandlePush + pull: GSTLSHandlePull]; + NSDebugMLLog(@"GSTcpHandle", + @"%@ is accepting using %@", handle, handle->session); + } + } #endif [self addHandle: handle forSend: NO]; } diff --git a/Source/NSTask.m b/Source/NSTask.m index a8c9a9149..ea8d8663d 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -420,7 +420,7 @@ pty_slave(const char* name) if (NO == [self launchAndReturnError: &e]) { [NSException raise: NSInvalidArgumentException - format: @"%@", e ? e : @"Unable to launch"]; + format: @"%@", e ? [e description] : @"Unable to launch"]; } } @@ -969,7 +969,7 @@ pty_slave(const char* name) coalesceMask: NSNotificationNoCoalescing forModes: nil]; - if (_handler != nil) + if (_handler != NULL) { CALL_BLOCK_NO_ARGS(_handler); }