Fixed various problems caused by Clang's stricter type checking.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4715 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
5921ace94f
commit
d4856bf895
@ -76,7 +76,7 @@ static OODebugMonitor *sSingleton = nil;
|
||||
- (id)init
|
||||
{
|
||||
NSUserDefaults *defaults = nil;
|
||||
NSDictionary *config = nil;
|
||||
NSMutableDictionary *config = nil;
|
||||
#if OOLITE_GNUSTEP
|
||||
NSString *NSApplicationWillTerminateNotification = @"ApplicationWillTerminate";
|
||||
#endif
|
||||
@ -90,8 +90,7 @@ static OODebugMonitor *sSingleton = nil;
|
||||
_configFromOXPs = [[self normalizeConfigDictionary:config] copy];
|
||||
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
config = [defaults dictionaryForKey:@"debug-settings-override"];
|
||||
config = [self normalizeConfigDictionary:config];
|
||||
config = [self normalizeConfigDictionary:[defaults dictionaryForKey:@"debug-settings-override"]];
|
||||
if (config == nil) config = [NSMutableDictionary dictionary];
|
||||
_configOverrides = [config retain];
|
||||
|
||||
|
@ -36,6 +36,7 @@ SOFTWARE.
|
||||
#import "OOFunctionAttributes.h"
|
||||
#import "OOLogging.h"
|
||||
#include <stdint.h>
|
||||
#import "NSDictionaryOOExtensions.h"
|
||||
|
||||
#if OOLITE_WINDOWS
|
||||
#include <winsock2.h>
|
||||
@ -396,22 +397,20 @@ noteChangedConfigrationValue:(in id)newValue
|
||||
- (void) sendPacket:(NSString *)packetType
|
||||
withParameters:(NSDictionary *)parameters
|
||||
{
|
||||
NSMutableDictionary *dict = nil;
|
||||
NSDictionary *dict = nil;
|
||||
|
||||
if (packetType == nil) return;
|
||||
|
||||
if (parameters != nil)
|
||||
{
|
||||
dict = [parameters mutableCopy];
|
||||
[dict setObject:packetType forKey:kOOTCPPacketType];
|
||||
dict = [parameters dictionaryByAddingObject:packetType forKey:kOOTCPPacketType];
|
||||
}
|
||||
else
|
||||
{
|
||||
dict = [[NSDictionary alloc] initWithObjectsAndKeys:packetType, kOOTCPPacketType, nil];
|
||||
dict = [NSDictionary dictionaryWithObjectsAndKeys:packetType, kOOTCPPacketType, nil];
|
||||
}
|
||||
|
||||
[self sendDictionary:dict];
|
||||
[dict release];
|
||||
}
|
||||
|
||||
|
||||
|
@ -4316,7 +4316,7 @@ static bool minShieldLevelPercentageInitialised = false;
|
||||
|
||||
- (ProxyPlayerEntity *) createDoppelganger
|
||||
{
|
||||
ProxyPlayerEntity *result = [[UNIVERSE newShipWithName:[self shipDataKey] usePlayerProxy:YES] autorelease];
|
||||
ProxyPlayerEntity *result = (ProxyPlayerEntity *)[[UNIVERSE newShipWithName:[self shipDataKey] usePlayerProxy:YES] autorelease];
|
||||
|
||||
if (result != nil)
|
||||
{
|
||||
|
@ -1575,7 +1575,7 @@ static NSMutableDictionary* currentShipyard = nil;
|
||||
}
|
||||
|
||||
|
||||
- (OOInteger) missingSubEntitiesAdjustment;
|
||||
- (OOInteger) missingSubEntitiesAdjustment
|
||||
{
|
||||
// each missing subentity depreciates the ship by 5%, up to a maximum of 35% depreciation.
|
||||
int percent = 5 * ([self maxShipSubEntities] - [[[self shipSubEntityEnumerator] allObjects] count]);
|
||||
|
@ -2246,7 +2246,7 @@ MA 02110-1301, USA.
|
||||
int wh_count = 0;
|
||||
for (i = 0; i < ent_count; i++)
|
||||
if (uni_entities[i]->isWormhole)
|
||||
wormholes[wh_count++] = [uni_entities[i] retain]; // retained
|
||||
wormholes[wh_count++] = [(WormholeEntity *)uni_entities[i] retain];
|
||||
//
|
||||
//double found_d2 = scannerRange * scannerRange;
|
||||
for (i = 0; i < wh_count ; i++)
|
||||
@ -2258,7 +2258,7 @@ MA 02110-1301, USA.
|
||||
whole = wh;
|
||||
found_d2 = d2;
|
||||
}
|
||||
[wh release]; // released
|
||||
[wh release];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ static void RemovePreference(NSString *key)
|
||||
}
|
||||
|
||||
|
||||
- (void) debugLogProgress:(NSString *)format arguments:(va_list)arguments;
|
||||
- (void) debugLogProgress:(NSString *)format arguments:(va_list)arguments
|
||||
{
|
||||
NSString *message = [[[NSString alloc] initWithFormat:format arguments:arguments] autorelease];
|
||||
[self logProgress:message];
|
||||
@ -1103,7 +1103,7 @@ static void RemovePreference(NSString *key)
|
||||
|
||||
static NSMutableArray *sMessageStack;
|
||||
|
||||
- (void) debugPushProgressMessage:(NSString *)format, ...;
|
||||
- (void) debugPushProgressMessage:(NSString *)format, ...
|
||||
{
|
||||
if ([self debugMessageTrackingIsOn])
|
||||
{
|
||||
|
@ -639,7 +639,7 @@ static BOOL _refreshStarChart = NO;
|
||||
}
|
||||
|
||||
|
||||
- (NSArray *) getLastLines; // text, colour, fade time - text, colour, fade time
|
||||
- (NSArray *) getLastLines // text, colour, fade time - text, colour, fade time
|
||||
{
|
||||
if (n_rows <1) return nil;
|
||||
|
||||
|
@ -94,14 +94,15 @@ enum
|
||||
#define kOOTextureDefaultLODBias -0.25
|
||||
|
||||
|
||||
typedef enum
|
||||
enum
|
||||
{
|
||||
kOOTextureDataInvalid = kOOPixMapInvalidFormat,
|
||||
|
||||
kOOTextureDataRGBA = kOOPixMapRGBA, // GL_RGBA
|
||||
kOOTextureDataGrayscale = kOOPixMapGrayscale, // GL_LUMINANCE (or GL_ALPHA with kOOTextureAlphaMask)
|
||||
kOOTextureDataGrayscaleAlpha = kOOPixMapGrayscaleAlpha // GL_LUMINANCE_ALPHA
|
||||
} OOTextureDataFormat;
|
||||
};
|
||||
typedef OOPixMapFormat OOTextureDataFormat;
|
||||
|
||||
|
||||
@interface OOTexture: OOWeakRefObject
|
||||
|
@ -568,7 +568,7 @@ static NSString *sGlobalTraceContext = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
[self releaseInContext:sGlobalTraceContext];
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ static void InitAsyncWorkManager(void)
|
||||
}
|
||||
|
||||
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{}
|
||||
|
||||
|
||||
|
@ -74,12 +74,6 @@ This code is hereby placed in the public domain.
|
||||
}
|
||||
|
||||
|
||||
- (void) release
|
||||
{
|
||||
[super release];
|
||||
}
|
||||
|
||||
|
||||
// *** Proxy evilness beyond this point.
|
||||
|
||||
- (Class) class
|
||||
|
@ -147,16 +147,16 @@ BOOL OOJSCallObjCObjectMethod(JSContext *context, id object, NSString *oo_jsClas
|
||||
case kMethodTypeIntVoid:
|
||||
case kMethodTypeUnsignedIntVoid:
|
||||
case kMethodTypeLongVoid:
|
||||
result = [NSNumber numberWithLongLong:OOCallIntegerMethod(object, selector, method, type)];
|
||||
result = [NSNumber numberWithLongLong:OOCallIntegerMethod(object, selector, method, (OOShaderUniformType)type)];
|
||||
break;
|
||||
|
||||
case kMethodTypeUnsignedLongVoid:
|
||||
result = [NSNumber numberWithUnsignedLongLong:OOCallIntegerMethod(object, selector, method, type)];
|
||||
result = [NSNumber numberWithUnsignedLongLong:OOCallIntegerMethod(object, selector, method, (OOShaderUniformType)type)];
|
||||
break;
|
||||
|
||||
case kMethodTypeFloatVoid:
|
||||
case kMethodTypeDoubleVoid:
|
||||
result = [NSNumber numberWithDouble:OOCallFloatMethod(object, selector, method, type)];
|
||||
result = [NSNumber numberWithDouble:OOCallFloatMethod(object, selector, method, (OOShaderUniformType)type)];
|
||||
break;
|
||||
|
||||
case kMethodTypeVectorVoid:
|
||||
@ -220,7 +220,7 @@ static BOOL SignatureMatch(NSMethodSignature *sig, SEL selector)
|
||||
static MethodType GetMethodType(id object, SEL selector)
|
||||
{
|
||||
NSMethodSignature *sig = [object methodSignatureForSelector:selector];
|
||||
MethodType type = OOShaderUniformTypeFromMethodSignature(sig);
|
||||
MethodType type = (MethodType)OOShaderUniformTypeFromMethodSignature(sig);
|
||||
if (type != kMethodTypeInvalid) return type;
|
||||
|
||||
if (SignatureMatch(sig, @selector(voidVoidMethod))) return kMethodTypeVoidVoid;
|
||||
|
@ -4205,7 +4205,7 @@ static BOOL MaintainLinkedLists(Universe *uni)
|
||||
Entity* ent = sortedEntities[i];
|
||||
if (ent != srcEntity && ent != parent && [ent isShip] && [ent canCollide])
|
||||
{
|
||||
my_entities[ship_count++] = [ent retain];
|
||||
my_entities[ship_count++] = [(ShipEntity *)ent retain];
|
||||
}
|
||||
}
|
||||
|
||||
@ -8105,7 +8105,7 @@ static OOComparisonResult comparePrice(id dict1, id dict2, void * context)
|
||||
{
|
||||
if (sortedEntities[i]->isShip)
|
||||
{
|
||||
my_ships[ship_count++] = [sortedEntities[i] retain]; // retained
|
||||
my_ships[ship_count++] = [(ShipEntity *)sortedEntities[i] retain]; // retained
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user