Browse Source

Better attributes for autoreleasing NSError *

August Mueller 10 years ago
parent
commit
eefbe993e7

+ 1 - 1
src/extra/fts3/FMTokenizers.h

@@ -34,7 +34,7 @@
 /**
 /**
  Load a stop-word tokenizer using a file containing words delimited by newlines. The file should be encoded in UTF-8.
  Load a stop-word tokenizer using a file containing words delimited by newlines. The file should be encoded in UTF-8.
  */
  */
-+ (instancetype)tokenizerWithFileURL:(NSURL *)wordFileURL baseTokenizer:(id<FMTokenizerDelegate>)tokenizer error:(NSError **)error;
++ (instancetype)tokenizerWithFileURL:(NSURL *)wordFileURL baseTokenizer:(id<FMTokenizerDelegate>)tokenizer error:(NSError* __autoreleasing*)error;
 
 
 /**
 /**
  Initialize an instance of the tokenizer using the set of words. The words should be lowercase if you're using the 
  Initialize an instance of the tokenizer using the set of words. The words should be lowercase if you're using the 

+ 5 - 5
src/fmdb/FMDatabase.h

@@ -269,7 +269,7 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary
  @see [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html)
  @see [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html)
  */
  */
 
 
-- (BOOL)executeUpdate:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ...;
+- (BOOL)executeUpdate:(NSString*)sql withErrorAndBindings:(NSError* __autoreleasing*)outErr, ...;
 
 
 /** Execute single update statement
 /** Execute single update statement
  
  
@@ -278,7 +278,7 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary
  @warning **Deprecated**: Please use `<executeUpdate:withErrorAndBindings>` instead.
  @warning **Deprecated**: Please use `<executeUpdate:withErrorAndBindings>` instead.
  */
  */
 
 
-- (BOOL)update:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ... __attribute__ ((deprecated));
+- (BOOL)update:(NSString*)sql withErrorAndBindings:(NSError* __autoreleasing*)outErr, ... __attribute__ ((deprecated));
 
 
 /** Execute single update statement
 /** Execute single update statement
 
 
@@ -809,7 +809,7 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary
  @see rollbackToSavePointWithName:error:
  @see rollbackToSavePointWithName:error:
  */
  */
 
 
-- (BOOL)startSavePointWithName:(NSString*)name error:(NSError**)outErr;
+- (BOOL)startSavePointWithName:(NSString*)name error:(NSError* __autoreleasing*)outErr;
 
 
 /** Release save point
 /** Release save point
 
 
@@ -824,7 +824,7 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary
  
  
  */
  */
 
 
-- (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError**)outErr;
+- (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError* __autoreleasing*)outErr;
 
 
 /** Roll back to save point
 /** Roll back to save point
 
 
@@ -838,7 +838,7 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary
  
  
  */
  */
 
 
-- (BOOL)rollbackToSavePointWithName:(NSString*)name error:(NSError**)outErr;
+- (BOOL)rollbackToSavePointWithName:(NSString*)name error:(NSError* __autoreleasing*)outErr;
 
 
 /** Start save point
 /** Start save point
 
 

+ 7 - 7
src/fmdb/FMDatabase.m

@@ -5,7 +5,7 @@
 @interface FMDatabase ()
 @interface FMDatabase ()
 
 
 - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args;
 - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args;
-- (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args;
+- (BOOL)executeUpdate:(NSString*)sql error:(NSError* __autoreleasing*)outErr withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args;
 
 
 @end
 @end
 
 
@@ -907,7 +907,7 @@ - (FMResultSet *)executeQuery:(NSString*)sql withVAList:(va_list)args {
 
 
 #pragma mark Execute updates
 #pragma mark Execute updates
 
 
-- (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args {
+- (BOOL)executeUpdate:(NSString*)sql error:(NSError* __autoreleasing*)outErr withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args {
     
     
     if (![self databaseExists]) {
     if (![self databaseExists]) {
         return NO;
         return NO;
@@ -1175,7 +1175,7 @@ - (BOOL)executeStatements:(NSString *)sql withResultBlock:(FMDBExecuteStatements
     return (rc == SQLITE_OK);
     return (rc == SQLITE_OK);
 }
 }
 
 
-- (BOOL)executeUpdate:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ... {
+- (BOOL)executeUpdate:(NSString*)sql withErrorAndBindings:(NSError* __autoreleasing*)outErr, ... {
     
     
     va_list args;
     va_list args;
     va_start(args, outErr);
     va_start(args, outErr);
@@ -1189,7 +1189,7 @@ - (BOOL)executeUpdate:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ...
 
 
 #pragma clang diagnostic push
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-implementations"
 #pragma clang diagnostic ignored "-Wdeprecated-implementations"
-- (BOOL)update:(NSString*)sql withErrorAndBindings:(NSError**)outErr, ... {
+- (BOOL)update:(NSString*)sql withErrorAndBindings:(NSError* __autoreleasing*)outErr, ... {
     va_list args;
     va_list args;
     va_start(args, outErr);
     va_start(args, outErr);
     
     
@@ -1253,7 +1253,7 @@ - (BOOL)inTransaction {
     return [savepointName stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
     return [savepointName stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
 }
 }
 
 
-- (BOOL)startSavePointWithName:(NSString*)name error:(NSError**)outErr {
+- (BOOL)startSavePointWithName:(NSString*)name error:(NSError* __autoreleasing*)outErr {
     
     
     NSParameterAssert(name);
     NSParameterAssert(name);
     
     
@@ -1271,7 +1271,7 @@ - (BOOL)startSavePointWithName:(NSString*)name error:(NSError**)outErr {
     return YES;
     return YES;
 }
 }
 
 
-- (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError**)outErr {
+- (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError* __autoreleasing*)outErr {
     
     
     NSParameterAssert(name);
     NSParameterAssert(name);
     
     
@@ -1285,7 +1285,7 @@ - (BOOL)releaseSavePointWithName:(NSString*)name error:(NSError**)outErr {
     return worked;
     return worked;
 }
 }
 
 
-- (BOOL)rollbackToSavePointWithName:(NSString*)name error:(NSError**)outErr {
+- (BOOL)rollbackToSavePointWithName:(NSString*)name error:(NSError* __autoreleasing*)outErr {
     
     
     NSParameterAssert(name);
     NSParameterAssert(name);
     
     

+ 1 - 1
src/fmdb/FMDatabaseAdditions.h

@@ -206,7 +206,7 @@
  
  
  */
  */
 
 
-- (BOOL)validateSQL:(NSString*)sql error:(NSError**)error;
+- (BOOL)validateSQL:(NSString*)sql error:(NSError* __autoreleasing*)error;
 
 
 
 
 #if SQLITE_VERSION_NUMBER >= 3007017
 #if SQLITE_VERSION_NUMBER >= 3007017

+ 1 - 1
src/fmdb/FMDatabaseAdditions.m

@@ -201,7 +201,7 @@ - (BOOL)columnExists:(NSString*)tableName columnName:(NSString*)columnName __att
 #pragma clang diagnostic pop
 #pragma clang diagnostic pop
 
 
 
 
-- (BOOL)validateSQL:(NSString*)sql error:(NSError**)error {
+- (BOOL)validateSQL:(NSString*)sql error:(NSError* __autoreleasing*)error {
     sqlite3_stmt *pStmt = NULL;
     sqlite3_stmt *pStmt = NULL;
     BOOL validationSucceeded = YES;
     BOOL validationSucceeded = YES;
     
     

+ 1 - 1
src/fmdb/FMResultSet.h

@@ -94,7 +94,7 @@
  @see hasAnotherRow
  @see hasAnotherRow
  */
  */
 
 
-- (BOOL)nextWithError:(NSError **)outErr;
+- (BOOL)nextWithError:(NSError* __autoreleasing*)outErr;
 
 
 /** Did the last call to `<next>` succeed in retrieving another row?
 /** Did the last call to `<next>` succeed in retrieving another row?
 
 

+ 1 - 1
src/fmdb/FMResultSet.m

@@ -150,7 +150,7 @@ - (BOOL)next {
     return [self nextWithError:nil];
     return [self nextWithError:nil];
 }
 }
 
 
-- (BOOL)nextWithError:(NSError **)outErr {
+- (BOOL)nextWithError:(NSError* __autoreleasing*)outErr {
     
     
     int rc = sqlite3_step([_statement statement]);
     int rc = sqlite3_step([_statement statement]);