* EOControl/EOFault.m

(+[EOFault respondsToSelector:]): Use GSObjCRuntime functions
        and
        correct casts.
        (-[EOFault respondsToSelector:]): Correct casts.

        * EOControl/EOKeyComparisonQualifier.m
        * EOControl/EOKeyValueCoding.m
        * EOControl/EOKeyValueQualifier.m
        * EOControl/EOQualifier.m
        * EOControl/EOSortOrdering.m
        (-[NSObject compare:]): Add declaration to prepare for removal
        of declaration from -base.
        (-[EOKeyComparisonQualifier evaluateWithObject:]): Adapt
        * vraiables
        and casts to use correct prototype.
        (-[EOKeyValueQualifier evaluateWithObject:]): Ditto
        (-[NSArray computeMaxForKey:]): Ditto.
        (-[NSArray computeMinForKey:]): Ditto.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@17651 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2003-09-10 13:35:32 +00:00
parent 0135ad09da
commit 283db56349
7 changed files with 91 additions and 10 deletions

View file

@ -1,3 +1,23 @@
2003-09-10 David Ayers <d.ayers@inode.at>
* EOControl/EOFault.m
(+[EOFault respondsToSelector:]): Use GSObjCRuntime functions and
correct casts.
(-[EOFault respondsToSelector:]): Correct casts.
* EOControl/EOKeyComparisonQualifier.m
* EOControl/EOKeyValueCoding.m
* EOControl/EOKeyValueQualifier.m
* EOControl/EOQualifier.m
* EOControl/EOSortOrdering.m
(-[NSObject compare:]): Add declaration to prepare for removal
of declaration from -base.
(-[EOKeyComparisonQualifier evaluateWithObject:]): Adapt vraiables
and casts to use correct prototype.
(-[EOKeyValueQualifier evaluateWithObject:]): Ditto
(-[NSArray computeMaxForKey:]): Ditto.
(-[NSArray computeMinForKey:]): Ditto.
2003-08-25 Matt Rice <ratmice@yahoo.com>
* *.h/m: Updated to new header layout.

View file

@ -137,7 +137,7 @@ static Class EOFaultClass = NULL;
+ (BOOL)respondsToSelector: (SEL)sel
{
return (IMP)class_get_instance_method(self, sel) != (IMP)0;
return (GSGetInstanceMethod(self, sel) != (GSMethod)0);
}
@ -323,7 +323,7 @@ static Class EOFaultClass = NULL;
NSDebugFLLog(@"gsdb", @"class=%@ aSelector=%@", class,
NSStringFromSelector(aSelector));
respondsToSelector = (GSGetInstanceMethod(class, aSelector) != (IMP)0);
respondsToSelector = (GSGetInstanceMethod(class, aSelector) != (GSMethod)0);
NSDebugFLLog(@"gsdb", @"STOP self=%p", self);
return respondsToSelector;

View file

@ -52,6 +52,17 @@ RCS_ID("$Id$")
#include <EOControl/EOKeyValueCoding.h>
#include <EOControl/EODebug.h>
/*
This declaration is needed by the compiler to state that
eventhough we know not all objects respond to -compare:,
we want the compiler to generate code for the given
prototype when calling -compare: in the following methods.
We do not put this declaration in a header file to avoid
the compiler seeing conflicting prototypes in user code.
*/
@interface NSObject (Comparison)
- (NSComparisonResult)compare: (id)other;
@end
@implementation EOKeyComparisonQualifier
@ -164,7 +175,8 @@ RCS_ID("$Id$")
*/
- (BOOL) evaluateWithObject: (id)object
{
id leftVal, rightVal;
NSObject *leftVal;
NSObject *rightVal;
BOOL (*imp)(id, SEL, id);
leftVal = [object valueForKey: _leftKey];
@ -201,7 +213,7 @@ RCS_ID("$Id$")
}
else if (sel_eq(_selector, EOQualifierOperatorContains) == YES)
{
return [leftVal rangeOfString: rightVal].location != NSNotFound;
return [(id)leftVal rangeOfString: (id)rightVal].location != NSNotFound;
}
else if (sel_eq(_selector, EOQualifierOperatorLike) == YES)
{
@ -212,7 +224,7 @@ RCS_ID("$Id$")
else if (sel_eq(_selector, EOQualifierOperatorCaseInsensitiveLike) == YES)
{
NSEmitTODO(); //TODO
return [[leftVal uppercaseString] isEqual: [rightVal uppercaseString]]
return [[(id)leftVal uppercaseString] isEqual: [(id)rightVal uppercaseString]]
== NSOrderedSame;
}
/*Ayers (09-02-2002): Maybe we should raise instead of returning NO.*/

View file

@ -168,6 +168,20 @@ initialize(void)
}
@end
/*
This declaration is needed by the compiler to state that
eventhough we know not all objects respond to -compare:,
we want the compiler to generate code for the given
prototype when calling -compare: in the following methods.
We do not put this declaration in a header file to avoid
the compiler seeing conflicting prototypes in user code.
*/
@interface NSObject (Comparison)
- (NSComparisonResult)compare: (id)other;
@end
@implementation NSArray (EOKeyValueCoding)
/**
@ -413,7 +427,7 @@ initialize(void)
if (currentVal == nil || currentVal == null) continue;
if ([resultVal compare: currentVal] == NSOrderedAscending)
if ([(NSObject *)resultVal compare: currentVal] == NSOrderedAscending)
{
result = current;
resultVal = currentVal;
@ -455,7 +469,7 @@ initialize(void)
if (currentVal == nil || currentVal == null) continue;
if ([resultVal compare: currentVal] == NSOrderedDescending)
if ([(NSObject *)resultVal compare: currentVal] == NSOrderedDescending)
{
result = current;
resultVal = currentVal;

View file

@ -57,6 +57,17 @@ RCS_ID("$Id$")
#include <EOControl/EOEditingContext.h>
#include <EOControl/EODebug.h>
/*
This declaration is needed by the compiler to state that
eventhough we know not all objects respond to -compare:,
we want the compiler to generate code for the given
prototype when calling -compare: in the following methods.
We do not put this declaration in a header file to avoid
the compiler seeing conflicting prototypes in user code.
*/
@interface NSObject (Comparison)
- (NSComparisonResult)compare: (id)other;
@end
@implementation EOKeyValueQualifier
@ -169,7 +180,7 @@ RCS_ID("$Id$")
*/
- (BOOL) evaluateWithObject: (id)object
{
id val;
NSObject *val;
BOOL (*imp)(id, SEL, id);
val = [object valueForKey: _key];
@ -205,7 +216,7 @@ RCS_ID("$Id$")
}
else if (sel_eq(_selector, EOQualifierOperatorContains) == YES)
{
return [val rangeOfString: _value].location != NSNotFound;
return [(id)val rangeOfString: _value].location != NSNotFound;
}
else if (sel_eq(_selector, EOQualifierOperatorLike) == YES)
{
@ -215,7 +226,7 @@ RCS_ID("$Id$")
else if (sel_eq(_selector, EOQualifierOperatorCaseInsensitiveLike) == YES)
{
NSEmitTODO(); //TODO
return [[val uppercaseString] isEqual: [_value uppercaseString]]
return [[(id)val uppercaseString] isEqual: [_value uppercaseString]]
== NSOrderedSame;
}
/*Ayers (09-02-2002): Maybe we should raise instead of returning NO.*/

View file

@ -883,6 +883,18 @@ static Class whichQualifier(const char **cFormat, const char **s)
@end
/*
This declaration is needed by the compiler to state that
eventhough we know not all objects respond to -compare:,
we want the compiler to generate code for the given
prototype when calling -compare: in the following methods.
We do not put this declaration in a header file to avoid
the compiler seeing conflicting prototypes in user code.
*/
@interface NSObject (Comparison)
- (NSComparisonResult)compare: (id)other;
@end
@implementation NSObject (EORelationalSelectors)

View file

@ -269,6 +269,18 @@ compareUsingSortOrderings(id left,
@end
/*
This declaration is needed by the compiler to state that
eventhough we know not all objects respond to -compare:,
we want the compiler to generate code for the given
prototype when calling -compare: in the following methods.
We do not put this declaration in a header file to avoid
the compiler seeing conflicting prototypes in user code.
*/
@interface NSObject (Comparison)
- (NSComparisonResult)compare: (id)other;
@end
@implementation NSObject (EOSortOrderingComparison)