aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-09-09 12:25:03 +0000
committerstuconnolly <stuart02@gmail.com>2012-09-09 12:25:03 +0000
commit5419378fa8c8eb7ae679dd1a34edcaeaf0a430ea (patch)
tree3446b4acdbb6388dce3baa3341cf916e78ff57e5
parentbc39e252aed0269716525a39c5f2e034f1d56c19 (diff)
downloadsequelpro-5419378fa8c8eb7ae679dd1a34edcaeaf0a430ea.tar.gz
sequelpro-5419378fa8c8eb7ae679dd1a34edcaeaf0a430ea.tar.bz2
sequelpro-5419378fa8c8eb7ae679dd1a34edcaeaf0a430ea.zip
Fix static analysis warnings.
-rw-r--r--Frameworks/PostgresKit/Source/FLXPostgresError.m9
-rw-r--r--Frameworks/PostgresKit/Source/FLXPostgresResult.m4
-rw-r--r--Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m2
3 files changed, 5 insertions, 10 deletions
diff --git a/Frameworks/PostgresKit/Source/FLXPostgresError.m b/Frameworks/PostgresKit/Source/FLXPostgresError.m
index 927100f8..31024a92 100644
--- a/Frameworks/PostgresKit/Source/FLXPostgresError.m
+++ b/Frameworks/PostgresKit/Source/FLXPostgresError.m
@@ -97,12 +97,7 @@
_errorPrimaryMessage = [self _extractErrorField:PG_DIAG_MESSAGE_PRIMARY fromResult:result];
_errorDetailMessage = [self _extractErrorField:PG_DIAG_MESSAGE_DETAIL fromResult:result];
_errorMessageHint = [self _extractErrorField:PG_DIAG_MESSAGE_HINT fromResult:result];
-
- NSString *statementPosition = [self _extractErrorField:PG_DIAG_STATEMENT_POSITION fromResult:result];
-
- _errorStatementPosition = [statementPosition integerValue];
-
- [statementPosition release];
+ _errorStatementPosition = [[self _extractErrorField:PG_DIAG_STATEMENT_POSITION fromResult:result] integerValue];
}
/**
@@ -115,7 +110,7 @@
*/
- (NSString *)_extractErrorField:(int)field fromResult:(const PGresult *)result
{
- return [[NSString alloc] initWithUTF8String:PQresultErrorField(result, field)];
+ return [[[NSString alloc] initWithUTF8String:PQresultErrorField(result, field)] autorelease];
}
#pragma mark -
diff --git a/Frameworks/PostgresKit/Source/FLXPostgresResult.m b/Frameworks/PostgresKit/Source/FLXPostgresResult.m
index 2da1a78f..0d9656d0 100644
--- a/Frameworks/PostgresKit/Source/FLXPostgresResult.m
+++ b/Frameworks/PostgresKit/Source/FLXPostgresResult.m
@@ -234,9 +234,9 @@ static NSString *FLXPostgresResultError = @"FLXPostgresResultError";
id handler = _typeHandlers[column];
if (!handler) {
- _typeHandlers[column] = [_connection typeHandlerForRemoteType:type];
+ handler = [_connection typeHandlerForRemoteType:type];
- handler = _typeHandlers[column];
+ _typeHandlers[column] = handler;
}
return handler;
diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m b/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m
index 26c0ba32..aa7adf2a 100644
--- a/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m
+++ b/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m
@@ -82,7 +82,7 @@ static FLXPostgresOid FLXPostgresTypeStringTypes[] =
return [self _macAddressFromResult:result atRow:row column:column];
case FLXPostgresOidInetAddr:
case FLXPostgresOidCidrAddr:
- return [self _inetAddressFromResult:result atRow:row column:column type:type];
+ return [self _inetAddressFromResult:result atRow:row column:column type:type];
case FLXPostgresOidText:
case FLXPostgresOidChar:
case FLXPostgresOidName: