Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ccgus/fmdb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAugust "Gus" Mueller <gus@flyingmeat.com>2014-01-13 22:53:58 +0400
committerAugust "Gus" Mueller <gus@flyingmeat.com>2014-01-13 22:53:58 +0400
commit395f7b7a9800fbe51f3a31ffb275481b5939999b (patch)
tree0453c87a47d54cd687efa5385bc1324efdbce206
parent9d989cc659c7ad93ef34abe4fd15836f43f4a535 (diff)
parent04f2019a4eb0320ccb7eb1cb85d7ad7294ffb6e1 (diff)
Merge pull request #220 from robertmryan/master2.2-pod
Change the use of #if / #endif
-rw-r--r--src/FMDatabasePool.m5
-rw-r--r--src/FMDatabaseQueue.m10
2 files changed, 9 insertions, 6 deletions
diff --git a/src/FMDatabasePool.m b/src/FMDatabasePool.m
index b6cc543..38114a9 100644
--- a/src/FMDatabasePool.m
+++ b/src/FMDatabasePool.m
@@ -128,10 +128,11 @@
//This ensures that the db is opened before returning
#if SQLITE_VERSION_NUMBER >= 3005000
- if ([db openWithFlags:_openFlags]) {
+ BOOL success = [db openWithFlags:_openFlags];
#else
- if ([db open]) {
+ BOOL success = [db open];
#endif
+ if (success) {
if ([_delegate respondsToSelector:@selector(databasePool:shouldAddDatabaseToPool:)] && ![_delegate databasePool:self shouldAddDatabaseToPool:db]) {
[db close];
db = 0x00;
diff --git a/src/FMDatabaseQueue.m b/src/FMDatabaseQueue.m
index 811a6d1..40e9658 100644
--- a/src/FMDatabaseQueue.m
+++ b/src/FMDatabaseQueue.m
@@ -54,10 +54,11 @@
FMDBRetain(_db);
#if SQLITE_VERSION_NUMBER >= 3005000
- if (![_db openWithFlags:openFlags]) {
+ BOOL success = [_db openWithFlags:openFlags];
#else
- if (![_db open]) {
+ BOOL success = [_db open];
#endif
+ if (!success) {
NSLog(@"Could not create database queue for path %@", aPath);
FMDBRelease(self);
return 0x00;
@@ -112,10 +113,11 @@
_db = FMDBReturnRetained([FMDatabase databaseWithPath:_path]);
#if SQLITE_VERSION_NUMBER >= 3005000
- if (![_db openWithFlags:_openFlags]) {
+ BOOL success = [_db openWithFlags:_openFlags];
#else
- if (![db open]) {
+ BOOL success = [db open];
#endif
+ if (!success) {
NSLog(@"FMDatabaseQueue could not reopen database for path %@", _path);
FMDBRelease(_db);
_db = 0x00;