Have functions for determining sort order return NSComparisonResult, not int.
Remove the corresponding Debian-specific patch, which only partially addressed git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2168 127b21dd-08f5-0310-b4b7-95ae10353056master
parent
43cf6cfb58
commit
05120ef44c
|
@ -1,23 +0,0 @@
|
|||
Index: src/Core/Scripting/OOJSSystem.m
|
||||
===================================================================
|
||||
--- src/Core/Scripting/OOJSSystem.m (revision 1827)
|
||||
+++ src/Core/Scripting/OOJSSystem.m (working copy)
|
||||
@@ -50,7 +50,7 @@
|
||||
static BOOL GetRelativeToAndRange(JSContext *context, uintN *ioArgc, jsval **ioArgv, Entity **outRelativeTo, double *outRange) NONNULL_FUNC;
|
||||
static NSArray *FindJSVisibleEntities(EntityFilterPredicate predicate, void *parameter, Entity *relativeTo, double range);
|
||||
static NSArray *FindShips(EntityFilterPredicate predicate, void *parameter, Entity *relativeTo, double range);
|
||||
-static OOInteger CompareEntitiesByDistance(id a, id b, void *relativeTo);
|
||||
+static NSComparisonResult CompareEntitiesByDistance(id a, id b, void *relativeTo);
|
||||
|
||||
|
||||
static JSBool SystemGetProperty(JSContext *context, JSObject *this, jsval name, jsval *outValue);
|
||||
@@ -1001,7 +1001,7 @@
|
||||
}
|
||||
|
||||
|
||||
-static OOInteger CompareEntitiesByDistance(id a, id b, void *relativeTo)
|
||||
+static NSComparisonResult CompareEntitiesByDistance(id a, id b, void *relativeTo)
|
||||
{
|
||||
Entity *ea = a,
|
||||
*eb = b,
|
||||
|
|
@ -349,7 +349,7 @@ static GameController *sSharedController = nil;
|
|||
|
||||
|
||||
#if OOLITE_MAC_OS_X && !OOLITE_SDL
|
||||
static OOInteger CompareDisplayModes(id arg1, id arg2, void *context)
|
||||
static NSComparisonResult CompareDisplayModes(id arg1, id arg2, void *context)
|
||||
{
|
||||
// TODO: If fullscreen mode is practical in GNUstep
|
||||
NSDictionary *mode1 = (NSDictionary *)arg1;
|
||||
|
@ -361,11 +361,17 @@ static OOInteger CompareDisplayModes(id arg1, id arg2, void *context)
|
|||
[[mode1 objectForKey:kOODisplayHeight] intValue];
|
||||
size2 = [[mode2 objectForKey:kOODisplayWidth] intValue] *
|
||||
[[mode2 objectForKey:kOODisplayHeight] intValue];
|
||||
if (size1 != size2) return size1 - size2;
|
||||
|
||||
// Then on refresh rate
|
||||
return (int)[[mode1 objectForKey:kOODisplayRefreshRate] intValue] -
|
||||
(int)[[mode2 objectForKey:kOODisplayRefreshRate] intValue];
|
||||
if (size1 == size2)
|
||||
{
|
||||
size1 = (int)[[mode1 objectForKey:kOODisplayRefreshRate] intValue];
|
||||
size2 = (int)[[mode2 objectForKey:kOODisplayRefreshRate] intValue];
|
||||
}
|
||||
|
||||
return (size1 < size2) ? NSOrderedAscending
|
||||
: (size1 > size2) ? NSOrderedDescending
|
||||
: NSOrderedSame;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ static JSObject *sSystemPrototype;
|
|||
static BOOL GetRelativeToAndRange(JSContext *context, uintN *ioArgc, jsval **ioArgv, Entity **outRelativeTo, double *outRange) NONNULL_FUNC;
|
||||
static NSArray *FindJSVisibleEntities(EntityFilterPredicate predicate, void *parameter, Entity *relativeTo, double range);
|
||||
static NSArray *FindShips(EntityFilterPredicate predicate, void *parameter, Entity *relativeTo, double range);
|
||||
static OOInteger CompareEntitiesByDistance(id a, id b, void *relativeTo);
|
||||
static NSComparisonResult CompareEntitiesByDistance(id a, id b, void *relativeTo);
|
||||
|
||||
|
||||
static JSBool SystemGetProperty(JSContext *context, JSObject *this, jsval name, jsval *outValue);
|
||||
|
@ -999,7 +999,7 @@ static NSArray *FindShips(EntityFilterPredicate predicate, void *parameter, Enti
|
|||
}
|
||||
|
||||
|
||||
static OOInteger CompareEntitiesByDistance(id a, id b, void *relativeTo)
|
||||
static NSComparisonResult CompareEntitiesByDistance(id a, id b, void *relativeTo)
|
||||
{
|
||||
Entity *ea = a,
|
||||
*eb = b,
|
||||
|
|
Loading…
Reference in New Issue