From e0af484dc9a778f11f96a6c72115b85ee180aa8d Mon Sep 17 00:00:00 2001 From: helge Date: Sat, 6 Aug 2005 18:00:02 +0000 Subject: [PATCH] fixed a warning on OSX 10.4 git-svn-id: http://svn.opengroupware.org/SOPE/trunk@982 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/GDLAccess/ChangeLog | 5 ++ sope-gdl1/GDLAccess/EOAdaptorContext.m | 110 ++++++++++++------------- sope-gdl1/GDLAccess/EOFault.m | 2 +- sope-gdl1/GDLAccess/Version | 2 +- sope-gdl1/GDLAccess/common.h | 6 +- 5 files changed, 65 insertions(+), 60 deletions(-) diff --git a/sope-gdl1/GDLAccess/ChangeLog b/sope-gdl1/GDLAccess/ChangeLog index eb7f6f04..e375d5d4 100644 --- a/sope-gdl1/GDLAccess/ChangeLog +++ b/sope-gdl1/GDLAccess/ChangeLog @@ -1,3 +1,8 @@ +2005-08-05 Helge Hess + + * EOAdaptorContext.m, common.h: do not include NSUtilities.h on Cocoa + (v4.5.53) + 2005-06-02 Helge Hess * EOJoinTypes.h: properly protect header against multiple inclusion diff --git a/sope-gdl1/GDLAccess/EOAdaptorContext.m b/sope-gdl1/GDLAccess/EOAdaptorContext.m index 82026ee8..6ed80db1 100644 --- a/sope-gdl1/GDLAccess/EOAdaptorContext.m +++ b/sope-gdl1/GDLAccess/EOAdaptorContext.m @@ -24,7 +24,6 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#import #import #import @@ -35,29 +34,27 @@ @implementation EOAdaptorContext -- (id)initWithAdaptor :(EOAdaptor*)_adaptor -{ - ASSIGN(self->adaptor, _adaptor); - self->channels = [[NSMutableArray alloc] initWithCapacity:2]; - [self->adaptor contextDidInit:self]; - return self; +- (id)initWithAdaptor:(EOAdaptor *)_adaptor { + ASSIGN(self->adaptor, _adaptor); + self->channels = [[NSMutableArray alloc] initWithCapacity:2]; + [self->adaptor contextDidInit:self]; + return self; } -- (void)dealloc -{ - [self->adaptor contextWillDealloc:self]; - RELEASE(self->adaptor); - RELEASE(self->channels); - [super dealloc]; +- (void)dealloc { + [self->adaptor contextWillDealloc:self]; + [self->adaptor release]; + [self->channels release]; + [super dealloc]; } -- (EOAdaptorChannel*)createAdaptorChannel -{ - return AUTORELEASE([[[adaptor adaptorChannelClass] alloc] - initWithAdaptorContext:self]); +/* channels */ + +- (EOAdaptorChannel *)createAdaptorChannel { + return [[[[adaptor adaptorChannelClass] alloc] + initWithAdaptorContext:self] autorelease]; } -- (NSArray *)channels -{ +- (NSArray *)channels { NSMutableArray *ma; unsigned i, count; @@ -71,13 +68,11 @@ return ma; } -- (void)channelDidInit:aChannel -{ - [self->channels addObject:[NSValue valueWithNonretainedObject:aChannel]]; +- (void)channelDidInit:aChannel { + [self->channels addObject:[NSValue valueWithNonretainedObject:aChannel]]; } -- (void)channelWillDealloc:(id)aChannel -{ +- (void)channelWillDealloc:(id)aChannel { int i; for (i = [self->channels count] - 1; i >= 0; i--) @@ -87,8 +82,7 @@ } } -- (BOOL)hasOpenChannels -{ +- (BOOL)hasOpenChannels { int i, count = [channels count]; for (i = 0; i < count; i++) @@ -98,8 +92,7 @@ return NO; } -- (BOOL)hasBusyChannels -{ +- (BOOL)hasBusyChannels { int i, count = [channels count]; for (i = 0; i < count; i++) @@ -110,102 +103,100 @@ return NO; } -- (BOOL)beginTransaction -{ +/* transactions */ + +- (BOOL)beginTransaction { if (transactionNestingLevel && ![self canNestTransactions]) return NO; if ([self->channels count] == 0) return NO; - if(delegateRespondsTo.willBegin) { + if (delegateRespondsTo.willBegin) { EODelegateResponse response = [delegate adaptorContextWillBegin:self]; - if(response == EODelegateRejects) + if (response == EODelegateRejects) return NO; - else if(response == EODelegateOverrides) + else if (response == EODelegateOverrides) return YES; } - if([self primaryBeginTransaction] == NO) + if ([self primaryBeginTransaction] == NO) return NO; [self transactionDidBegin]; - if(delegateRespondsTo.didBegin) + if (delegateRespondsTo.didBegin) [delegate adaptorContextDidBegin:self]; return YES; } -- (BOOL)commitTransaction -{ - if(!transactionNestingLevel || [self hasBusyChannels]) +- (BOOL)commitTransaction { + if (!transactionNestingLevel || [self hasBusyChannels]) return NO; if (![channels count]) return NO; - if(delegateRespondsTo.willCommit) { + if (delegateRespondsTo.willCommit) { EODelegateResponse response = [delegate adaptorContextWillCommit:self]; - if(response == EODelegateRejects) + if (response == EODelegateRejects) return NO; - else if(response == EODelegateOverrides) + else if (response == EODelegateOverrides) return YES; } - if([self primaryCommitTransaction] == NO) + if ([self primaryCommitTransaction] == NO) return NO; [self transactionDidCommit]; - if(delegateRespondsTo.didCommit) + if (delegateRespondsTo.didCommit) [delegate adaptorContextDidCommit:self]; return YES; } -- (BOOL)rollbackTransaction -{ - if(!transactionNestingLevel || [self hasBusyChannels]) +- (BOOL)rollbackTransaction { + if (!transactionNestingLevel || [self hasBusyChannels]) return NO; if (![channels count]) return NO; - if(delegateRespondsTo.willRollback) { + if (delegateRespondsTo.willRollback) { EODelegateResponse response = [delegate adaptorContextWillRollback:self]; - if(response == EODelegateRejects) + if (response == EODelegateRejects) return NO; - else if(response == EODelegateOverrides) + else if (response == EODelegateOverrides) return YES; } - if([self primaryRollbackTransaction] == NO) + if ([self primaryRollbackTransaction] == NO) return NO; [self transactionDidRollback]; - if(delegateRespondsTo.didRollback) + if (delegateRespondsTo.didRollback) [delegate adaptorContextDidRollback:self]; return YES; } -- (void)transactionDidBegin -{ +- (void)transactionDidBegin { /* Increment the transaction scope */ transactionNestingLevel++; } -- (void)transactionDidCommit -{ +- (void)transactionDidCommit { /* Decrement the transaction scope */ transactionNestingLevel--; } -- (void)transactionDidRollback -{ +- (void)transactionDidRollback { /* Decrement the transaction scope */ transactionNestingLevel--; } +/* delegate */ + - (void)setDelegate:(id)_delegate { self->delegate = _delegate; @@ -226,9 +217,14 @@ return self->delegate; } +/* adaptor */ + - (EOAdaptor *)adaptor { return self->adaptor; } + +/* transactions */ + - (BOOL)canNestTransactions { /* deprecated in WO 4.5 */ return NO; diff --git a/sope-gdl1/GDLAccess/EOFault.m b/sope-gdl1/GDLAccess/EOFault.m index c15e077a..8570563d 100644 --- a/sope-gdl1/GDLAccess/EOFault.m +++ b/sope-gdl1/GDLAccess/EOFault.m @@ -53,7 +53,7 @@ typedef struct { @implementation EOFault -+ (void)makeObjectIntoFault:(id)_object withHandler:(EOFaultHandler *)_handler { ++ (void)makeObjectIntoFault:(id)_object withHandler:(EOFaultHandler *)_handler{ [_handler setTargetClass:[_object class] extraData:((id *)_object)[1]]; ((EOFault *)_object)->isa = self; diff --git a/sope-gdl1/GDLAccess/Version b/sope-gdl1/GDLAccess/Version index 063faafb..d124b50f 100644 --- a/sope-gdl1/GDLAccess/Version +++ b/sope-gdl1/GDLAccess/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=52 +SUBMINOR_VERSION:=53 diff --git a/sope-gdl1/GDLAccess/common.h b/sope-gdl1/GDLAccess/common.h index bc474eaa..c0c93cea 100644 --- a/sope-gdl1/GDLAccess/common.h +++ b/sope-gdl1/GDLAccess/common.h @@ -41,7 +41,11 @@ #import #import -#import + +#if !(COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY) +# import +#endif + #import #if NeXT_RUNTIME || APPLE_RUNTIME -- 2.39.5