mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-23 21:20:47 +00:00
* EOAccess/EODatabaseContext.m
implemented _assertValidStateWithSelector: fixed leaks * EOAccess/Makefile.preamble: added -Werror-implicit-function-declaration * EOAccess/*: ported to new runtime and OS X git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@30242 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3f1ad81647
commit
e92812fdff
28 changed files with 177 additions and 178 deletions
|
@ -12,6 +12,12 @@
|
|||
fix includes for non-GNUstep platforms
|
||||
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLExpression.m
|
||||
fix includes for non-GNUstep platforms
|
||||
* EOAccess/EODatabaseContext.m
|
||||
implemented _assertValidStateWithSelector:
|
||||
fixed leaks
|
||||
* EOAccess/Makefile.preamble: added -Werror-implicit-function-declaration
|
||||
* EOAccess/*: ported to new runtime and OS X
|
||||
|
||||
|
||||
2010-04-21 Sergey Golovin <golovin.sv@gmail.com>
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOCheapArray.h>
|
||||
|
@ -147,7 +147,7 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
if ((self = [super init]))
|
||||
{
|
||||
NSDebugFLog(@"INIT EOAccessFaultHandler %p. ThreadID=%@",
|
||||
(void*)self,GSCurrentThread());
|
||||
(void*)self, [NSThread currentThread]);
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -185,7 +185,7 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
{
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOAccessFaultHandler %p. ThreadID=%@",
|
||||
(void*)self, GSCurrentThread());
|
||||
(void*)self, [NSThread currentThread]);
|
||||
#endif
|
||||
|
||||
DESTROY(gid);
|
||||
|
@ -324,7 +324,7 @@ NSString *EOAccessFaultObjectNotAvailableException = @"EOAccessFaultObjectNotAva
|
|||
{
|
||||
#ifdef DEBUG
|
||||
NSDebugFLog(@"Dealloc EOAccessArrayFaultHandler %p. ThreadID=%@",
|
||||
(void*)self,GSCurrentThread());
|
||||
(void*)self, [NSThread currentThread]);
|
||||
#endif
|
||||
|
||||
DESTROY(sgid);
|
||||
|
|
|
@ -65,7 +65,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/Unicode.h>
|
||||
|
@ -354,7 +354,8 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
|
|||
*/
|
||||
+ (NSArray *)availableAdaptorNames
|
||||
{
|
||||
NSArray *pathArray = NSStandardLibraryPaths();
|
||||
NSArray *pathArray = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory,
|
||||
NSAllDomainsMask, YES);
|
||||
NSEnumerator *pathEnum = [pathArray objectEnumerator];
|
||||
NSString *searchPath;
|
||||
NSFileManager *defaultManager = [NSFileManager defaultManager];
|
||||
|
|
|
@ -50,7 +50,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOMutableKnownKeyDictionary.h>
|
||||
|
|
|
@ -47,7 +47,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
|
|
|
@ -45,7 +45,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOAccess/EODatabaseOperation.h>
|
||||
|
@ -208,7 +208,7 @@ RCS_ID("$Id$")
|
|||
}
|
||||
|
||||
desc = [NSString stringWithFormat: @"<%s %p : operator: %@ entity: %@ qualifier:%@\nchangedValues: %@\nattributes:%@\nstoredProcedure: %@\nexception: %@>",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void*)self,
|
||||
operatorString,
|
||||
[_entity name],
|
||||
|
|
|
@ -60,7 +60,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EONull.h>
|
||||
|
@ -384,7 +384,7 @@ RCS_ID("$Id$")
|
|||
- (NSString *)description
|
||||
{
|
||||
NSString *dscr = [NSString stringWithFormat: @"<%s %p - name=%@ entity=%@ columnName=%@ definition=%@ ",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void*)self,
|
||||
[self name],
|
||||
[[self entity] name],
|
||||
|
|
|
@ -51,6 +51,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOObjectStore.h>
|
||||
|
|
|
@ -53,7 +53,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOEditingContext.h>
|
||||
|
|
|
@ -94,10 +94,11 @@ struct _EOTransactionScope;
|
|||
NSHashTable *_nonPrimaryKeyGenerators;
|
||||
|
||||
struct {
|
||||
unsigned int willPrepareForSave:1;
|
||||
unsigned int preparingForSave:1;
|
||||
unsigned int beganTransaction:1;
|
||||
unsigned int ignoreEntityCaching:1;
|
||||
unsigned int _reserved:29;
|
||||
unsigned int _reserved:28;
|
||||
} _flags;
|
||||
id _delegate; /* unretained */
|
||||
struct {
|
||||
|
|
|
@ -56,7 +56,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
|
@ -411,13 +411,13 @@ static Class _contextClass = Nil;
|
|||
- (BOOL)hasBusyChannels
|
||||
{
|
||||
BOOL busy = NO;
|
||||
int count = 0;
|
||||
NSUInteger count = 0;
|
||||
|
||||
count = [_registeredChannels count];
|
||||
|
||||
if (count>0)
|
||||
{
|
||||
int i = 0;
|
||||
NSUInteger i = 0;
|
||||
IMP oaiIMP=[_registeredChannels methodForSelector: @selector(objectAtIndex:)];
|
||||
|
||||
for (i = 0 ; !busy && i < count; i++)
|
||||
|
@ -435,7 +435,7 @@ static Class _contextClass = Nil;
|
|||
- (NSArray *)registeredChannels
|
||||
{
|
||||
NSMutableArray *array = nil;
|
||||
int i, count;
|
||||
NSUInteger i, count;
|
||||
|
||||
count = [_registeredChannels count];
|
||||
array = [NSMutableArray arrayWithCapacity: count];
|
||||
|
@ -467,8 +467,8 @@ static Class _contextClass = Nil;
|
|||
|
||||
- (void)unregisterChannel: (EODatabaseChannel *)channel
|
||||
{
|
||||
int i;
|
||||
int count= [_registeredChannels count];
|
||||
NSUInteger i;
|
||||
NSUInteger count= [_registeredChannels count];
|
||||
if (count>0)
|
||||
{
|
||||
IMP oaiIMP=[_registeredChannels methodForSelector: @selector(objectAtIndex:)];
|
||||
|
@ -521,7 +521,7 @@ static Class _contextClass = Nil;
|
|||
- (EODatabaseChannel *)availableChannel
|
||||
{
|
||||
EODatabaseChannel *channel = nil;
|
||||
int num = 2;
|
||||
NSUInteger num = 2;
|
||||
|
||||
while (!channel && num)
|
||||
{
|
||||
|
@ -635,7 +635,7 @@ May raise an exception if transaction has began or if you want pessimistic lock
|
|||
|
||||
- (void)handleDroppedConnection
|
||||
{
|
||||
int i;
|
||||
NSUInteger i;
|
||||
|
||||
EOFLOGObjectFnStartOrCond2(@"DatabaseLevel", @"EODatabaseContext");
|
||||
|
||||
|
@ -917,7 +917,7 @@ userInfo = {
|
|||
NSArray *updatedObjects = [userInfo objectForKey: EOUpdatedKey];
|
||||
//NSArray *insertedObjects = [userInfo objectForKey: EOInsertedKey];
|
||||
//NSArray *deletedObjects = [userInfo objectForKey: EODeletedKey];
|
||||
int i, count = [updatedObjects count];
|
||||
NSUInteger i, count = [updatedObjects count];
|
||||
|
||||
NSDebugMLLog(@"EODatabaseContext", @"updatedObjects=%@", updatedObjects);
|
||||
|
||||
|
@ -977,7 +977,7 @@ userInfo = {
|
|||
id sourceObjectFault = nil;
|
||||
id relationshipValue = nil;
|
||||
NSArray *sourceSnapshot = nil;
|
||||
int sourceSnapshotCount = 0;
|
||||
NSUInteger sourceSnapshotCount = 0;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ userInfo = {
|
|||
{
|
||||
EOGlobalID *snapGID = nil;
|
||||
id snapFault = nil;
|
||||
int i;
|
||||
NSUInteger i;
|
||||
IMP addObjectIMP=NULL;
|
||||
IMP oaiIMP=NULL;
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ userInfo = {
|
|||
{
|
||||
EOEntity *entity;
|
||||
EORelationship *relationship;
|
||||
unsigned int maxBatch = 0;
|
||||
NSUInteger maxBatch = 0;
|
||||
BOOL isToManyToOne = NO;
|
||||
EOEntity *destinationEntity = nil;
|
||||
EOModel *destinationEntityModel = nil;
|
||||
|
@ -1339,8 +1339,8 @@ userInfo = {
|
|||
NSArray *subEntities = nil;*/
|
||||
NSArray* rawRowKeyPaths = nil;
|
||||
BOOL usesDistinct = NO;
|
||||
int num = 0;
|
||||
int limit=0;
|
||||
NSUInteger num = 0;
|
||||
NSUInteger limit=0;
|
||||
id obj = nil;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
@ -1781,11 +1781,11 @@ userInfo = {
|
|||
|
||||
if ([entity isAbstractEntity] == NO) //Mirko ???
|
||||
{
|
||||
int autoreleaseSteps = 20;
|
||||
int autoreleaseStep = autoreleaseSteps;
|
||||
NSUInteger autoreleaseSteps = 20;
|
||||
NSUInteger autoreleaseStep = autoreleaseSteps;
|
||||
BOOL promptsAfterFetchLimit = NO;
|
||||
NSAutoreleasePool *arp = nil;//To avoid too much memory use when fetching a lot of objects
|
||||
int limit = 0;
|
||||
NSUInteger limit = 0;
|
||||
|
||||
[channel selectObjectsWithFetchSpecification: fetchSpecification
|
||||
editingContext: context];//OK
|
||||
|
@ -3318,23 +3318,25 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
dbOpeEnum = NSEnumerateMapTable(_dbOperationsByGlobalID);
|
||||
|
||||
while (NSNextMapEnumeratorPair(&dbOpeEnum, (void **)&gid, (void **)&dbOpe))
|
||||
{
|
||||
NSDebugMLLog(@"EODatabaseContext", @"dbOpe=%@", dbOpe);
|
||||
|
||||
//REVOIR
|
||||
if ([dbOpe databaseOperator] == EODatabaseNothingOperator)
|
||||
{
|
||||
NSDebugMLLog(@"EODatabaseContext", @"dbOpe=%@", dbOpe);
|
||||
|
||||
//REVOIR
|
||||
if ([dbOpe databaseOperator] == EODatabaseNothingOperator)
|
||||
{
|
||||
NSDebugMLLog(@"EODatabaseContext", @"Db Ope %@ for Nothing !!!",
|
||||
dbOpe);
|
||||
}
|
||||
else
|
||||
{
|
||||
[self _verifyNoChangesToReadonlyEntity: dbOpe];
|
||||
//MIRKO snapshot = [op dbSnapshot];
|
||||
[self createAdaptorOperationsForDatabaseOperation: dbOpe];
|
||||
}
|
||||
NSDebugMLLog(@"EODatabaseContext", @"Db Ope %@ for Nothing !!!",
|
||||
dbOpe);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
[self _verifyNoChangesToReadonlyEntity: dbOpe];
|
||||
//MIRKO snapshot = [op dbSnapshot];
|
||||
[self createAdaptorOperationsForDatabaseOperation: dbOpe];
|
||||
}
|
||||
}
|
||||
// avoid leaks! -- dw
|
||||
NSEndMapTableEnumeration(&dbOpeEnum);
|
||||
|
||||
NSDebugMLLog(@"EODatabaseContext", @"orderedAdaptorOperations A=%@",
|
||||
orderedAdaptorOperations);
|
||||
|
||||
|
@ -3517,11 +3519,15 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
}
|
||||
}
|
||||
}
|
||||
// avoid leaks! -- dw
|
||||
NSEndMapTableEnumeration(&dbOpeEnum);
|
||||
}
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
|
||||
// TODO: change to SYNCRONIZED and free memorory properly -- dw
|
||||
- (void)commitChanges
|
||||
{
|
||||
BOOL doIt = NO;
|
||||
|
@ -3535,16 +3541,18 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
//REVOIR: don't do it if no adaptor ope
|
||||
{
|
||||
NSMapEnumerator dbOpeEnum;
|
||||
EOGlobalID *gid = nil;
|
||||
EODatabaseOperation *dbOpe = nil;
|
||||
dbOpeEnum = NSEnumerateMapTable(_dbOperationsByGlobalID);
|
||||
|
||||
while (!doIt && NSNextMapEnumeratorPair(&dbOpeEnum, (void **)&gid,
|
||||
(void **)&dbOpe))
|
||||
{
|
||||
doIt = ([dbOpe adaptorOperations] != nil);
|
||||
}
|
||||
NSMapEnumerator dbOpeEnum;
|
||||
EOGlobalID *gid = nil;
|
||||
EODatabaseOperation *dbOpe = nil;
|
||||
dbOpeEnum = NSEnumerateMapTable(_dbOperationsByGlobalID);
|
||||
|
||||
while (!doIt && NSNextMapEnumeratorPair(&dbOpeEnum, (void **)&gid,
|
||||
(void **)&dbOpe))
|
||||
{
|
||||
doIt = ([dbOpe adaptorOperations] != nil);
|
||||
}
|
||||
// avoid leaks! -- dw
|
||||
NSEndMapTableEnumeration(&dbOpeEnum);
|
||||
}
|
||||
|
||||
/* If a transaction is open, it could be holding locks
|
||||
|
@ -3690,6 +3698,8 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
break;
|
||||
}
|
||||
}
|
||||
// avoid leaks! -- dw
|
||||
NSEndMapTableEnumeration(&dbOpeEnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6587,7 +6597,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
//really near ok
|
||||
NSArray *relationships = nil;
|
||||
NSArray *classPropertyAttributeNames = nil;
|
||||
int count = 0;
|
||||
NSUInteger count = 0;
|
||||
IMP objectTakeStoredValueForKeyIMP=NULL;
|
||||
IMP rowObjectForKeyIMP=NULL;
|
||||
|
||||
|
@ -6604,7 +6614,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
if (count>0)
|
||||
{
|
||||
int i=0;
|
||||
NSUInteger i=0;
|
||||
IMP oaiIMP=[classPropertyAttributeNames methodForSelector:@selector(objectAtIndex:)];
|
||||
|
||||
NSAssert(!_isFault(object),
|
||||
|
@ -6641,7 +6651,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
if (count>0)
|
||||
{
|
||||
int i=0;
|
||||
NSUInteger i=0;
|
||||
IMP oaiIMP=[relationships methodForSelector:@selector(objectAtIndex:)];
|
||||
|
||||
if (!objectTakeStoredValueForKeyIMP)
|
||||
|
@ -6822,56 +6832,37 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
- (void)_commitTransaction
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
NSDebugMLLog(@"EODatabaseContext", @"self=%p _uniqueStack %p=%@",
|
||||
self, _uniqueStack, _uniqueStack);
|
||||
|
||||
|
||||
if ([_uniqueStack count] > 0)
|
||||
{
|
||||
NSMutableDictionary *snapshotsDict = [_uniqueStack lastObject];
|
||||
NSMutableDictionary *toManySnapshotsDict = [_uniqueArrayStack lastObject];
|
||||
NSMutableSet *deleteSnapshotsSet = [_deleteStack lastObject];
|
||||
NSEnumerator *deletedGIDEnum = [deleteSnapshotsSet objectEnumerator];
|
||||
EOGlobalID *gid;
|
||||
|
||||
while ((gid = [deletedGIDEnum nextObject]))
|
||||
{
|
||||
NSMutableDictionary *snapshotsDict
|
||||
= [_uniqueStack lastObject];
|
||||
NSMutableDictionary *toManySnapshotsDict
|
||||
= [_uniqueArrayStack lastObject];
|
||||
NSMutableSet *deleteSnapshotsSet
|
||||
= [_deleteStack lastObject];
|
||||
NSEnumerator *deletedGIDEnum
|
||||
= [deleteSnapshotsSet objectEnumerator];
|
||||
EOGlobalID *gid;
|
||||
|
||||
while ((gid = [deletedGIDEnum nextObject]))
|
||||
{
|
||||
[_database forgetSnapshotForGlobalID: gid];
|
||||
}
|
||||
|
||||
[_database recordSnapshots: snapshotsDict];
|
||||
[_database recordToManySnapshots: toManySnapshotsDict];
|
||||
|
||||
[self forgetAllLocks];
|
||||
|
||||
[_uniqueStack removeLastObject];
|
||||
[_uniqueArrayStack removeLastObject];
|
||||
[_deleteStack removeLastObject];
|
||||
[_database forgetSnapshotForGlobalID: gid];
|
||||
}
|
||||
|
||||
NSDebugMLLog(@"EODatabaseContext", @"self=%p _uniqueStack %p=%@",
|
||||
self, _uniqueStack, _uniqueStack);
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
[_database recordSnapshots: snapshotsDict];
|
||||
[_database recordToManySnapshots: toManySnapshotsDict];
|
||||
|
||||
[self forgetAllLocks];
|
||||
|
||||
[_uniqueStack removeLastObject];
|
||||
[_uniqueArrayStack removeLastObject];
|
||||
[_deleteStack removeLastObject];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) _beginTransaction
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
[_uniqueStack addObject: [NSMutableDictionary dictionary]];
|
||||
[_uniqueArrayStack addObject: [NSMutableDictionary dictionary]];
|
||||
[_deleteStack addObject: [NSMutableSet set]];
|
||||
|
||||
NSDebugMLLog(@"EODatabaseContext", @"self=%p _uniqueStack %p=%@",
|
||||
self, _uniqueStack, _uniqueStack);
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (EODatabaseChannel*) _obtainOpenChannel
|
||||
|
@ -6950,8 +6941,8 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
- (void) _cleanUpAfterSave
|
||||
{
|
||||
//TODO
|
||||
EOFLOGObjectFnStart();
|
||||
// TODO -- dw
|
||||
//EODatabase * eodatabase = [self database];
|
||||
|
||||
_coordinator = nil; //realesae ?
|
||||
_editingContext = nil; //realesae ?
|
||||
|
@ -6963,15 +6954,16 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
_dbOperationsByGlobalID = NULL;
|
||||
}
|
||||
|
||||
_flags.beganTransaction = NO;
|
||||
_flags.willPrepareForSave = NO;
|
||||
_flags.preparingForSave = NO;
|
||||
|
||||
//TODO HERE or in _commitTransaction ?
|
||||
if (_lockedObjects)
|
||||
{
|
||||
NSResetHashTable(_lockedObjects);
|
||||
}
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
// TODO -- dw
|
||||
// if (eodatabase != nil)
|
||||
// {
|
||||
// [eodatabase _clearLastRecords];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
- (EOGlobalID*)_globalIDForObject: (id)object
|
||||
|
@ -7189,7 +7181,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
// will relay it's pk to parent which is not good
|
||||
NSDictionary *objectSnapshot=nil;
|
||||
NSArray *relationships=nil;
|
||||
int relationshipsCount=0;
|
||||
NSUInteger relationshipsCount=0;
|
||||
|
||||
NSDebugMLLog(@"EODatabaseContext", @"object=%@", object);
|
||||
|
||||
|
@ -7207,7 +7199,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
if (relationshipsCount>0)
|
||||
{
|
||||
IMP oaiIMP=[relationships methodForSelector: @selector(objectAtIndex:)];
|
||||
int i = 0;
|
||||
NSUInteger i = 0;
|
||||
|
||||
for (i = 0; i < relationshipsCount; i++)
|
||||
{
|
||||
|
@ -7304,7 +7296,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
NSArray *objects[3];
|
||||
NSHashTable *processedEntities = NULL;
|
||||
NSMutableArray *entityToProcess = nil;
|
||||
int which;
|
||||
NSUInteger which;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
|
@ -7321,12 +7313,12 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
|
||||
for (which = 0; which < 3; which++)
|
||||
{
|
||||
int count = [objects[which] count];
|
||||
NSUInteger count = [objects[which] count];
|
||||
|
||||
if (count>0)
|
||||
{
|
||||
IMP oaiIMP=[objects[which] methodForSelector: @selector(objectAtIndex:)];
|
||||
int i = 0;
|
||||
NSUInteger i = 0;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
@ -7355,12 +7347,12 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
if (!NSHashInsertIfAbsent(processedEntities, entity)) //Already processed ?
|
||||
{
|
||||
NSArray *relationships = [entity relationships];
|
||||
int relationshipsCount = [relationships count];
|
||||
NSUInteger relationshipsCount = [relationships count];
|
||||
|
||||
if (relationshipsCount>0)
|
||||
{
|
||||
IMP relObjectAtIndexIMP=[relationships methodForSelector: @selector(objectAtIndex:)];
|
||||
int iRelationship = 0;
|
||||
NSUInteger iRelationship = 0;
|
||||
|
||||
for (iRelationship = 0;
|
||||
iRelationship < relationshipsCount;
|
||||
|
@ -7385,7 +7377,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
{
|
||||
NSArray *destAttrs;
|
||||
NSArray *pkAttrs;
|
||||
int count;
|
||||
NSUInteger count;
|
||||
BOOL destPK = NO;
|
||||
|
||||
destAttrs = [relationship destinationAttributes];
|
||||
|
@ -7395,7 +7387,7 @@ Raises an exception is the adaptor is unable to perform the operations.
|
|||
if (count>0)
|
||||
{
|
||||
IMP destAttrsObjectAtIndexIMP=[relationships methodForSelector: @selector(objectAtIndex:)];
|
||||
int i=0;
|
||||
NSUInteger i=0;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if ([pkAttrs containsObject:
|
||||
|
@ -7483,10 +7475,17 @@ If the object has been just inserted, the dictionary is empty.
|
|||
return snapshot;
|
||||
}
|
||||
|
||||
|
||||
- (void) _assertValidStateWithSelector: (SEL)sel
|
||||
{
|
||||
// [self notImplemented:_cmd]; //TODO
|
||||
if ((!_flags.preparingForSave) && (!_flags.willPrepareForSave))
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"_assertValidStateWithSelector:%s %s is in invalid state, "
|
||||
"call prepareForSaveWithCoordinator: before calling this method.",
|
||||
sel_getName(sel),
|
||||
object_getClassName(self)];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (id) _addDatabaseContextStateToException: (id)param0
|
||||
|
|
|
@ -55,7 +55,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOEditingContext.h>
|
||||
|
@ -182,7 +182,7 @@ RCS_ID("$Id$")
|
|||
{
|
||||
return [NSString stringWithFormat:
|
||||
@"<%s %p : entity name=%@ editingContext=%p fetchSpecification=%@>",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void *)self,
|
||||
[[self entity]name],
|
||||
_editingContext,
|
||||
|
|
|
@ -49,7 +49,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
|
@ -350,7 +350,7 @@ RCS_ID("$Id$")
|
|||
}
|
||||
|
||||
desc = [NSString stringWithFormat: @"<%s %p : operator: %@ entity: %@ globalID:%@\nnewRow %p: %@\nobject %p: %@\ndbSnapshot %p: %@>",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void*)self,
|
||||
operatorString,
|
||||
[_entity name],
|
||||
|
|
|
@ -63,6 +63,7 @@ RCS_ID("$Id$")
|
|||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOKeyValueCoding.h>
|
||||
|
@ -625,7 +626,7 @@ static void performSelectorOnArrayWithEachObjectOfClass(NSArray *arr, SEL select
|
|||
NSString *dscr = nil;
|
||||
|
||||
dscr = [NSString stringWithFormat: @"<%s %p - name=%@ className=%@ externalName=%@ externalQuery=%@",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void*)self,
|
||||
_name,
|
||||
_className,
|
||||
|
@ -3981,7 +3982,7 @@ toDestinationAttributeInLastComponentOfRelationshipPath: (NSString *)path
|
|||
- (NSString *) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s %p - Entity: %@>",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
self,
|
||||
[self entityName]];
|
||||
}
|
||||
|
|
|
@ -54,8 +54,8 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#define GSI_ARRAY_TYPES GSUNION_OBJ
|
||||
|
|
|
@ -31,7 +31,6 @@ RCS_ID("$Id: EOEntity.m 27910 2009-02-18 05:52:42Z ayers $")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#endif
|
||||
|
||||
#include <EOAccess/EOEntity.h>
|
||||
|
|
|
@ -45,7 +45,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
|
@ -87,7 +87,7 @@ RCS_ID("$Id$")
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (unsigned)hash
|
||||
- (NSUInteger)hash
|
||||
{
|
||||
return [_sourceAttribute hash];
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ RCS_ID("$Id$")
|
|||
*/
|
||||
|
||||
dscr = [NSString stringWithFormat: @"<%s %p -",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void*)self];
|
||||
dscr = [dscr stringByAppendingFormat: @" sourceAttribute=%@",
|
||||
[_sourceAttribute name]];
|
||||
|
|
|
@ -52,7 +52,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
|
|
|
@ -49,7 +49,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOAccess/EOModelGroup.h>
|
||||
|
@ -76,11 +76,7 @@ static EOModelGroup *globalModelGroup = nil;
|
|||
+ (EOModelGroup *)defaultGroup
|
||||
{
|
||||
EOModelGroup *modelGroup = nil;
|
||||
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"defaultModelGroup=%p",defaultModelGroup);
|
||||
|
||||
|
||||
if (defaultModelGroup)
|
||||
modelGroup = defaultModelGroup;
|
||||
else if (delegateDefaultModelGroup)
|
||||
|
@ -93,18 +89,11 @@ static EOModelGroup *globalModelGroup = nil;
|
|||
NSLog(@"WARNING: No default Group");
|
||||
}
|
||||
|
||||
NSDebugMLLog(@"gsdb", @"modelGroup=%p",modelGroup);
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
||||
return modelGroup;
|
||||
}
|
||||
|
||||
+ (void)setDefaultGroup: (EOModelGroup *)group
|
||||
{
|
||||
NSDebugMLLog(@"gsdb", @"group=%p defaultModelGroup=%p",
|
||||
group,defaultModelGroup);
|
||||
|
||||
if (group != defaultModelGroup)
|
||||
{
|
||||
if (defaultModelGroup)
|
||||
|
|
|
@ -38,7 +38,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOFault.h>
|
||||
|
@ -90,7 +90,7 @@ EODatabaseContext_snapshotForGlobalIDWithImpPtr(EODatabaseContext* dbContext,
|
|||
imp=*impPtr;
|
||||
if (!imp)
|
||||
{
|
||||
if (GSObjCClass(dbContext)==GDL2_EODatabaseContextClass
|
||||
if (object_getClass(dbContext)==GDL2_EODatabaseContextClass
|
||||
&& GDL2_EODatabaseContext_snapshotForGlobalIDIMP)
|
||||
imp=GDL2_EODatabaseContext_snapshotForGlobalIDIMP;
|
||||
else
|
||||
|
@ -113,7 +113,7 @@ EOGlobalID* EODatabaseContext_globalIDForObjectWithImpPtr(EODatabaseContext* dbC
|
|||
imp=*impPtr;
|
||||
if (!imp)
|
||||
{
|
||||
if (GSObjCClass(dbContext)==GDL2_EODatabaseContextClass
|
||||
if (object_getClass(dbContext)==GDL2_EODatabaseContextClass
|
||||
&& GDL2_EODatabaseContext__globalIDForObjectIMP)
|
||||
imp=GDL2_EODatabaseContext__globalIDForObjectIMP;
|
||||
else
|
||||
|
|
|
@ -49,7 +49,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOObserver.h>
|
||||
|
@ -490,7 +490,7 @@ RCS_ID("$Id$")
|
|||
NS_DURING //Just for debugging
|
||||
{
|
||||
dscr = [NSString stringWithFormat: @"<%s %p - name=%@ entity=%@ destinationEntity=%@ definition=%@",
|
||||
object_get_class_name(self),
|
||||
object_getClassName(self),
|
||||
(void*)self,
|
||||
[self name],
|
||||
[[self entity]name],
|
||||
|
@ -2130,12 +2130,10 @@ dst entity primaryKeyAttributeNames
|
|||
adaptorDictionaryInitializer);
|
||||
|
||||
sourceRowToForeignKeyMapping =
|
||||
[destinationDictionaryInitializer
|
||||
subsetMappingForSourceDictionaryInitializer:
|
||||
adaptorDictionaryInitializer
|
||||
sourceKeys: sourceKeys
|
||||
destinationKeys: destinationKeys];
|
||||
|
||||
[destinationDictionaryInitializer subsetMappingForSourceDictionaryInitializer: adaptorDictionaryInitializer
|
||||
sourceKeys: sourceKeys
|
||||
destinationKeys: destinationKeys];
|
||||
|
||||
ASSIGN(_sourceRowToForeignKeyMapping, sourceRowToForeignKeyMapping);
|
||||
|
||||
EOFLOGObjectLevelArgs(@"EORelationship",@"%@ to %@: _sourceRowToForeignKeyMapping=%@",
|
||||
|
|
|
@ -56,7 +56,7 @@ RCS_ID("$Id$")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOFetchSpecification.h>
|
||||
|
@ -1518,13 +1518,13 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
|
|||
EOFLOGObjectLevelArgs(@"EOSQLExpression", @"selectorSQLString=%@",
|
||||
selectorSQLString);
|
||||
|
||||
if (sel_eq([qualifier selector], EOQualifierOperatorLike))
|
||||
if (sel_isEqual([qualifier selector], EOQualifierOperatorLike))
|
||||
{
|
||||
value = [[self class] sqlPatternFromShellPattern: value];
|
||||
valueSQLString = [self sqlStringForValue: value
|
||||
attributeNamed: key];
|
||||
}
|
||||
else if (sel_eq([qualifier selector], EOQualifierOperatorCaseInsensitiveLike))
|
||||
else if (sel_isEqual([qualifier selector], EOQualifierOperatorCaseInsensitiveLike))
|
||||
{
|
||||
value = [[self class] sqlPatternFromShellPattern: value];
|
||||
|
||||
|
@ -1604,13 +1604,13 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
|
|||
|
||||
orderSelector = [sortOrdering selector];
|
||||
|
||||
if (sel_eq(orderSelector, EOCompareAscending))
|
||||
if (sel_isEqual(orderSelector, EOCompareAscending))
|
||||
orderStringFormat = @"(%@) asc";
|
||||
else if (sel_eq(orderSelector, EOCompareDescending))
|
||||
else if (sel_isEqual(orderSelector, EOCompareDescending))
|
||||
orderStringFormat = @"(%@) desc";
|
||||
else if (sel_eq(orderSelector, EOCompareCaseInsensitiveAscending))
|
||||
else if (sel_isEqual(orderSelector, EOCompareCaseInsensitiveAscending))
|
||||
orderStringFormat = @"upper(%@) asc";
|
||||
else if (sel_eq(orderSelector, EOCompareCaseInsensitiveDescending))
|
||||
else if (sel_isEqual(orderSelector, EOCompareCaseInsensitiveDescending))
|
||||
orderStringFormat = @"upper(%@) desc";
|
||||
|
||||
key = [sortOrdering key];
|
||||
|
@ -1780,33 +1780,33 @@ NSString *EOBindVariableColumnKey = @"EOBindVariableColumnKey";
|
|||
value: (id)value
|
||||
{
|
||||
//seems OK
|
||||
if (sel_eq(selector, EOQualifierOperatorEqual))
|
||||
if (sel_isEqual(selector, EOQualifierOperatorEqual))
|
||||
{
|
||||
if (value==GDL2_EONull)
|
||||
return @"is";
|
||||
else
|
||||
return @"=";
|
||||
}
|
||||
else if (sel_eq(selector, EOQualifierOperatorNotEqual))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorNotEqual))
|
||||
{
|
||||
if (value==GDL2_EONull)
|
||||
return @"is not";
|
||||
else
|
||||
return @"<>";
|
||||
}
|
||||
else if (sel_eq(selector, EOQualifierOperatorLessThan))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorLessThan))
|
||||
return @"<";
|
||||
else if (sel_eq(selector, EOQualifierOperatorGreaterThan))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorGreaterThan))
|
||||
return @">";
|
||||
else if (sel_eq(selector, EOQualifierOperatorLessThanOrEqualTo))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorLessThanOrEqualTo))
|
||||
return @"<=";
|
||||
else if (sel_eq(selector, EOQualifierOperatorGreaterThanOrEqualTo))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorGreaterThanOrEqualTo))
|
||||
return @">=";
|
||||
else if (sel_eq(selector, EOQualifierOperatorLike))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorLike))
|
||||
return @"like";
|
||||
else if (sel_eq(selector, EOQualifierOperatorCaseInsensitiveLike))
|
||||
else if (sel_isEqual(selector, EOQualifierOperatorCaseInsensitiveLike))
|
||||
return @"like"; //same as sensitive
|
||||
/* //TODO else if(sel_eq(selector, EOQualifierOperatorContains))
|
||||
/* //TODO else if(sel_isEqual(selector, EOQualifierOperatorContains))
|
||||
return @"like";*/
|
||||
else
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOAccess/EOSQLQualifier.h>
|
||||
|
|
|
@ -49,7 +49,7 @@ RCS_ID("$Id: EOSchemaGeneration.m 23653 2006-09-28 15:25:30Z ratmice $")
|
|||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
|
|
|
@ -47,6 +47,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EODebug.h>
|
||||
|
|
|
@ -49,7 +49,7 @@ RCS_ID("$Id$")
|
|||
|
||||
#ifndef GNUSTEP
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
#include <GNUstepBase/NSDebug+GNUstepBase.h>
|
||||
#endif
|
||||
|
||||
#include <EOControl/EOKeyGlobalID.h>
|
||||
|
|
|
@ -27,6 +27,8 @@ include ../common.make
|
|||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
include ../Version
|
||||
|
||||
-include Makefile.preamble
|
||||
|
||||
# The library to be compiled
|
||||
NATIVE_LIBRARY_NAME=EOAccess
|
||||
|
||||
|
@ -93,7 +95,6 @@ EODefines.h \
|
|||
EODeprecated.h \
|
||||
EOAccess.h
|
||||
|
||||
|
||||
DOCUMENT_NAME = EOAccess
|
||||
|
||||
# autogsdoc scan the source files corresponding to the headers
|
||||
|
@ -108,7 +109,8 @@ EOAccess_AGSDOC_FLAGS = \
|
|||
$(GDL2_AGSDOC_FLAGS)
|
||||
|
||||
|
||||
-include Makefile.preamble
|
||||
ADDITIONAL_OBJCFLAGS = -Werror-implicit-function-declaration
|
||||
|
||||
|
||||
-include GNUmakefile.local
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ ADDITIONAL_CPPFLAGS = $(FND_DEFINE) $(RUNTIME_DEFINE) -g
|
|||
ADDITIONAL_OBJCFLAGS = $(TEST_CFLAGS)
|
||||
|
||||
# Additional flags to pass to the C compiler
|
||||
ADDITIONAL_CFLAGS = $(TEST_CFLAGS)
|
||||
ADDITIONAL_CFLAGS = $(TEST_CFLAGS)
|
||||
CFLAGS += -Werror-implicit-function-declaration
|
||||
|
||||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS = -I../EOControl/$(GNUSTEP_TARGET_DIR) -I..
|
||||
|
|
Loading…
Reference in a new issue