diff --git a/src/Core/AI.m b/src/Core/AI.m index 35be84c66..f6b1f8ca5 100644 --- a/src/Core/AI.m +++ b/src/Core/AI.m @@ -219,7 +219,7 @@ - (void) reportStackOverflow while (count--) { OOPreservedAIStateMachine *preservedMachine = [aiStack objectAtIndex:count]; - OOLog(@"ai.error.stackOverflow.dump", @"%3llu: %@: %@", count, [preservedMachine name], [preservedMachine state]); + OOLog(@"ai.error.stackOverflow.dump", @"%3lu: %@: %@", count, [preservedMachine name], [preservedMachine state]); } OOLogOutdent(); diff --git a/src/Core/CollisionRegion.m b/src/Core/CollisionRegion.m index f9c6e2cd7..fcee70b86 100644 --- a/src/Core/CollisionRegion.m +++ b/src/Core/CollisionRegion.m @@ -98,7 +98,7 @@ - (void) dealloc - (NSString *) description { - return [NSString stringWithFormat:@"<%@ %p>{ID: %d, %llu subregions, %u ents}", [self class], self, crid, [subregions count], n_entities]; + return [NSString stringWithFormat:@"<%@ %p>{ID: %d, %zu subregions, %u ents}", [self class], self, crid, [subregions count], n_entities]; } diff --git a/src/Core/Debug/OODebugTCPConsoleClient.m b/src/Core/Debug/OODebugTCPConsoleClient.m index 8613105cc..988702195 100644 --- a/src/Core/Debug/OODebugTCPConsoleClient.m +++ b/src/Core/Debug/OODebugTCPConsoleClient.m @@ -688,7 +688,7 @@ - (void) breakConnectionWithBadStream:(NSStream *)stream if (errorDesc == nil) errorDesc = [error description]; if (errorDesc == nil) errorDesc = @"bad stream."; [self breakConnectionWithMessage:[NSString stringWithFormat: - @"Connection to debug console failed: '%@' (outStream status: %llu, inStream status: %llu).", + @"Connection to debug console failed: '%@' (outStream status: %zu, inStream status: %zu).", errorDesc, [_outStream streamStatus], [_inStream streamStatus]]]; } diff --git a/src/Core/Debug/OOTCPStreamDecoder.c b/src/Core/Debug/OOTCPStreamDecoder.c index f51255a66..68be9df93 100644 --- a/src/Core/Debug/OOTCPStreamDecoder.c +++ b/src/Core/Debug/OOTCPStreamDecoder.c @@ -175,7 +175,7 @@ void OOTCPStreamDecoderReceiveBytes(OOTCPStreamDecoderRef decoder, const void *i } else { - Error(decoder, OOALSTR("OOTCPStreamDecoder internal error: reached unreachable state. nextSize = %lu, bufferUsed = %lu, nextPacketData = %@."), (unsigned long)decoder->nextSize, (unsigned long)decoder->headerSpaceUsed, decoder->nextPacketData); + Error(decoder, OOALSTR("OOTCPStreamDecoder internal error: reached unreachable state. nextSize = %zu, bufferUsed = %zu, nextPacketData = %@."), (unsigned long)decoder->nextSize, (unsigned long)decoder->headerSpaceUsed, decoder->nextPacketData); } } } diff --git a/src/Core/Entities/Entity.m b/src/Core/Entities/Entity.m index d2bd5a766..b942cc9e1 100644 --- a/src/Core/Entities/Entity.m +++ b/src/Core/Entities/Entity.m @@ -218,7 +218,7 @@ - (BOOL) validForAddToUniverse NSUInteger currentSessionID = [UNIVERSE sessionID]; if (EXPECT_NOT(mySessionID != currentSessionID)) { - OOLogERR(@"entity.invalidSession", @"Entity %@ from session %llu cannot be added to universe in session %llu. This is an internal error, please report it.", [self shortDescription], mySessionID, currentSessionID); + OOLogERR(@"entity.invalidSession", @"Entity %@ from session %zu cannot be added to universe in session %zu. This is an internal error, please report it.", [self shortDescription], mySessionID, currentSessionID); return NO; } diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 7010cad30..7a820895e 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -1511,7 +1511,7 @@ - (BOOL)setCommanderDataFromDictionary:(NSDictionary *) dict // Do we have extra passengers? if (passengers && ([passengers count] > max_passengers)) { - OOLogWARN(@"setCommanderDataFromDictionary.inconsistency.passengers", @"player ship %@ had more passengers (%llu) than passenger berths (%u). Removing extra passengers.", [self name], [passengers count], max_passengers); + OOLogWARN(@"setCommanderDataFromDictionary.inconsistency.passengers", @"player ship %@ had more passengers (%zu) than passenger berths (%u). Removing extra passengers.", [self name], [passengers count], max_passengers); for (NSInteger i = (NSInteger)[passengers count] - 1; i >= max_passengers; i--) { [passenger_record removeObjectForKey:[[passengers oo_dictionaryAtIndex:i] oo_stringForKey:PASSENGER_KEY_NAME]]; @@ -4914,7 +4914,7 @@ - (NSString *) dial_fpsinfo - (NSString *) dial_objinfo { - NSString *result = [NSString stringWithFormat:@"Entities: %3llu", [UNIVERSE entityCount]]; + NSString *result = [NSString stringWithFormat:@"Entities: %3lu", [UNIVERSE entityCount]]; #ifndef NDEBUG result = [NSString stringWithFormat:@"%@ (%d, %zu KiB, avg %zu bytes)", result, gLiveEntityCount, gTotalEntityMemory >> 10, gTotalEntityMemory / gLiveEntityCount]; #endif @@ -10936,7 +10936,7 @@ - (void) showMarketScreenDataLine:(OOGUIRow)row forGood:(OOCommodityType)good in NSString *available = OOPadStringToEms(((available_units > 0) ? (NSString *)[NSString stringWithFormat:@"%d",available_units] : DESC(@"commodity-quantity-none")), 2.5); NSUInteger priceDecimal = pricePerUnit % 10; - NSString *price = [NSString stringWithFormat:@" %@.%llu ",OOPadStringToEms([NSString stringWithFormat:@"%lu",(unsigned long)(pricePerUnit/10)],2.5),priceDecimal]; + NSString *price = [NSString stringWithFormat:@" %@.%zu ",OOPadStringToEms([NSString stringWithFormat:@"%zu",(unsigned long)(pricePerUnit/10)],2.5),priceDecimal]; // this works with up to 9999 tons of gemstones. Any more than that, they deserve the formatting they get! :) @@ -13464,7 +13464,7 @@ - (void)dumpSelfState OOLog(@"dumpState.playerEntity", @"Missile status: %i", missile_status); OOLog(@"dumpState.playerEntity", @"Energy unit: %@", EnergyUnitTypeToString([self installedEnergyUnitType])); OOLog(@"dumpState.playerEntity", @"Fuel leak rate: %g", fuel_leak_rate); - OOLog(@"dumpState.playerEntity", @"Trumble count: %llu", trumbleCount); + OOLog(@"dumpState.playerEntity", @"Trumble count: %zu", trumbleCount); flags = [NSMutableArray array]; #define ADD_FLAG_IF_SET(x) if (x) { [flags addObject:@#x]; } diff --git a/src/Core/Entities/PlayerEntityContracts.m b/src/Core/Entities/PlayerEntityContracts.m index aa0a54a9f..a114fb817 100644 --- a/src/Core/Entities/PlayerEntityContracts.m +++ b/src/Core/Entities/PlayerEntityContracts.m @@ -1540,7 +1540,7 @@ - (void) setGuiToShipyardScreen:(NSUInteger)skip { [gui setColor:[gui colorFromSetting:kGuiShipyardScrollColor defaultValue:[OOColor greenColor]] forRow:GUI_ROW_SHIPYARD_START]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_SHIPYARD_START]; - [gui setKey:[NSString stringWithFormat:@"More:%lld", previous] forRow:GUI_ROW_SHIPYARD_START]; + [gui setKey:[NSString stringWithFormat:@"More:%ld", previous] forRow:GUI_ROW_SHIPYARD_START]; } for (i = 0; i < (shipCount - skip) && (int)i < rowCount; i++) { @@ -1558,7 +1558,7 @@ - (void) setGuiToShipyardScreen:(NSUInteger)skip { [gui setColor:[gui colorFromSetting:kGuiShipyardScrollColor defaultValue:[OOColor greenColor]] forRow:startRow + i]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:startRow + i]; - [gui setKey:[NSString stringWithFormat:@"More:%llu", rowCount + skip] forRow:startRow + i]; + [gui setKey:[NSString stringWithFormat:@"More:%zu", rowCount + skip] forRow:startRow + i]; i++; } diff --git a/src/Core/Entities/PlayerEntityControls.m b/src/Core/Entities/PlayerEntityControls.m index 951882061..61eab1309 100644 --- a/src/Core/Entities/PlayerEntityControls.m +++ b/src/Core/Entities/PlayerEntityControls.m @@ -121,8 +121,10 @@ static BOOL musicModeKeyPressed; static BOOL volumeControlPressed; static BOOL fovControlPressed; +#if OOLITE_WINDOWS static BOOL hdrMaxBrightnessControlPressed; static BOOL hdrPaperWhiteControlPressed; +#endif static BOOL colorblindModeControlPressed; static BOOL shaderSelectKeyPressed; static BOOL selectPressed; diff --git a/src/Core/Entities/PlayerEntityKeyMapper.m b/src/Core/Entities/PlayerEntityKeyMapper.m index 33b51016d..7be91b14a 100644 --- a/src/Core/Entities/PlayerEntityKeyMapper.m +++ b/src/Core/Entities/PlayerEntityKeyMapper.m @@ -873,7 +873,7 @@ - (void) displayKeyFunctionList:(GuiDisplayGen *)gui skip:(NSUInteger)skip { [gui setColor:[OOColor greenColor] forRow:GUI_ROW_KC_FUNCSTART]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_KC_FUNCSTART]; - [gui setKey:[NSString stringWithFormat:@"More:%lld", previous] forRow:GUI_ROW_KC_FUNCSTART]; + [gui setKey:[NSString stringWithFormat:@"More:%ld", previous] forRow:GUI_ROW_KC_FUNCSTART]; } for(i = 0; i < (n_functions - skip) && (int)i < n_rows; i++) @@ -940,7 +940,7 @@ - (void) displayKeyFunctionList:(GuiDisplayGen *)gui skip:(NSUInteger)skip [gui setArray:[NSArray arrayWithObjects: [entry objectForKey:KEY_KC_GUIDESC], assignment, override, nil] forRow:i + start_row]; - [gui setKey:[NSString stringWithFormat:@"Index:%llu", i + skip] forRow:i + start_row]; + [gui setKey:[NSString stringWithFormat:@"Index:%zu", i + skip] forRow:i + start_row]; if (validate) { [gui setColor:[OOColor orangeColor] forRow:i + start_row]; @@ -951,7 +951,7 @@ - (void) displayKeyFunctionList:(GuiDisplayGen *)gui skip:(NSUInteger)skip { [gui setColor:[OOColor greenColor] forRow:start_row + i]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:start_row + i]; - [gui setKey:[NSString stringWithFormat:@"More:%llu", n_rows + skip] forRow:start_row + i]; + [gui setKey:[NSString stringWithFormat:@"More:%zu", n_rows + skip] forRow:start_row + i]; i++; } @@ -1338,7 +1338,7 @@ - (void) displayKeyboardLayoutList:(GuiDisplayGen *)gui skip:(NSUInteger)skip { [gui setColor:[OOColor greenColor] forRow:GUI_ROW_KC_FUNCSTART]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_KC_FUNCSTART]; - [gui setKey:[NSString stringWithFormat:@"More:%lld", previous] forRow:GUI_ROW_KC_FUNCSTART]; + [gui setKey:[NSString stringWithFormat:@"More:%ld", previous] forRow:GUI_ROW_KC_FUNCSTART]; } NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; @@ -1351,13 +1351,13 @@ - (void) displayKeyboardLayoutList:(GuiDisplayGen *)gui skip:(NSUInteger)skip NSString *selected = @""; if ([[entry objectForKey:@"key"] isEqualToString:kbd]) selected = @"Current"; [gui setArray:[NSArray arrayWithObjects:desc, selected, nil] forRow:i + start_row]; - [gui setKey:[NSString stringWithFormat:@"Index:%llu", i + skip] forRow:i + start_row]; + [gui setKey:[NSString stringWithFormat:@"Index:%zu", i + skip] forRow:i + start_row]; } if (i < n_functions - skip) { [gui setColor:[OOColor greenColor] forRow:start_row + i]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:start_row + i]; - [gui setKey:[NSString stringWithFormat:@"More:%llu", n_rows + skip] forRow:start_row + i]; + [gui setKey:[NSString stringWithFormat:@"More:%zu", n_rows + skip] forRow:start_row + i]; i++; } diff --git a/src/Core/Entities/PlayerEntityLegacyScriptEngine.m b/src/Core/Entities/PlayerEntityLegacyScriptEngine.m index 5f0279ae4..7706b6476 100644 --- a/src/Core/Entities/PlayerEntityLegacyScriptEngine.m +++ b/src/Core/Entities/PlayerEntityLegacyScriptEngine.m @@ -1993,7 +1993,7 @@ - (void) setMissionChoicesDictionary:(NSDictionary *)choicesDict NSInteger keysCount = [choiceKeys count]; if ((end_row + 1) < [choiceKeys count]) { - OOLogERR(kOOLogException, @"in mission.runScreen choices: number of choices defined (%llu) is greater than available lines (%llu). Check HUD settings for allowBigGui.", [choiceKeys count], (end_row + 1)); + OOLogERR(kOOLogException, @"in mission.runScreen choices: number of choices defined (%zu) is greater than available lines (%zu). Check HUD settings for allowBigGui.", [choiceKeys count], (end_row + 1)); keysCount = end_row + 1; } @@ -2877,7 +2877,7 @@ - (BOOL) addEqScriptForKey:(NSString *)eq_key [eqScripts addObject:[NSArray arrayWithObjects:eq_key,s,nil]]; if (primedEquipment == [eqScripts count] - 1) primedEquipment++; // if primed-none, keep it as primed-none. - OOLog(@"player.equipmentScript", @"Scriptable equipment available: %llu.", [eqScripts count]); + OOLog(@"player.equipmentScript", @"Scriptable equipment available: %zu.", [eqScripts count]); return YES; } diff --git a/src/Core/Entities/PlayerEntityLoadSave.m b/src/Core/Entities/PlayerEntityLoadSave.m index c389326f4..18055de23 100644 --- a/src/Core/Entities/PlayerEntityLoadSave.m +++ b/src/Core/Entities/PlayerEntityLoadSave.m @@ -247,7 +247,7 @@ - (void) setGuiToScenarioScreen:(int)page scenario = [[UNIVERSE scenarios] objectAtIndex:i]; NSString *scenarioName = [NSString stringWithFormat:@" %@ ",[scenario oo_stringForKey:@"name"]]; [gui setText:OOExpand(scenarioName) forRow:row]; - [gui setKey:[NSString stringWithFormat:@"Scenario:%lu", (unsigned long)i] forRow:row]; + [gui setKey:[NSString stringWithFormat:@"Scenario:%zu", (unsigned long)i] forRow:row]; ++row; } diff --git a/src/Core/Entities/PlayerEntityStickMapper.m b/src/Core/Entities/PlayerEntityStickMapper.m index 41ec778fd..d0d0338f3 100644 --- a/src/Core/Entities/PlayerEntityStickMapper.m +++ b/src/Core/Entities/PlayerEntityStickMapper.m @@ -452,7 +452,7 @@ - (void) displayFunctionList:(GuiDisplayGen *)gui { [gui setColor:[OOColor greenColor] forRow:GUI_ROW_FUNCSTART]; [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_FUNCSTART]; - [gui setKey:[NSString stringWithFormat:@"More:%lld", previous] forRow:GUI_ROW_FUNCSTART]; + [gui setKey:[NSString stringWithFormat:@"More:%ld", previous] forRow:GUI_ROW_FUNCSTART]; } for(i=0; i < (n_functions - skip) && (int)i < n_rows; i++) @@ -519,14 +519,14 @@ - (void) displayFunctionList:(GuiDisplayGen *)gui [entry objectForKey: KEY_GUIDESC], assignment, allowedThings, nil] forRow: i + start_row]; //[gui setKey: GUI_KEY_OK forRow: i + start_row]; - [gui setKey: [NSString stringWithFormat: @"Index:%llu", i + skip] forRow: i + start_row]; + [gui setKey: [NSString stringWithFormat: @"Index:%zu", i + skip] forRow: i + start_row]; } } if (i < n_functions - skip) { [gui setColor: [OOColor greenColor] forRow: start_row + i]; [gui setArray: [NSArray arrayWithObjects: DESC(@"gui-more"), @" --> ", nil] forRow: start_row + i]; - [gui setKey: [NSString stringWithFormat: @"More:%llu", n_rows + skip] forRow: start_row + i]; + [gui setKey: [NSString stringWithFormat: @"More:%zu", n_rows + skip] forRow: start_row + i]; i++; } diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 0d4aaa7a9..cebc8dbb6 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -13710,7 +13710,7 @@ - (BOOL) acceptAsEscort:(ShipEntity *) other_ship //doesn't seem to have any adverse effect for now. - Kaks. if ([shipAI stackDepth] > 3) { - OOLog(@"ship.escort.reject", @"%@ rejecting escort %@ because AI stack depth is %llu.",self, other_ship, [shipAI stackDepth]); + OOLog(@"ship.escort.reject", @"%@ rejecting escort %@ because AI stack depth is %zu.",self, other_ship, [shipAI stackDepth]); return NO; } @@ -13753,7 +13753,7 @@ - (BOOL) acceptAsEscort:(ShipEntity *) other_ship } else { - OOLog(@"ship.escort.reject", @"%@ already got max escorts(%llu). Escort rejected: %@.", self, escortCount, other_ship); + OOLog(@"ship.escort.reject", @"%@ already got max escorts(%zu). Escort rejected: %@.", self, escortCount, other_ship); } } else @@ -14498,7 +14498,7 @@ - (void)dumpSelfState OOLog(@"dumpState.shipEntity", @"Roles: %@", [self roleSet]); OOLog(@"dumpState.shipEntity", @"Primary role: %@", primaryRole); OOLog(@"dumpState.shipEntity", @"Script: %@", script); - OOLog(@"dumpState.shipEntity", @"Subentity count: %llu", [self subEntityCount]); + OOLog(@"dumpState.shipEntity", @"Subentity count: %zu", [self subEntityCount]); OOLog(@"dumpState.shipEntity", @"Behaviour: %@", OOStringFromBehaviour(behaviour)); id target = [self primaryTarget]; if (target == nil) target = @""; diff --git a/src/Core/Entities/ShipEntityScriptMethods.m b/src/Core/Entities/ShipEntityScriptMethods.m index 5d5f49527..fe232b8a9 100644 --- a/src/Core/Entities/ShipEntityScriptMethods.m +++ b/src/Core/Entities/ShipEntityScriptMethods.m @@ -69,7 +69,7 @@ - (NSArray *) spawnShipsWithRole:(NSString *)role count:(NSUInteger)count if (count == 0) return [NSArray array]; - OOLog(kOOLogNoteAddShips, @"Spawning %llu x '%@' near %@ %d", count, role, [self shortDescription], [self universalID]); + OOLog(kOOLogNoteAddShips, @"Spawning %zu x '%@' near %@ %d", count, role, [self shortDescription], [self universalID]); result = [NSMutableArray arrayWithCapacity:count]; diff --git a/src/Core/Entities/StationEntity.m b/src/Core/Entities/StationEntity.m index 19bbe5f74..187ba71e0 100644 --- a/src/Core/Entities/StationEntity.m +++ b/src/Core/Entities/StationEntity.m @@ -2462,7 +2462,7 @@ - (void)dumpSelfState OOLog(@"dumpState.stationEntity", @"Scavengers launched: %u", scavengers_launched); OOLog(@"dumpState.stationEntity", @"Docked shuttles: %u", docked_shuttles); OOLog(@"dumpState.stationEntity", @"Docked traders: %u", docked_traders); - OOLog(@"dumpState.stationEntity", @"Equivalent tech level: %llu", equivalentTechLevel); + OOLog(@"dumpState.stationEntity", @"Equivalent tech level: %zu", equivalentTechLevel); OOLog(@"dumpState.stationEntity", @"Equipment price factor: %g", equipmentPriceFactor); flags = [NSMutableArray array]; @@ -2478,7 +2478,7 @@ - (void)dumpSelfState // Ships on hold list, only used with moving stations (= carriers) if([_shipsOnHold count] > 0) { - OOLog(@"dumpState.stationEntity", @"%llu Ships on hold (unsorted):", [_shipsOnHold count]); + OOLog(@"dumpState.stationEntity", @"%zu Ships on hold (unsorted):", [_shipsOnHold count]); OOLogIndent(); NSEnumerator *onHoldEnum = [_shipsOnHold objectEnumerator]; diff --git a/src/Core/Entities/WormholeEntity.m b/src/Core/Entities/WormholeEntity.m index af5bbc34d..097ed5821 100644 --- a/src/Core/Entities/WormholeEntity.m +++ b/src/Core/Entities/WormholeEntity.m @@ -742,9 +742,10 @@ static void DrawWormholeCorona(GLfloat inner_radius, GLfloat outer_radius, int s if (outer_radius >= z_distance) // inside the sphere return; int i; - - NSRange activity = { 0.34, 1.0 }; - + + const GLfloat activityMin = 0.34f; + const GLfloat activityLength = 1.0f; + GLfloat s0, c0, s1, c1; GLfloat r0, r1; @@ -765,7 +766,7 @@ static void DrawWormholeCorona(GLfloat inner_radius, GLfloat outer_radius, int s rv0 = randf(); rv1 = randf(); - q = activity.location + rv0 * activity.length; + q = activityMin + rv0 * activityLength; s0 = r0 * sin(theta); c0 = r0 * cos(theta); @@ -783,7 +784,7 @@ static void DrawWormholeCorona(GLfloat inner_radius, GLfloat outer_radius, int s rv0 = randf(); rv1 = randf(); - q = activity.location + rv0 * activity.length; + q = activityMin + rv0 * activityLength; s0 = 0.0f; // r0 * sin(0); c0 = r0; // r0 * cos(0); @@ -856,7 +857,7 @@ - (void)dumpSelfState OOLog(@"dumpState.wormholeEntity", @"Scanned State : %@", [self scanInfoString]); OOLog(@"dumpState.wormholeEntity", @"Mass : %.2lf", witch_mass); - OOLog(@"dumpState.wormholeEntity", @"Ships : %llu", [shipsInTransit count]); + OOLog(@"dumpState.wormholeEntity", @"Ships : %zu", [shipsInTransit count]); unsigned i; for (i = 0; i < [shipsInTransit count]; ++i) { diff --git a/src/Core/GameController.m b/src/Core/GameController.m index 5956c54ea..b1faaf4ca 100644 --- a/src/Core/GameController.m +++ b/src/Core/GameController.m @@ -160,7 +160,7 @@ - (void) setEcoQoS: (BOOL)efficiencyModeRequested if (EXPECT_NOT(!SetPriorityClass(currentProcess, setEfficiencyMode ? IDLE_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS))) { - OOLog(@"gameController.setEcoQos", @"SetPriorityClass failed with error %lu", GetLastError()); + OOLog(@"gameController.setEcoQos", @"SetPriorityClass failed with error %zu", GetLastError()); } PROCESS_POWER_THROTTLING_STATE powerThrottling; @@ -170,7 +170,7 @@ - (void) setEcoQoS: (BOOL)efficiencyModeRequested powerThrottling.StateMask = setEfficiencyMode ? PROCESS_POWER_THROTTLING_EXECUTION_SPEED : 0; if (EXPECT_NOT(!SetProcessInformation(currentProcess, ProcessPowerThrottling, &powerThrottling, sizeof(powerThrottling)))) { - OOLog(@"gameController.setEcoQos", @"SetProcessInformation failed with error %lu", GetLastError()); + OOLog(@"gameController.setEcoQos", @"SetProcessInformation failed with error %zu", GetLastError()); } } #endif diff --git a/src/Core/GuiDisplayGen.h b/src/Core/GuiDisplayGen.h index 7f0e1c65e..6111097aa 100644 --- a/src/Core/GuiDisplayGen.h +++ b/src/Core/GuiDisplayGen.h @@ -132,8 +132,8 @@ static NSString * const kGuiChartRouteShortColor = @"chart_route_short_color"; static NSString * const kGuiChartRouteQuickColor = @"chart_route_quick_color"; static NSString * const kGuiChartTraveltimeTabs = @"chart_traveltime_tabs"; -static NSString * const kGuiChartEconomyUColor = @"chart_economy_%lu_color"; -static NSString * const kGuiChartGovernmentUColor = @"chart_government_%lu_color"; +static NSString * const kGuiChartEconomyUColor = @"chart_economy_%zu_color"; +static NSString * const kGuiChartGovernmentUColor = @"chart_government_%zu_color"; static NSString * const kGuiChartTechColor = @"chart_tech_color"; // F7 static NSString * const kGuiSystemdataFactsColor = @"systemdata_facts_color"; diff --git a/src/Core/Materials/OODefaultShaderSynthesizer.m b/src/Core/Materials/OODefaultShaderSynthesizer.m index 5ad380dbe..472d7f245 100644 --- a/src/Core/Materials/OODefaultShaderSynthesizer.m +++ b/src/Core/Materials/OODefaultShaderSynthesizer.m @@ -625,7 +625,7 @@ - (NSUInteger) assignIDForTexture:(NSDictionary *)spec { texID = [_texturesByName count]; NSNumber *texIDObj = [NSNumber numberWithUnsignedInteger:texID]; - NSString *texUniform = [NSString stringWithFormat:@"uTexture%llu", texID]; + NSString *texUniform = [NSString stringWithFormat:@"uTexture%zu", texID]; #ifndef NDEBUG BOOL useInternalFormat = NO; @@ -666,7 +666,7 @@ - (void) setUpOneTexture:(NSDictionary *)textureSpec if ((NSUInteger)NSHashGet(_sampledTextures, (const void *)(texID + 1)) == 0) { NSHashInsertKnownAbsent(_sampledTextures, (const void *)(texID + 1)); - [_fragmentTextureLookups appendFormat:@"\tvec4 tex%lluSample = texture2D(uTexture%llu, texCoords); // %@\n", texID, texID, [textureSpec oo_stringForKey:kOOTextureSpecifierNameKey]]; + [_fragmentTextureLookups appendFormat:@"\tvec4 tex%zuSample = texture2D(uTexture%zu, texCoords); // %@\n", texID, texID, [textureSpec oo_stringForKey:kOOTextureSpecifierNameKey]]; } } @@ -678,7 +678,7 @@ - (void) getSampleName:(NSString **)outSampleName andSwizzleOp:(NSString **)outS [self setUpOneTexture:textureSpec]; NSUInteger texID = [self textureIDForSpec:textureSpec]; - *outSampleName = [NSString stringWithFormat:@"tex%lluSample", texID]; + *outSampleName = [NSString stringWithFormat:@"tex%zuSample", texID]; *outSwizzleOp = GetExtractMode(textureSpec); } @@ -704,7 +704,7 @@ - (NSString *) readRGBForTextureSpec:(NSDictionary *)textureSpec mapName:(NSStri return [NSString stringWithFormat:@"%@.%@", sample, swizzle]; } - OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %llu channels to extract, but only %@ may be used.", mapName, [self materialKey], [self entityName], channelCount, @"1 or 3"); + OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %zu channels to extract, but only %@ may be used.", mapName, [self materialKey], [self entityName], channelCount, @"1 or 3"); return nil; } @@ -726,7 +726,7 @@ - (NSString *) readOneChannelForTextureSpec:(NSDictionary *)textureSpec mapName: return [NSString stringWithFormat:@"%@.%@", sample, swizzle]; } - OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %llu channels to extract, but only %@ may be used.", mapName, [self materialKey], [self entityName], channelCount, @"1"); + OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %zu channels to extract, but only %@ may be used.", mapName, [self materialKey], [self entityName], channelCount, @"1"); return nil; } @@ -840,7 +840,7 @@ texture coordinates (duh). [_fragmentPreTextures appendString:@"\t// Parallax mapping\n"]; NSUInteger texID = [self assignIDForTexture:parallaxMap]; - [_fragmentPreTextures appendFormat:@"\tfloat parallax = texture2D(uTexture%llu, vTexCoords).%@;\n", texID, swizzle]; + [_fragmentPreTextures appendFormat:@"\tfloat parallax = texture2D(uTexture%zu, vTexCoords).%@;\n", texID, swizzle]; if (parallaxScale != 1.0f) { @@ -857,7 +857,7 @@ texture coordinates (duh). } else { - OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %llu channels to extract, but only %@ may be used.", @"parallax", [self materialKey], [self entityName], channelCount, @"1"); + OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %zu channels to extract, but only %@ may be used.", @"parallax", [self materialKey], [self entityName], channelCount, @"1"); } } } @@ -1010,7 +1010,7 @@ - (void) writeNormalIfNeeded } else { - OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %llu channels to extract, but only %@ may be used.", @"normal", [self materialKey], [self entityName], [swizzle length], @"3"); + OOLogWARN(@"material.synthesis.warning.extractionMismatch", @"The %@ map for material \"%@\" of \"%@\" specifies %zu channels to extract, but only %@ may be used.", @"normal", [self materialKey], [self entityName], [swizzle length], @"3"); } } _constZNormal = YES; diff --git a/src/Core/Materials/OOMultiTextureMaterial.m b/src/Core/Materials/OOMultiTextureMaterial.m index 3b79b4005..b3136cd92 100644 --- a/src/Core/Materials/OOMultiTextureMaterial.m +++ b/src/Core/Materials/OOMultiTextureMaterial.m @@ -180,7 +180,7 @@ - (void) apply [_emissionMap apply]; } - NSAssert2(textureUnit - GL_TEXTURE0_ARB == _unitsUsed, @"OOMultiTextureMaterial texture unit count invalid (expected %lu, actually using %u)", _unitsUsed, textureUnit - GL_TEXTURE0_ARB); + NSAssert2(textureUnit - GL_TEXTURE0_ARB == _unitsUsed, @"OOMultiTextureMaterial texture unit count invalid (expected %zu, actually using %u)", _unitsUsed, textureUnit - GL_TEXTURE0_ARB); if (textureUnit > GL_TEXTURE1_ARB) { diff --git a/src/Core/Materials/OOTexture.m b/src/Core/Materials/OOTexture.m index a14b1c654..9e4a70f3d 100644 --- a/src/Core/Materials/OOTexture.m +++ b/src/Core/Materials/OOTexture.m @@ -390,7 +390,7 @@ - (void) setTrace:(BOOL)trace { if (trace && !_trace) { - OOLog(@"texture.allocTrace.begin", @"Started tracing texture %p with retain count %llu.", self, [self retainCount]); + OOLog(@"texture.allocTrace.begin", @"Started tracing texture %p with retain count %zu.", self, [self retainCount]); } _trace = trace; } @@ -572,8 +572,8 @@ - (id) retainInContext:(NSString *)context { if (_trace) { - if (context) OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %llu) - %@.", self, [self retainCount] + 1, context); - else OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %llu).", self, [self retainCount] + 1); + if (context) OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %zu) - %@.", self, [self retainCount] + 1, context); + else OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %zu).", self, [self retainCount] + 1); } return [super retain]; @@ -584,8 +584,8 @@ - (void) releaseInContext:(NSString *)context { if (_trace) { - if (context) OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %llu) - %@.", self, [self retainCount] - 1, context); - else OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %llu).", self, [self retainCount] - 1); + if (context) OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %zu) - %@.", self, [self retainCount] - 1, context); + else OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %zu).", self, [self retainCount] - 1); } [super release]; diff --git a/src/Core/Materials/OOTextureLoader.m b/src/Core/Materials/OOTextureLoader.m index b4b749497..103933d3f 100644 --- a/src/Core/Materials/OOTextureLoader.m +++ b/src/Core/Materials/OOTextureLoader.m @@ -434,7 +434,7 @@ - (void)applySettings if (_isCubeMap) leaveSpaceForMipMaps = NO; #endif - OOLog(@"texture.load.rescale", @"Rescaling texture \"%@\" from %u x %u to %u x %u.", [_path lastPathComponent], pixMap.width, pixMap.height, desiredWidth, desiredHeight); + OOLog(@"texture.load.rescale", @"Rescaling texture \"%@\" from %zu x %zu to %zu x %zu.", [_path lastPathComponent], pixMap.width, pixMap.height, desiredWidth, desiredHeight); pixMap = OOScalePixMap(pixMap, desiredWidth, desiredHeight, leaveSpaceForMipMaps); if (EXPECT_NOT(!OOIsValidPixMap(pixMap))) return; diff --git a/src/Core/NSBundle+Override.m b/src/Core/NSBundle+Override.m index f2d33dbcd..e5c6e068c 100644 --- a/src/Core/NSBundle+Override.m +++ b/src/Core/NSBundle+Override.m @@ -11,6 +11,8 @@ #import #import +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" @implementation NSBundle (Override) - (NSDictionary *)infoDictionary { @@ -48,4 +50,5 @@ - (NSDictionary *)infoDictionary { return [workingDict autorelease]; } -@end \ No newline at end of file +@end +#pragma clang diagnostic pop \ No newline at end of file diff --git a/src/Core/NSUserDefaults+Override.m b/src/Core/NSUserDefaults+Override.m index 56249915f..8fa363a5b 100644 --- a/src/Core/NSUserDefaults+Override.m +++ b/src/Core/NSUserDefaults+Override.m @@ -28,6 +28,8 @@ #import #import +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" @implementation NSUserDefaults (Override) - (BOOL) writeDictionary: (NSDictionary*)dict @@ -70,3 +72,4 @@ - (BOOL) writeDictionary: (NSDictionary*)dict } @end +#pragma clang diagnostic pop \ No newline at end of file diff --git a/src/Core/OOCPUInfo.m b/src/Core/OOCPUInfo.m index 438519684..71c4502a0 100644 --- a/src/Core/OOCPUInfo.m +++ b/src/Core/OOCPUInfo.m @@ -212,7 +212,7 @@ OOMemoryStatus OOSystemMemoryStatus(void) } } - return [NSString stringWithFormat:@"%lu.%lu.%lu%s %S", + return [NSString stringWithFormat:@"%zu.%zu.%zu%s %S", osver.dwMajorVersion, osver.dwMinorVersion, osver.dwBuildNumber, outUBRString, (const WCHAR *)osver.szCSDVersion]; } diff --git a/src/Core/OOCacheManager.m b/src/Core/OOCacheManager.m index facdec4ae..c8378932c 100644 --- a/src/Core/OOCacheManager.m +++ b/src/Core/OOCacheManager.m @@ -357,7 +357,7 @@ - (void)loadCache formatVersion = [cache objectForKey:kCacheKeyFormatVersion]; if (accept && [formatVersion unsignedIntValue] != kFormatVersionValue) { - OOLog(kOOLogDataCacheRebuild, @"Data cache format (%@) is not supported format (%llu), rebuilding cache.", formatVersion, kFormatVersionValue); + OOLog(kOOLogDataCacheRebuild, @"Data cache format (%@) is not supported format (%zu), rebuilding cache.", formatVersion, kFormatVersionValue); accept = NO; } diff --git a/src/Core/OOCharacter.m b/src/Core/OOCharacter.m index e861fdcbd..6aae54894 100644 --- a/src/Core/OOCharacter.m +++ b/src/Core/OOCharacter.m @@ -46,7 +46,7 @@ @implementation OOCharacter - (NSString *) descriptionComponents { - return [NSString stringWithFormat:@"%@, %@. bounty: %i insurance: %llu", [self name], [self shortDescription], [self legalStatus], [self insuranceCredits]]; + return [NSString stringWithFormat:@"%@, %@. bounty: %i insurance: %zu", [self name], [self shortDescription], [self legalStatus], [self insuranceCredits]]; } diff --git a/src/Core/OOCocoa.m b/src/Core/OOCocoa.m index 7eec8f63b..185ec89e8 100644 --- a/src/Core/OOCocoa.m +++ b/src/Core/OOCocoa.m @@ -38,7 +38,8 @@ - (NSString *)descriptionComponents return nil; } - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" - (NSString *)description { NSString *components = nil; @@ -53,7 +54,7 @@ - (NSString *)description return [NSString stringWithFormat:@"<%@ %p>", [self class], self]; } } - +#pragma clang diagnostic pop - (NSString *) shortDescription { diff --git a/src/Core/OOConvertSystemDescriptions.m b/src/Core/OOConvertSystemDescriptions.m index 4b8fc23a3..4de377ada 100644 --- a/src/Core/OOConvertSystemDescriptions.m +++ b/src/Core/OOConvertSystemDescriptions.m @@ -284,8 +284,8 @@ void ExportSystemDescriptions(BOOL asXML) static NSString *IndexToKey(NSUInteger index, NSDictionary *indicesToKeys, BOOL useFallback) { - NSString *result = [indicesToKeys objectForKey:[NSString stringWithFormat:@"%llu", index]]; - if (result == nil && useFallback) result = [NSString stringWithFormat:@"block_%llu", index]; + NSString *result = [indicesToKeys objectForKey:[NSString stringWithFormat:@"%zu", index]]; + if (result == nil && useFallback) result = [NSString stringWithFormat:@"block_%zu", index]; return result; } diff --git a/src/Core/OODeepCopy.m b/src/Core/OODeepCopy.m index 91da86b35..d172aff83 100644 --- a/src/Core/OODeepCopy.m +++ b/src/Core/OODeepCopy.m @@ -122,7 +122,7 @@ - (id) ooDeepCopyWithSharedObjects:(NSMutableSet *)objects members = calloc(sizeof *members, count); if (members == NULL) { - [NSException raise:NSMallocException format:@"Failed to allocate space for %lu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; + [NSException raise:NSMallocException format:@"Failed to allocate space for %zu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; } // Ensure there's an objects set even if passed nil. @@ -178,7 +178,7 @@ - (id) ooDeepCopyWithSharedObjects:(NSMutableSet *)objects members = malloc(sizeof *members * count); if (members == NULL) { - [NSException raise:NSMallocException format:@"Failed to allocate space for %lu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; + [NSException raise:NSMallocException format:@"Failed to allocate space for %zu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; } // Ensure there's an objects set even if passed nil. @@ -240,7 +240,7 @@ - (id) ooDeepCopyWithSharedObjects:(NSMutableSet *)objects { free(keys); free(values); - [NSException raise:NSMallocException format:@"Failed to allocate space for %lu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; + [NSException raise:NSMallocException format:@"Failed to allocate space for %zu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; } // Ensure there's an objects set even if passed nil. diff --git a/src/Core/OOLogHeader.m b/src/Core/OOLogHeader.m index 1e19beb86..97d0011ca 100644 --- a/src/Core/OOLogHeader.m +++ b/src/Core/OOLogHeader.m @@ -211,7 +211,7 @@ void OOPrintLogHeader(void) sysModel = GetSysCtlString("hw.model"); sysPhysMem = GetSysCtlInt("hw.memsize"); - return [NSString stringWithFormat:@"Machine type: %@, %llu MiB memory, %@.", sysModel, sysPhysMem >> 20, GetCPUDescription()]; + return [NSString stringWithFormat:@"Machine type: %@, %zu MiB memory, %@.", sysModel, sysPhysMem >> 20, GetCPUDescription()]; } #ifndef CPUFAMILY_INTEL_MEROM @@ -301,13 +301,13 @@ void OOPrintLogHeader(void) typeStr = @"ARM"; } - if (typeStr == nil) typeStr = [NSString stringWithFormat:@"CPU type %llu", sysCPUType]; + if (typeStr == nil) typeStr = [NSString stringWithFormat:@"CPU type %zu", sysCPUType]; NSString *countStr = nil; - if (sysCPUCount == sysLogicalCPUCount) countStr = [NSString stringWithFormat:@"%llu", sysCPUCount]; - else countStr = [NSString stringWithFormat:@"%llu (%llu logical)", sysCPUCount, sysLogicalCPUCount]; + if (sysCPUCount == sysLogicalCPUCount) countStr = [NSString stringWithFormat:@"%zu", sysCPUCount]; + else countStr = [NSString stringWithFormat:@"%zu (%zu logical)", sysCPUCount, sysLogicalCPUCount]; - return [NSString stringWithFormat:@"%@ x %@%@ @ %llu MHz", countStr, typeStr, subTypeStr, (sysCPUFrequency + 500000) / 1000000]; + return [NSString stringWithFormat:@"%@ x %@%@ @ %zu MHz", countStr, typeStr, subTypeStr, (sysCPUFrequency + 500000) / 1000000]; } diff --git a/src/Core/OOLogging.m b/src/Core/OOLogging.m index 4d35b6932..c084d2cd2 100644 --- a/src/Core/OOLogging.m +++ b/src/Core/OOLogging.m @@ -428,11 +428,11 @@ void OOLogWithFunctionFileAndLineAndArguments(NSString *inMessageClass, const ch { if (sShowFunction) { - formattedMessage = [NSString stringWithFormat:@"%s (%@:%lu): %@", inFunction, OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; + formattedMessage = [NSString stringWithFormat:@"%s (%@:%zu): %@", inFunction, OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; } else { - formattedMessage = [NSString stringWithFormat:@"%@:%lu: %@", OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; + formattedMessage = [NSString stringWithFormat:@"%@:%zu: %@", OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; } } else diff --git a/src/Core/OOMesh.m b/src/Core/OOMesh.m index faf181547..904b439b9 100644 --- a/src/Core/OOMesh.m +++ b/src/Core/OOMesh.m @@ -441,7 +441,7 @@ - (void)renderOpaqueParts /* It should not be possible to have multiple texture units if texture combiners are not available. */ - NSAssert2([[OOOpenGLExtensionManager sharedManager] textureCombinersSupported], @"Mesh %@ uses %lu texture units, but multitexturing is not available.", [self shortDescription], _textureUnitCount); + NSAssert2([[OOOpenGLExtensionManager sharedManager] textureCombinersSupported], @"Mesh %@ uses %zu texture units, but multitexturing is not available.", [self shortDescription], _textureUnitCount); for (unit = 0; unit < _textureUnitCount; unit++) { diff --git a/src/Core/OOMeshToOctreeConverter.m b/src/Core/OOMeshToOctreeConverter.m index 6e20f962d..d9eb27b09 100644 --- a/src/Core/OOMeshToOctreeConverter.m +++ b/src/Core/OOMeshToOctreeConverter.m @@ -261,7 +261,7 @@ + (instancetype) converterWithCapacity:(NSUInteger)capacity - (NSString *) descriptionComponents { - return [NSString stringWithFormat:@"%u triangles", _data.count]; + return [NSString stringWithFormat:@"%zu triangles", _data.count]; } diff --git a/src/Core/OOOXZManager.m b/src/Core/OOOXZManager.m index 9ddf21d68..672d9c313 100644 --- a/src/Core/OOOXZManager.m +++ b/src/Core/OOOXZManager.m @@ -375,7 +375,7 @@ - (NSString *) humanSize:(NSUInteger)bytes } else if (bytes < 1024*1024) { - return [NSString stringWithFormat:@"%llu kB",bytes>>10]; + return [NSString stringWithFormat:@"%zu kB",bytes>>10]; } else { @@ -869,7 +869,7 @@ - (BOOL) processDownloadedOXZ } NSDictionary *requirement = nil; NSMutableString *progress = [NSMutableString stringWithCapacity:2048]; - OOLog(kOOOXZDebugLog,@"Dependency stack has %llu elements",[_dependencyStack count]); + OOLog(kOOOXZDebugLog,@"Dependency stack has %zu elements",[_dependencyStack count]); if ([_dependencyStack count] > 0) { @@ -972,7 +972,7 @@ - (BOOL) processDownloadedOXZ _downloadStatus = OXZ_DOWNLOAD_NONE; if (_downloadAllDependencies) { - OOLog(kOOOXZDebugLog,@"Dependency stack: installing %llu from list",index); + OOLog(kOOOXZDebugLog,@"Dependency stack: installing %zu from list",index); if (![self installOXZ:index]) { // if a required dependency is somehow uninstallable // e.g. required+maximum version don't match this Oolite @@ -1522,12 +1522,12 @@ - (void) processSelection } else if (_interfaceState == OXZ_STATE_PICK_INSTALL) { - OOLog(kOOOXZDebugLog, @"Trying to install index %lu", (unsigned long)item); + OOLog(kOOOXZDebugLog, @"Trying to install index %zu", (unsigned long)item); [self installOXZ:item]; } else if (_interfaceState == OXZ_STATE_PICK_INSTALLED) { - OOLog(kOOOXZDebugLog, @"Trying to install index %lu", (unsigned long)item); + OOLog(kOOOXZDebugLog, @"Trying to install index %zu", (unsigned long)item); [self installOXZ:item]; } @@ -1956,13 +1956,13 @@ - (BOOL) removeOXZ:(NSUInteger)item NSArray *remList = _filteredList; if ([remList count] <= item) { - OOLog(kOOOXZDebugLog, @"Unable to remove item %lu as only %lu in list", (unsigned long)item, (unsigned long)[remList count]); + OOLog(kOOOXZDebugLog, @"Unable to remove item %zu as only %zu in list", (unsigned long)item, (unsigned long)[remList count]); return NO; } NSString *filename = [[remList objectAtIndex:item] oo_stringForKey:kOOManifestFilePath]; if (filename == nil) { - OOLog(kOOOXZDebugLog, @"Unable to remove item %lu as filename not found", (unsigned long)item); + OOLog(kOOOXZDebugLog, @"Unable to remove item %zu as filename not found", (unsigned long)item); return NO; } @@ -2334,7 +2334,7 @@ - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLRespon - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { - OOLog(kOOOXZDebugLog,@"Downloaded %llu bytes",[data length]); + OOLog(kOOOXZDebugLog,@"Downloaded %zu bytes",[data length]); [_fileWriter seekToEndOfFile]; [_fileWriter writeData:data]; _downloadProgress += [data length]; diff --git a/src/Core/OOOpenGLExtensionManager.m b/src/Core/OOOpenGLExtensionManager.m index 66e2eb062..df049b900 100644 --- a/src/Core/OOOpenGLExtensionManager.m +++ b/src/Core/OOOpenGLExtensionManager.m @@ -252,7 +252,7 @@ - (void) reset [ResourceManager paths]; OOLog(@"rendering.opengl.version", @"OpenGL renderer version: %u.%u.%u (\"%s\"). Vendor: \"%@\". Renderer: \"%@\".", major, minor, release, versionString, vendor, renderer); - OOLog(@"rendering.opengl.extensions", @"OpenGL extensions (%llu):\n%@", [extensions count], [[extensions allObjects] componentsJoinedByString:@", "]); + OOLog(@"rendering.opengl.extensions", @"OpenGL extensions (%zu):\n%@", [extensions count], [[extensions allObjects] componentsJoinedByString:@", "]); if (![self versionIsAtLeastMajor:kMinMajorVersion minor:kMinMinorVersion]) { diff --git a/src/Core/OOPriorityQueue.m b/src/Core/OOPriorityQueue.m index 2d9eab753..6765c07d2 100644 --- a/src/Core/OOPriorityQueue.m +++ b/src/Core/OOPriorityQueue.m @@ -176,7 +176,7 @@ - (void) dealloc - (NSString *) description { - return [NSString stringWithFormat:@"<%@ %p>{count=%llu, capacity=%llu}", [self class], self, _count, _capacity]; + return [NSString stringWithFormat:@"<%@ %p>{count=%zu, capacity=%zu}", [self class], self, _count, _capacity]; } @@ -186,7 +186,7 @@ - (NSString *) debugDescription NSMutableString *result = nil; result = [NSMutableString string]; - [result appendFormat:@"<%@ %p> (count=%lu, capacity=%lu, comparator=%@)", [self class], self, _count, _capacity, NSStringFromSelector(_comparator)]; + [result appendFormat:@"<%@ %p> (count=%zu, capacity=%zu, comparator=%@)", [self class], self, _count, _capacity, NSStringFromSelector(_comparator)]; if (_count != 0) { @@ -671,14 +671,14 @@ - (NSString *) generateGraphViz desc = [[desc substringToIndex:64] stringByAppendingString:@"..."]; } - [result appendFormat:@"\tnode_%llu [label=\" | %@ | \"];\n", i, EscapedString(desc)]; + [result appendFormat:@"\tnode_%zu [label=\" | %@ | \"];\n", i, EscapedString(desc)]; } // Arcs for (i = 0; PQLeftChild(i) < _count; ++i) { - [result appendFormat:@"\tnode_%llu:f0 -> node_%llu:f1;\n", i, PQLeftChild(i)]; - if (PQRightChild(i) < _count) [result appendFormat:@"\tnode_%llu:f2 -> node_%llu:f1;\n", i, PQRightChild(i)]; + [result appendFormat:@"\tnode_%zu:f0 -> node_%zu:f1;\n", i, PQLeftChild(i)]; + if (PQRightChild(i) < _count) [result appendFormat:@"\tnode_%zu:f2 -> node_%zu:f1;\n", i, PQRightChild(i)]; } [result appendString:@"}\n"]; diff --git a/src/Core/OOProbabilitySet.m b/src/Core/OOProbabilitySet.m index 161450c98..cafb7d2f4 100644 --- a/src/Core/OOProbabilitySet.m +++ b/src/Core/OOProbabilitySet.m @@ -242,7 +242,7 @@ - (id) initPriv - (NSString *) descriptionComponents { - return [NSString stringWithFormat:@"count=%llu", [self count]]; + return [NSString stringWithFormat:@"count=%zu", [self count]]; } @@ -904,7 +904,7 @@ - (id) randomObject if (sum >= target) return [_objects objectAtIndex:i]; } - OOLog(@"probabilitySet.broken", @"%s fell off end, returning first object. Nominal sum = %f, target = %f, actual sum = %f, count = %llu. %@", __PRETTY_FUNCTION__, sumOfWeights, target, sum, count,@"This is an internal error, please report it."); + OOLog(@"probabilitySet.broken", @"%s fell off end, returning first object. Nominal sum = %f, target = %f, actual sum = %f, count = %zu. %@", __PRETTY_FUNCTION__, sumOfWeights, target, sum, count,@"This is an internal error, please report it."); return [_objects objectAtIndex:0]; } diff --git a/src/Core/OOShipGroup.m b/src/Core/OOShipGroup.m index e44d0828b..8a4dbe56b 100644 --- a/src/Core/OOShipGroup.m +++ b/src/Core/OOShipGroup.m @@ -133,7 +133,7 @@ - (void) dealloc - (NSString *) descriptionComponents { - NSString *desc = [NSString stringWithFormat:@"%llu ships", (unsigned long long)_count]; + NSString *desc = [NSString stringWithFormat:@"%zu ships", _count]; if ([self name] != nil) { desc = [NSString stringWithFormat:@"\"%@\", %@", [self name], desc]; diff --git a/src/Core/OOShipRegistry.m b/src/Core/OOShipRegistry.m index fb7c271ea..d68e0a288 100644 --- a/src/Core/OOShipRegistry.m +++ b/src/Core/OOShipRegistry.m @@ -1319,12 +1319,12 @@ - (NSDictionary *) translateOldStyleSubentityDeclaration:(NSString *)declaration { if (!isFlasher) { - OOLogERR(@"shipData.load.error.badSubentity", @"the shipdata.plist entry \"%@\" has a broken subentity definition \"%@\" (should have 8 tokens, has %llu).", shipKey, subentityKey, [tokens count]); + OOLogERR(@"shipData.load.error.badSubentity", @"the shipdata.plist entry \"%@\" has a broken subentity definition \"%@\" (should have 8 tokens, has %zu).", shipKey, subentityKey, [tokens count]); *outFatalError = YES; } else { - OOLogWARN(@"shipData.load.warning.badFlasher", @"the shipdata.plist entry \"%@\" has a broken flasher definition (should have 8 tokens, has %llu). This flasher will be ignored.", shipKey, [tokens count]); + OOLogWARN(@"shipData.load.warning.badFlasher", @"the shipdata.plist entry \"%@\" has a broken flasher definition (should have 8 tokens, has %zu). This flasher will be ignored.", shipKey, [tokens count]); } return nil; } diff --git a/src/Core/OOSystemDescriptionManager.m b/src/Core/OOSystemDescriptionManager.m index edc4b3470..227bdb52c 100644 --- a/src/Core/OOSystemDescriptionManager.m +++ b/src/Core/OOSystemDescriptionManager.m @@ -323,7 +323,7 @@ - (NSDictionary *) getPropertiesForCurrentSystem NSUInteger index = ([PLAYER galaxyNumber] * OO_SYSTEMS_PER_GALAXY) + s; if (index >= OO_SYSTEM_CACHE_LENGTH) { - OOLog(@"system.description.error",@"'%llu' is an invalid system index for the current system. This is an internal error. Please report it.",index); + OOLog(@"system.description.error",@"'%zu' is an invalid system index for the current system. This is an internal error. Please report it.",index); return [NSDictionary dictionary]; } return propertyCache[index]; @@ -533,7 +533,7 @@ - (NSDictionary *) calculatePropertiesForSystemKey:(NSString *)key - (void) updateCacheEntry:(NSUInteger)i { NSAssert(i < OO_SYSTEM_CACHE_LENGTH,@"Invalid cache entry number"); - NSString *key = [NSString stringWithFormat:@"%llu %llu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY]; + NSString *key = [NSString stringWithFormat:@"%zu %zu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY]; NSDictionary *current = [self calculatePropertiesForSystemKey:key]; [propertyCache[i] removeAllObjects]; @@ -544,7 +544,7 @@ - (void) updateCacheEntry:(NSUInteger)i - (void) updateCacheEntry:(NSUInteger)i forProperty:(NSString *)property { NSAssert(i < OO_SYSTEM_CACHE_LENGTH,@"Invalid cache entry number"); - NSString *key = [NSString stringWithFormat:@"%llu %llu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY]; + NSString *key = [NSString stringWithFormat:@"%zu %zu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY]; id current = [self getProperty:property forSystemKey:key]; if (current == nil) { @@ -604,7 +604,7 @@ - (Random_Seed) getRandomSeedForCurrentSystem NSUInteger index = ([PLAYER galaxyNumber] * OO_SYSTEMS_PER_GALAXY) + s; if (index >= OO_SYSTEM_CACHE_LENGTH) { - OOLog(@"system.description.error",@"'%lu' is an invalid system index for the current system. This is an internal error. Please report it.",(unsigned long)index); + OOLog(@"system.description.error",@"'%zu' is an invalid system index for the current system. This is an internal error. Please report it.",(unsigned long)index); return kNilRandomSeed; } return RandomSeedFromString([propertyCache[index] oo_stringForKey:@"random_seed"]); diff --git a/src/Core/OOTextureScaling.m b/src/Core/OOTextureScaling.m index fda6bb38d..bf85b0fe6 100644 --- a/src/Core/OOTextureScaling.m +++ b/src/Core/OOTextureScaling.m @@ -344,7 +344,7 @@ BOOL OOGenerateMipMaps(void *textureBytes, OOPixMapDimension width, OOPixMapDime { if (EXPECT_NOT(width != OORoundUpToPowerOf2_PixMap(width) || height != OORoundUpToPowerOf2_PixMap(height))) { - OOLog(kOOLogParameterError, @"Non-power-of-two dimensions (%ux%u) passed to %s() - ignoring, data will be junk.", width, height, __PRETTY_FUNCTION__); + OOLog(kOOLogParameterError, @"Non-power-of-two dimensions (%zux%zu) passed to %s() - ignoring, data will be junk.", width, height, __PRETTY_FUNCTION__); return NO; } if (EXPECT_NOT(textureBytes == NULL)) diff --git a/src/Core/OXPVerifier/OOAIStateMachineVerifierStage.m b/src/Core/OXPVerifier/OOAIStateMachineVerifierStage.m index f5069701a..94e3e7891 100644 --- a/src/Core/OXPVerifier/OOAIStateMachineVerifierStage.m +++ b/src/Core/OXPVerifier/OOAIStateMachineVerifierStage.m @@ -177,7 +177,7 @@ - (void) validateAI:(NSString *)aiName index++; if (![action isKindOfClass:[NSString class]]) { - OOLog(@"verifyOXP.validateAI.failed.invalidFormat.action", @"***** ERROR: action %llu in handler \"%@\" for state \"%@\" in AI \"%@\" is not a string, ignoring.", index - 1, handlerKey, stateKey, aiName); + OOLog(@"verifyOXP.validateAI.failed.invalidFormat.action", @"***** ERROR: action %zu in handler \"%@\" for state \"%@\" in AI \"%@\" is not a string, ignoring.", index - 1, handlerKey, stateKey, aiName); continue; } @@ -201,7 +201,7 @@ - (void) validateAI:(NSString *)aiName if ([badSelectors count] != 0) { badSelectorDesc = [[[badSelectors allObjects] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] componentsJoinedByString:@", "]; - OOLog(@"verifyOXP.validateAI.failed.badSelector", @"***** ERROR: the AI \"%@\" uses %llu unpermitted method%s: %@", aiName, [badSelectors count], ([badSelectors count] == 1) ? "" : "s", badSelectorDesc); + OOLog(@"verifyOXP.validateAI.failed.badSelector", @"***** ERROR: the AI \"%@\" uses %zu unpermitted method%s: %@", aiName, [badSelectors count], ([badSelectors count] == 1) ? "" : "s", badSelectorDesc); } OOLogOutdentIf(@"verifyOXP.verbose.validateAI"); diff --git a/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m b/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m index e2d867967..a7ae76d90 100644 --- a/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m +++ b/src/Core/OXPVerifier/OOCheckEquipmentPListVerifierStage.m @@ -122,12 +122,12 @@ - (void)runCheckWithEquipment:(NSArray *)equipmentPList // Check that the entry has an acceptable number of elements. if (elemCount < 5) { - OOLog(@"verifyOXP.equipmentPList.badEntrySize", @"***** ERROR: equipment.plist entry %@ has too few elements (%llu, should be 5 or 6).", entryDesc, elemCount); + OOLog(@"verifyOXP.equipmentPList.badEntrySize", @"***** ERROR: equipment.plist entry %@ has too few elements (%zu, should be 5 or 6).", entryDesc, elemCount); continue; } if (6 < elemCount) { - OOLog(@"verifyOXP.equipmentPList.badEntrySize", @"----- WARNING: equipment.plist entry %@ has too many elements (%llu, should be 5 or 6).", entryDesc, elemCount); + OOLog(@"verifyOXP.equipmentPList.badEntrySize", @"----- WARNING: equipment.plist entry %@ has too many elements (%zu, should be 5 or 6).", entryDesc, elemCount); } /* Check element types. The numbers are required to be unsigned diff --git a/src/Core/OXPVerifier/OOPListSchemaVerifier.m b/src/Core/OXPVerifier/OOPListSchemaVerifier.m index 41c876228..5a0b75ebb 100644 --- a/src/Core/OXPVerifier/OOPListSchemaVerifier.m +++ b/src/Core/OXPVerifier/OOPListSchemaVerifier.m @@ -1120,13 +1120,13 @@ static BOOL ApplyStringTest(NSString *string, id test, SEL testSelector, NSStrin constraint = [params oo_unsignedLongLongForKey:@"minimum" defaultValue:0]; if (numericValue < constraint) { - return Error(kPListErrorMinimumConstraintNotMet, &keyPath, @"Number is too small (%llu, minimum is %llu).", numericValue, constraint); + return Error(kPListErrorMinimumConstraintNotMet, &keyPath, @"Number is too small (%zu, minimum is %zu).", numericValue, constraint); } constraint = [params oo_unsignedLongLongForKey:@"maximum" defaultValue:ULLONG_MAX]; if (constraint < numericValue) { - return Error(kPListErrorMaximumConstraintNotMet, &keyPath, @"Number is too large (%llu, maximum is %llu).", numericValue, constraint); + return Error(kPListErrorMaximumConstraintNotMet, &keyPath, @"Number is too large (%zu, maximum is %zu).", numericValue, constraint); } return nil; diff --git a/src/Core/OXPVerifier/OOTextureVerifierStage.m b/src/Core/OXPVerifier/OOTextureVerifierStage.m index 36fd530e6..9b8bf0026 100644 --- a/src/Core/OXPVerifier/OOTextureVerifierStage.m +++ b/src/Core/OXPVerifier/OOTextureVerifierStage.m @@ -168,11 +168,11 @@ - (void)checkTextureNamed:(NSString *)name inFolder:(NSString *)folder rHeight = OORoundUpToPowerOf2_PixMap((2 * pixmap.height) / 3); if (pixmap.width != rWidth || pixmap.height != rHeight) { - OOLog(@"verifyOXP.texture.notPOT", @"----- WARNING: image %@ has non-power-of-two dimensions; it will have to be rescaled (from %ux%u pixels to %ux%u pixels) at runtime.", displayName, pixmap.width, pixmap.height, rWidth, rHeight); + OOLog(@"verifyOXP.texture.notPOT", @"----- WARNING: image %@ has non-power-of-two dimensions; it will have to be rescaled (from %zux%zu pixels to %zux%zu pixels) at runtime.", displayName, pixmap.width, pixmap.height, rWidth, rHeight); } else { - OOLog(@"verifyOXP.verbose.texture.OK", @"- %@ (%ux%u px) OK.", displayName, pixmap.width, pixmap.height); + OOLog(@"verifyOXP.verbose.texture.OK", @"- %@ (%zux%zu px) OK.", displayName, pixmap.width, pixmap.height); } OOFreePixMap(&pixmap); diff --git a/src/Core/OldSchoolPropertyListWriting.m b/src/Core/OldSchoolPropertyListWriting.m index fb3b6484e..41814b9c9 100644 --- a/src/Core/OldSchoolPropertyListWriting.m +++ b/src/Core/OldSchoolPropertyListWriting.m @@ -146,7 +146,7 @@ - (NSString *)oldSchoolPListFormatWithIndentation:(unsigned)inIndentation errorD { if (NULL != outErrorDescription) { - *outErrorDescription = [NSString stringWithFormat:@"failed to allocate space (%llu bytes) for conversion of NSData to old-school property list representation", dstLength]; + *outErrorDescription = [NSString stringWithFormat:@"failed to allocate space (%zu bytes) for conversion of NSData to old-school property list representation", dstLength]; } return nil; } diff --git a/src/Core/ResourceManager.m b/src/Core/ResourceManager.m index eebd1e33f..2b47a085a 100644 --- a/src/Core/ResourceManager.m +++ b/src/Core/ResourceManager.m @@ -2151,7 +2151,7 @@ + (NSDictionary *)loadScripts } displayString = [[displayNames sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] componentsJoinedByString:@"\n "]; - OOLog(@"script.load.world.listAll", @"Loaded %llu world scripts:\n %@", count, displayString); + OOLog(@"script.load.world.listAll", @"Loaded %zu world scripts:\n %@", count, displayString); } else { diff --git a/src/Core/Scripting/OOJSEngineTimeManagement.m b/src/Core/Scripting/OOJSEngineTimeManagement.m index 4f617f1c4..18054e5a7 100644 --- a/src/Core/Scripting/OOJSEngineTimeManagement.m +++ b/src/Core/Scripting/OOJSEngineTimeManagement.m @@ -34,6 +34,9 @@ of this software and associated documentation files (the "Software"), to deal #if OOLITE_LINUX // Workaround for clang/glibc incompatibility. +#ifdef __block +#undef __block +#endif #define __block __glibc_block #endif #include @@ -873,7 +876,7 @@ - (NSString *) description } else { - return [NSString stringWithFormat:@"%@: %lu times, total %g ms, avg %g ms, max %g ms", _function, _hitCount, totalTimeSum, totalTimeSum / _hitCount, totalTimeMax]; + return [NSString stringWithFormat:@"%@: %zu times, total %g ms, avg %g ms, max %g ms", _function, _hitCount, totalTimeSum, totalTimeSum / _hitCount, totalTimeMax]; } } else @@ -884,7 +887,7 @@ - (NSString *) description } else { - return [NSString stringWithFormat:@"%@: %lu times, total %g ms (self %g ms), avg %g ms (self %g ms), max %g ms, max self %g ms", _function, _hitCount, totalTimeSum, selfTimeSum, totalTimeSum / _hitCount, selfTimeSum / _hitCount, totalTimeMax, selfTimeMax]; + return [NSString stringWithFormat:@"%@: %zu times, total %g ms (self %g ms), avg %g ms (self %g ms), max %g ms, max self %g ms", _function, _hitCount, totalTimeSum, selfTimeSum, totalTimeSum / _hitCount, selfTimeSum / _hitCount, totalTimeMax, selfTimeMax]; } } } diff --git a/src/Core/Scripting/OOJSFrameCallbacks.m b/src/Core/Scripting/OOJSFrameCallbacks.m index effe2f46e..88f45f454 100644 --- a/src/Core/Scripting/OOJSFrameCallbacks.m +++ b/src/Core/Scripting/OOJSFrameCallbacks.m @@ -452,7 +452,7 @@ static void RunDeferredOperations(JSContext *context) { NSDictionary *operation = nil; - FCBLog(@"script.frameCallback.debug.run-deferred", @"Running %lu deferred frame callback operations.", (long)[sDeferredOps count]); + FCBLog(@"script.frameCallback.debug.run-deferred", @"Running %zu deferred frame callback operations.", (long)[sDeferredOps count]); FCBLogIndentIf(@"script.frameCallback.debug.run-deferred"); foreach (operation, sDeferredOps) diff --git a/src/Core/Scripting/OOJSQuaternion.m b/src/Core/Scripting/OOJSQuaternion.m index a6508d706..6b3c7aa89 100644 --- a/src/Core/Scripting/OOJSQuaternion.m +++ b/src/Core/Scripting/OOJSQuaternion.m @@ -221,13 +221,13 @@ - (NSString *) reportJSQuaternionStatistics double convFac = 100.0 / sum; return [NSString stringWithFormat: - @"quaternion-to-quaternion conversions: %lu (%g %%)\n" - " entity-to-quaternion conversions: %lu (%g %%)\n" - " array-to-quaternion conversions: %lu (%g %%)\n" - " prototype-to-zero conversions: %lu (%g %%)\n" - " null conversions: %lu (%g %%)\n" - " failed conversions: %lu (%g %%)\n" - " total: %lu", + @"quaternion-to-quaternion conversions: %zu (%g %%)\n" + " entity-to-quaternion conversions: %zu (%g %%)\n" + " array-to-quaternion conversions: %zu (%g %%)\n" + " prototype-to-zero conversions: %zu (%g %%)\n" + " null conversions: %zu (%g %%)\n" + " failed conversions: %zu (%g %%)\n" + " total: %zu", (long)stats->quatCount, stats->quatCount * convFac, (long)stats->entityCount, stats->entityCount * convFac, (long)stats->arrayCount, stats->arrayCount * convFac, diff --git a/src/Core/Scripting/OOJSVector.m b/src/Core/Scripting/OOJSVector.m index ad432ebc2..199dd351d 100644 --- a/src/Core/Scripting/OOJSVector.m +++ b/src/Core/Scripting/OOJSVector.m @@ -294,13 +294,13 @@ - (NSString *) reportJSVectorStatistics if (sum == 0) convFac = 0; return [NSString stringWithFormat: - @" vector-to-vector conversions: %lu (%g %%)\n" - " entity-to-vector conversions: %lu (%g %%)\n" - " array-to-vector conversions: %lu (%g %%)\n" - "prototype-to-zero conversions: %lu (%g %%)\n" - " null conversions: %lu (%g %%)\n" - " failed conversions: %lu (%g %%)\n" - " total: %lu", + @" vector-to-vector conversions: %zu (%g %%)\n" + " entity-to-vector conversions: %zu (%g %%)\n" + " array-to-vector conversions: %zu (%g %%)\n" + "prototype-to-zero conversions: %zu (%g %%)\n" + " null conversions: %zu (%g %%)\n" + " failed conversions: %zu (%g %%)\n" + " total: %zu", (long)stats->vectorCount, stats->vectorCount * convFac, (long)stats->entityCount, stats->entityCount * convFac, (long)stats->arrayCount, stats->arrayCount * convFac, diff --git a/src/Core/Scripting/OOJavaScriptEngine.m b/src/Core/Scripting/OOJavaScriptEngine.m index 7cc5a5221..434c9c17c 100644 --- a/src/Core/Scripting/OOJavaScriptEngine.m +++ b/src/Core/Scripting/OOJavaScriptEngine.m @@ -911,7 +911,7 @@ static void GetLocationNameAndLine(JSContext *context, JSStackFrame *stackFrame, NSString *shortFileName = [fileNameObj lastPathComponent]; if (![[shortFileName lowercaseString] isEqualToString:@"script.js"]) fileNameObj = shortFileName; - return [NSString stringWithFormat:@"%@:%llu", fileNameObj, lineNo]; + return [NSString stringWithFormat:@"%@:%zu", fileNameObj, lineNo]; } diff --git a/src/Core/Scripting/OOLegacyScriptWhitelist.m b/src/Core/Scripting/OOLegacyScriptWhitelist.m index 88e5a835c..d261251af 100644 --- a/src/Core/Scripting/OOLegacyScriptWhitelist.m +++ b/src/Core/Scripting/OOLegacyScriptWhitelist.m @@ -537,7 +537,7 @@ static BOOL IsAlwaysFalseConditions(NSArray *conditions) if (base == nil) base = [NSMutableString string]; NSString *string = topOfStack->key; - if (string == nil) string = [NSString stringWithFormat:@"%lu", (unsigned long)topOfStack->index]; + if (string == nil) string = [NSString stringWithFormat:@"%zu", (unsigned long)topOfStack->index]; if ([base length] > 0) [base appendString:@"."]; [base appendString:string]; diff --git a/src/Core/Universe.m b/src/Core/Universe.m index bd8ecc0ce..a0dc822ef 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -983,7 +983,7 @@ - (void) debugDumpEntities if (!OOLogWillDisplayMessagesInClass(@"universe.objectDump")) return; - OOLog(@"universe.objectDump", @"DEBUG: Entity Dump - [entities count] = %llu,\tn_entities = %u", [entities count], n_entities); + OOLog(@"universe.objectDump", @"DEBUG: Entity Dump - [entities count] = %zu,\tn_entities = %u", [entities count], n_entities); OOLogIndent(); for (i = 0; i < show_count; i++) @@ -3973,7 +3973,7 @@ - (NSString *) randomShipKeyForRoleRespectingConditions:(NSString *)role ++profSlowPath; if ((profSlowPath % 10) == 0) // Only print every tenth slow path, to reduce spamminess. { - OOLog(@"shipRegistry.selection.profile", @"Hit slow path in ship selection for role \"%@\", having selected ship \"%@\". Now %lu of %lu on slow path (%f%%).", role, shipKey, profSlowPath, profTotal, ((double)profSlowPath)/((double)profTotal) * 100.0f); + OOLog(@"shipRegistry.selection.profile", @"Hit slow path in ship selection for role \"%@\", having selected ship \"%@\". Now %zu of %zu on slow path (%f%%).", role, shipKey, profSlowPath, profTotal, ((double)profSlowPath)/((double)profTotal) * 100.0f); } #endif @@ -4342,7 +4342,7 @@ - (NSArray *) getContainersOfGoods:(OOCargoQuantity)how_many scarce:(BOOL)scarce } else { - OOLog(@"universe.createContainer.failed", @"***** ERROR: failed to find a container to fill with %@ (%llu).", [goodsKeys oo_stringAtIndex:co_type], co_type); + OOLog(@"universe.createContainer.failed", @"***** ERROR: failed to find a container to fill with %@ (%zu).", [goodsKeys oo_stringAtIndex:co_type], co_type); } } @@ -10430,7 +10430,7 @@ - (void) verifyEntitySessionIDs entity = sortedEntities[i]; if ([entity sessionID] != _sessionID) { - OOLogERR(@"universe.sessionIDs.verify.failed", @"Invalid entity %@ (came from session %llu, current session is %llu).", [entity shortDescription], [entity sessionID], _sessionID); + OOLogERR(@"universe.sessionIDs.verify.failed", @"Invalid entity %@ (came from session %zu, current session is %zu).", [entity shortDescription], [entity sessionID], _sessionID); if (badEntities == nil) badEntities = [NSMutableArray array]; [badEntities addObject:entity]; } @@ -10881,14 +10881,14 @@ - (void) dumpSystemDescriptionGraphViz for (j = 0; j < subCount; ++j) { label = OOStringifySystemDescriptionLine([curses oo_stringAtIndex:j], keyMap, NO); - [graphViz appendFormat:@"\t\tthargoid_curse_%llu [label=\"%@\"]\n", j, EscapedGraphVizString(label)]; + [graphViz appendFormat:@"\t\tthargoid_curse_%zu [label=\"%@\"]\n", j, EscapedGraphVizString(label)]; } [graphViz appendString:@"\t}\n"]; for (j = 0; j < subCount; ++j) { [self addNumericRefsInString:[curses oo_stringAtIndex:j] toGraphViz:graphViz - fromNode:[NSString stringWithFormat:@"thargoid_curse_%llu", j] + fromNode:[NSString stringWithFormat:@"thargoid_curse_%zu", j] nodeCount:count]; } [graphViz appendString:@"\t\n"]; @@ -10898,18 +10898,18 @@ - (void) dumpSystemDescriptionGraphViz for (i = 0; i < count; ++i) { // Build label, using sysdesc_key_table.plist if available - label = [keyMap objectForKey:[NSString stringWithFormat:@"%llu", i]]; - if (label == nil) label = [NSString stringWithFormat:@"[%llu]", i]; - else label = [NSString stringWithFormat:@"[%llu] (%@)", i, label]; + label = [keyMap objectForKey:[NSString stringWithFormat:@"%zu", i]]; + if (label == nil) label = [NSString stringWithFormat:@"[%zu]", i]; + else label = [NSString stringWithFormat:@"[%zu] (%@)", i, label]; - [graphViz appendFormat:@"\tsubgraph cluster_%llu\n\t{\n\t\tlabel=\"%@\"\n", i, EscapedGraphVizString(label)]; + [graphViz appendFormat:@"\tsubgraph cluster_%zu\n\t{\n\t\tlabel=\"%@\"\n", i, EscapedGraphVizString(label)]; thisDesc = [systemDescriptions oo_arrayAtIndex:i]; subCount = [thisDesc count]; for (j = 0; j < subCount; ++j) { label = OOStringifySystemDescriptionLine([thisDesc oo_stringAtIndex:j], keyMap, NO); - [graphViz appendFormat:@"\t\tn%llu_%llu [label=\"\\\"%@\\\"\"]\n", i, j, EscapedGraphVizString(label)]; + [graphViz appendFormat:@"\t\tn%zu_%zu [label=\"\\\"%@\\\"\"]\n", i, j, EscapedGraphVizString(label)]; } [graphViz appendString:@"\t}\n"]; @@ -10926,7 +10926,7 @@ - (void) dumpSystemDescriptionGraphViz descLine = [thisDesc oo_stringAtIndex:j]; [self addNumericRefsInString:descLine toGraphViz:graphViz - fromNode:[NSString stringWithFormat:@"n%llu_%llu", i, j] + fromNode:[NSString stringWithFormat:@"n%zu_%zu", i, j] nodeCount:count]; } }