ccgus 12 лет назад
Родитель
Сommit
75b5dddc87
4 измененных файлов с 28 добавлено и 28 удалено
  1. 1 1
      src/FMDatabase.h
  2. 22 22
      src/FMDatabase.m
  3. 1 1
      src/FMResultSet.m
  4. 4 4
      src/fmdb.m

+ 1 - 1
src/FMDatabase.h

@@ -13,7 +13,7 @@
 
     #define FMDBRelease(__v) ([__v release]);
 
-	#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
+    #define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
 #else
     // -fobjc-arc
     #define FMDBAutorelease(__v)

+ 22 - 22
src/FMDatabase.m

@@ -661,16 +661,16 @@ - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arr
         rc      = sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pStmt, 0);
         
         if (SQLITE_OK != rc) {
-			if (_logsErrors) {
-				NSLog(@"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
-				NSLog(@"DB Query: %@", sql);
-				NSLog(@"DB Path: %@", _databasePath);
-			}
-			
-			if (_crashOnErrors) {
-				NSAssert(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
-				abort();
-			}
+            if (_logsErrors) {
+                NSLog(@"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
+                NSLog(@"DB Query: %@", sql);
+                NSLog(@"DB Path: %@", _databasePath);
+            }
+            
+            if (_crashOnErrors) {
+                NSAssert(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
+                abort();
+            }
             
             sqlite3_finalize(pStmt);
             _isExecutingStatement = NO;
@@ -716,10 +716,10 @@ - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arr
             else if (args) {
                 obj = va_arg(args, id);
             }
-			else {
-				//We ran out of arguments
-				break;
-			}
+            else {
+                //We ran out of arguments
+                break;
+            }
             
             if (_traceExecution) {
                 if ([obj isKindOfClass:[NSData class]]) {
@@ -836,12 +836,12 @@ - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArra
                 NSLog(@"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                 NSLog(@"DB Query: %@", sql);
                 NSLog(@"DB Path: %@", _databasePath);
-			}
-			
-			if (_crashOnErrors) {
+            }
+            
+            if (_crashOnErrors) {
                 NSAssert(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                 abort();
-			}
+            }
             
             sqlite3_finalize(pStmt);
             
@@ -893,10 +893,10 @@ - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArra
             else if (args) {
                 obj = va_arg(args, id);
             }
-			else {
-				//We ran out of arguments
-				break;
-			}
+            else {
+                //We ran out of arguments
+                break;
+            }
             
             if (_traceExecution) {
                 if ([obj isKindOfClass:[NSData class]]) {

+ 1 - 1
src/FMResultSet.m

@@ -275,7 +275,7 @@ - (NSDate*)dateForColumnIndex:(int)columnIdx {
         return nil;
     }
     
-	return [_parentDB hasDateFormatter] ? [_parentDB dateFromString:[self stringForColumnIndex:columnIdx]] : [NSDate dateWithTimeIntervalSince1970:[self doubleForColumnIndex:columnIdx]];
+    return [_parentDB hasDateFormatter] ? [_parentDB dateFromString:[self stringForColumnIndex:columnIdx]] : [NSDate dateWithTimeIntervalSince1970:[self doubleForColumnIndex:columnIdx]];
 }
 
 

+ 4 - 4
src/fmdb.m

@@ -894,8 +894,8 @@ int main (int argc, const char * argv[]) {
         }];
         
     }
-	
-	FMDatabaseQueue *queue2 = [FMDatabaseQueue databaseQueueWithPath:dbPath flags:SQLITE_OPEN_READONLY];
+    
+    FMDatabaseQueue *queue2 = [FMDatabaseQueue databaseQueueWithPath:dbPath flags:SQLITE_OPEN_READONLY];
     
     FMDBQuickCheck(queue2);
     {
@@ -919,7 +919,7 @@ int main (int argc, const char * argv[]) {
             FMDBQuickCheck(!ok);
         }];
     }
-	
+    
     {
         // You should see pairs of numbers show up in stdout for this stuff:
         size_t ops = 16;
@@ -1377,7 +1377,7 @@ void testPool(NSString *dbPath) {
         NSLog(@"Number of open databases after crazy gcd stuff: %ld", [dbPool countOfOpenDatabases]);
     }
     
-	FMDatabasePool *dbPool2 = [FMDatabasePool databasePoolWithPath:dbPath flags:SQLITE_OPEN_READONLY];
+    FMDatabasePool *dbPool2 = [FMDatabasePool databasePoolWithPath:dbPath flags:SQLITE_OPEN_READONLY];
     
     FMDBQuickCheck(dbPool2);
     {