From 9199fa5f6e44392638a349cb96015fa84bd47cba Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 18 Nov 2009 11:25:01 +0000 Subject: [PATCH] fixups git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@29034 72102866-910b-0410-8b05-ffd578937521 --- ECPG.pgm | 3 +++ JDBC.m | 23 +++++++++-------------- MySQL.m | 3 +++ Postgres.m | 3 +++ SQLClient.h | 9 +++++---- SQLite.m | 3 +++ testECPG.m | 2 +- testJDBC.m | 6 +++--- testMySQL.m | 2 +- testPostgres.m | 6 +++--- 10 files changed, 34 insertions(+), 26 deletions(-) diff --git a/ECPG.pgm b/ECPG.pgm index 2a96676..17085c7 100644 --- a/ECPG.pgm +++ b/ECPG.pgm @@ -40,6 +40,9 @@ #include #include "config.h" + +#define SQLCLIENT_PRIVATE @public + #include "SQLClient.h" @interface SQLClientECPG : SQLClient diff --git a/JDBC.m b/JDBC.m index dcdb558..6ec041f 100644 --- a/JDBC.m +++ b/JDBC.m @@ -45,19 +45,14 @@ #import #include "config.h" + +#define SQLCLIENT_PRIVATE @public + #include "SQLClient.h" @interface _JDBCTransaction : SQLTransaction @end -typedef struct { - @defs(SQLClient); -} *CDefs; - -typedef struct { - @defs(_JDBCTransaction); -} *TDefs; - #include static NSString *JDBCException = @"SQLClientJDBCException"; @@ -1520,9 +1515,9 @@ static int JDBCVARCHAR = 0; - (SQLTransaction*) batch: (BOOL)stopOnFailure { - TDefs transaction; + _JDBCTransaction *transaction; - transaction = (TDefs)NSAllocateObject([_JDBCTransaction class], 0, + transaction = (_JDBCTransaction*)NSAllocateObject([_JDBCTransaction class], 0, NSDefaultMallocZone()); transaction->_db = [self retain]; @@ -1679,9 +1674,9 @@ static int JDBCVARCHAR = 0; - (SQLTransaction*) transaction { - TDefs transaction; + _JDBCTransaction *transaction; - transaction = (TDefs)NSAllocateObject([_JDBCTransaction class], 0, + transaction = (_JDBCTransaction*)NSAllocateObject([_JDBCTransaction class], 0, NSDefaultMallocZone()); transaction->_db = [self retain]; @@ -1887,12 +1882,12 @@ static int JDBCVARCHAR = 0; (*env)->PopLocalFrame (env, NULL); - ((CDefs)_db)->_lastOperation = GSTickerTimeNow(); + _db->_lastOperation = GSTickerTimeNow(); if (_duration >= 0) { NSTimeInterval d; - d = ((CDefs)_db)->_lastOperation - start; + d = _db->_lastOperation - start; if (d >= _duration) { [_db debug: @"Duration %g for transaction %@", diff --git a/MySQL.m b/MySQL.m index 62edc3f..97ef106 100644 --- a/MySQL.m +++ b/MySQL.m @@ -39,6 +39,9 @@ #import #include "config.h" + +#define SQLCLIENT_PRIVATE @public + #include "SQLClient.h" #include diff --git a/Postgres.m b/Postgres.m index 5cd82b8..3fb42a3 100644 --- a/Postgres.m +++ b/Postgres.m @@ -41,6 +41,9 @@ #import #include "config.h" + +#define SQLCLIENT_PRIVATE @public + #include "SQLClient.h" #include diff --git a/SQLClient.h b/SQLClient.h index 7f9b134..ef485a1 100644 --- a/SQLClient.h +++ b/SQLClient.h @@ -203,6 +203,10 @@ extern NSString * const SQLClientDidConnectNotification; */ extern NSString * const SQLClientDidDisconnectNotification; +#if !defined(SQLCLIENT_PRIVATE) +#define SQLCLIENT_PRIVATE @private +#endif + /** *

An enhanced array to represent a record returned from a query. * You should NOT try to create instances of this class @@ -348,6 +352,7 @@ extern unsigned SQLClientTimeTick(); */ @interface SQLClient : NSObject { +SQLCLIENT_PRIVATE void *extra; /** For subclass specific data */ NSRecursiveLock *lock; /** Maintain thread-safety */ /** @@ -1242,10 +1247,6 @@ extern unsigned SQLClientTimeTick(); - (void) setCacheThread: (NSThread*)aThread; @end -#if !defined(SQLCLIENT_PRIVATE) -#define SQLCLIENT_PRIVATE @private -#endif - /** * The SQLTransaction transaction class provides a convenient mechanism * for grouping together a series of SQL statements to be executed as a diff --git a/SQLite.m b/SQLite.m index 412bb26..d2ab9cd 100644 --- a/SQLite.m +++ b/SQLite.m @@ -41,6 +41,9 @@ #import #include "config.h" + +#define SQLCLIENT_PRIVATE @public + #include "SQLClient.h" #include #include diff --git a/testECPG.m b/testECPG.m index affd494..64a118c 100644 --- a/testECPG.m +++ b/testECPG.m @@ -29,7 +29,7 @@ int main() { - NSAutoreleasePool pool = [NSAutoreleasePool new]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; SQLClient *db; NSUserDefaults *defs; NSMutableArray *records; diff --git a/testJDBC.m b/testJDBC.m index f244a51..63a49c1 100644 --- a/testJDBC.m +++ b/testJDBC.m @@ -30,7 +30,7 @@ int main() { - NSAutoreleasePool pool = [NSAutoreleasePool new]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; SQLClient *db; NSUserDefaults *defs; NSMutableArray *records; @@ -96,7 +96,7 @@ main() NSLog(@"Start producing"); for (i = 0; i < 100000; i++) { - NSAutoreleasePool arp = [NSAutoreleasePool new]; + NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSString *destination = [NSString stringWithFormat: @"%d", i]; NSString *sid = [NSString stringWithFormat: @"%d", i%100]; @@ -112,7 +112,7 @@ main() NSLog(@"Start consuming"); for (i = 0; i < 100000;) { - NSAutoreleasePool arp = [NSAutoreleasePool new]; + NSAutoreleasePool *arp = [NSAutoreleasePool new]; unsigned count; int j; diff --git a/testMySQL.m b/testMySQL.m index e3c7505..2e39ee1 100644 --- a/testMySQL.m +++ b/testMySQL.m @@ -29,7 +29,7 @@ int main() { - NSAutoreleasePool pool = [NSAutoreleasePool new]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; SQLClient *db; NSUserDefaults *defs; NSMutableArray *records; diff --git a/testPostgres.m b/testPostgres.m index 6edf804..b7da123 100644 --- a/testPostgres.m +++ b/testPostgres.m @@ -41,7 +41,7 @@ int main() { - NSAutoreleasePool pool = [NSAutoreleasePool new]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; SQLClient *db; NSUserDefaults *defs; NSMutableArray *records; @@ -116,7 +116,7 @@ main() NSLog(@"Start producing"); for (i = 0; i < 100000; i++) { - NSAutoreleasePool arp = [NSAutoreleasePool new]; + NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSString *destination = [NSString stringWithFormat: @"%d", i]; NSString *sid = [NSString stringWithFormat: @"%d", i%100]; @@ -132,7 +132,7 @@ main() NSLog(@"Start consuming"); for (i = 0; i < 100000;) { - NSAutoreleasePool arp = [NSAutoreleasePool new]; + NSAutoreleasePool *arp = [NSAutoreleasePool new]; unsigned count; int j;