From 4d271297fa03b2efeef84377fea0eef726b0850d Mon Sep 17 00:00:00 2001 From: mcarans Date: Mon, 31 Aug 2026 17:33:35 +1200 Subject: [PATCH 1/5] Fix many warnings --- src/Core/AI.m | 2 +- src/Core/CollisionRegion.m | 2 +- src/Core/Debug/OODebugTCPConsoleClient.m | 2 +- src/Core/Entities/Entity.m | 2 +- src/Core/Entities/PlayerEntity.m | 8 +++---- src/Core/Entities/PlayerEntityContracts.m | 4 ++-- src/Core/Entities/PlayerEntityKeyMapper.m | 12 +++++----- .../Entities/PlayerEntityLegacyScriptEngine.m | 4 ++-- src/Core/Entities/PlayerEntityStickMapper.m | 6 ++--- src/Core/Entities/ShipEntity.m | 6 ++--- src/Core/Entities/ShipEntityScriptMethods.m | 2 +- src/Core/Entities/StationEntity.m | 4 ++-- src/Core/Entities/WormholeEntity.m | 2 +- .../Materials/OODefaultShaderSynthesizer.m | 16 +++++++------- src/Core/Materials/OOTexture.m | 10 ++++----- src/Core/Materials/OOTextureLoader.m | 2 +- src/Core/OOCacheManager.m | 2 +- src/Core/OOCharacter.m | 2 +- src/Core/OOConvertSystemDescriptions.m | 4 ++-- src/Core/OOLogHeader.m | 10 ++++----- src/Core/OOMeshToOctreeConverter.m | 2 +- src/Core/OOOXZManager.m | 8 +++---- src/Core/OOOpenGLExtensionManager.m | 2 +- src/Core/OOPriorityQueue.m | 8 +++---- src/Core/OOProbabilitySet.m | 4 ++-- src/Core/OOShipGroup.m | 2 +- src/Core/OOShipRegistry.m | 4 ++-- src/Core/OOSystemDescriptionManager.m | 6 ++--- src/Core/OOTextureScaling.m | 2 +- .../OOAIStateMachineVerifierStage.m | 4 ++-- .../OOCheckEquipmentPListVerifierStage.m | 4 ++-- src/Core/OXPVerifier/OOPListSchemaVerifier.m | 4 ++-- src/Core/OXPVerifier/OOTextureVerifierStage.m | 4 ++-- src/Core/OldSchoolPropertyListWriting.m | 2 +- src/Core/ResourceManager.m | 2 +- src/Core/Scripting/OOJavaScriptEngine.m | 2 +- src/Core/Universe.m | 22 +++++++++---------- 37 files changed, 92 insertions(+), 92 deletions(-) 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..45fb1ab67 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, %lu 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..4f83c3628 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: %lu, inStream status: %lu).", errorDesc, [_outStream streamStatus], [_inStream streamStatus]]]; } diff --git a/src/Core/Entities/Entity.m b/src/Core/Entities/Entity.m index d2bd5a766..800e1b040 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 %lu cannot be added to universe in session %lu. 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..366f6063b 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 (%lu) 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:@" %@.%lu ",OOPadStringToEms([NSString stringWithFormat:@"%lu",(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: %lu", 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..d6081b527 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:%lu", rowCount + skip] forRow:startRow + i]; i++; } diff --git a/src/Core/Entities/PlayerEntityKeyMapper.m b/src/Core/Entities/PlayerEntityKeyMapper.m index 33b51016d..5f03b9e3a 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:%lu", 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:%lu", 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:%lu", 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:%lu", n_rows + skip] forRow:start_row + i]; i++; } diff --git a/src/Core/Entities/PlayerEntityLegacyScriptEngine.m b/src/Core/Entities/PlayerEntityLegacyScriptEngine.m index 5f0279ae4..44bd42dae 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 (%lu) is greater than available lines (%lu). 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: %lu.", [eqScripts count]); return YES; } diff --git a/src/Core/Entities/PlayerEntityStickMapper.m b/src/Core/Entities/PlayerEntityStickMapper.m index 41ec778fd..4cf553321 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:%lu", 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:%lu", n_rows + skip] forRow: start_row + i]; i++; } diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 0d4aaa7a9..1ec66d664 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 %lu.",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(%lu). 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: %lu", [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..11a55fc18 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 %lu 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..da33152a1 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: %lu", 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", @"%lu 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..5492c3e66 100644 --- a/src/Core/Entities/WormholeEntity.m +++ b/src/Core/Entities/WormholeEntity.m @@ -856,7 +856,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 : %lu", [shipsInTransit count]); unsigned i; for (i = 0; i < [shipsInTransit count]; ++i) { diff --git a/src/Core/Materials/OODefaultShaderSynthesizer.m b/src/Core/Materials/OODefaultShaderSynthesizer.m index 5ad380dbe..bae5836d0 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%lu", 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%luSample = texture2D(uTexture%lu, 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%luSample", 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 %lu 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 %lu 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%lu, 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 %lu 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 %lu channels to extract, but only %@ may be used.", @"normal", [self materialKey], [self entityName], [swizzle length], @"3"); } } _constZNormal = YES; diff --git a/src/Core/Materials/OOTexture.m b/src/Core/Materials/OOTexture.m index a14b1c654..db114ff4b 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 %lu.", 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 -> %lu) - %@.", self, [self retainCount] + 1, context); + else OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %lu).", 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 -> %lu) - %@.", self, [self retainCount] - 1, context); + else OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %lu).", self, [self retainCount] - 1); } [super release]; diff --git a/src/Core/Materials/OOTextureLoader.m b/src/Core/Materials/OOTextureLoader.m index b4b749497..3d9b77275 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 %lu x %lu to %lu x %lu.", [_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/OOCacheManager.m b/src/Core/OOCacheManager.m index facdec4ae..30ad9fa6f 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 (%lu), rebuilding cache.", formatVersion, kFormatVersionValue); accept = NO; } diff --git a/src/Core/OOCharacter.m b/src/Core/OOCharacter.m index e861fdcbd..5ba0eaa5f 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: %lu", [self name], [self shortDescription], [self legalStatus], [self insuranceCredits]]; } diff --git a/src/Core/OOConvertSystemDescriptions.m b/src/Core/OOConvertSystemDescriptions.m index 4b8fc23a3..60d00ad86 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:@"%lu", index]]; + if (result == nil && useFallback) result = [NSString stringWithFormat:@"block_%lu", index]; return result; } diff --git a/src/Core/OOLogHeader.m b/src/Core/OOLogHeader.m index 1e19beb86..861aea600 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: %@, %lu 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 %lu", 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:@"%lu", sysCPUCount]; + else countStr = [NSString stringWithFormat:@"%lu (%lu logical)", sysCPUCount, sysLogicalCPUCount]; - return [NSString stringWithFormat:@"%@ x %@%@ @ %llu MHz", countStr, typeStr, subTypeStr, (sysCPUFrequency + 500000) / 1000000]; + return [NSString stringWithFormat:@"%@ x %@%@ @ %lu MHz", countStr, typeStr, subTypeStr, (sysCPUFrequency + 500000) / 1000000]; } diff --git a/src/Core/OOMeshToOctreeConverter.m b/src/Core/OOMeshToOctreeConverter.m index 6e20f962d..ced1215b1 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:@"%lu triangles", _data.count]; } diff --git a/src/Core/OOOXZManager.m b/src/Core/OOOXZManager.m index 9ddf21d68..6e3bf272b 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:@"%lu 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 %lu 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 %lu from list",index); if (![self installOXZ:index]) { // if a required dependency is somehow uninstallable // e.g. required+maximum version don't match this Oolite @@ -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 %lu 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..8e67c4d76 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 (%lu):\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..048c62faf 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=%lu, capacity=%lu}", [self class], self, _count, _capacity]; } @@ -671,14 +671,14 @@ - (NSString *) generateGraphViz desc = [[desc substringToIndex:64] stringByAppendingString:@"..."]; } - [result appendFormat:@"\tnode_%llu [label=\" | %@ | \"];\n", i, EscapedString(desc)]; + [result appendFormat:@"\tnode_%lu [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_%lu:f0 -> node_%lu:f1;\n", i, PQLeftChild(i)]; + if (PQRightChild(i) < _count) [result appendFormat:@"\tnode_%lu:f2 -> node_%lu:f1;\n", i, PQRightChild(i)]; } [result appendString:@"}\n"]; diff --git a/src/Core/OOProbabilitySet.m b/src/Core/OOProbabilitySet.m index 161450c98..72e1fa5b5 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=%lu", [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 = %lu. %@", __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..1fd38b084 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:@"%lu 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..b662c75b2 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 %lu).", 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 %lu). This flasher will be ignored.", shipKey, [tokens count]); } return nil; } diff --git a/src/Core/OOSystemDescriptionManager.m b/src/Core/OOSystemDescriptionManager.m index edc4b3470..3968acbf2 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",@"'%lu' 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:@"%lu %lu",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:@"%lu %lu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY]; id current = [self getProperty:property forSystemKey:key]; if (current == nil) { diff --git a/src/Core/OOTextureScaling.m b/src/Core/OOTextureScaling.m index fda6bb38d..1099155e2 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 (%lux%lu) 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..68cad5c51 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 %lu 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 %lu 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..e9ad829f4 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 (%lu, 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 (%lu, 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..91ae92c6a 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 (%lu, minimum is %lu).", 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 (%lu, maximum is %lu).", numericValue, constraint); } return nil; diff --git a/src/Core/OXPVerifier/OOTextureVerifierStage.m b/src/Core/OXPVerifier/OOTextureVerifierStage.m index 36fd530e6..85e7ca9ca 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 %lux%lu pixels to %lux%lu 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", @"- %@ (%lux%lu px) OK.", displayName, pixmap.width, pixmap.height); } OOFreePixMap(&pixmap); diff --git a/src/Core/OldSchoolPropertyListWriting.m b/src/Core/OldSchoolPropertyListWriting.m index fb3b6484e..408c1e500 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 (%lu 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..e3a109f78 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 %lu world scripts:\n %@", count, displayString); } else { diff --git a/src/Core/Scripting/OOJavaScriptEngine.m b/src/Core/Scripting/OOJavaScriptEngine.m index 7cc5a5221..9f96a0b6e 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:@"%@:%lu", fileNameObj, lineNo]; } diff --git a/src/Core/Universe.m b/src/Core/Universe.m index bd8ecc0ce..6750b6aaa 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] = %lu,\tn_entities = %u", [entities count], n_entities); OOLogIndent(); for (i = 0; i < show_count; i++) @@ -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 %@ (%lu).", [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 %lu, current session is %lu).", [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_%lu [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_%lu", 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:@"%lu", i]]; + if (label == nil) label = [NSString stringWithFormat:@"[%lu]", i]; + else label = [NSString stringWithFormat:@"[%lu] (%@)", i, label]; - [graphViz appendFormat:@"\tsubgraph cluster_%llu\n\t{\n\t\tlabel=\"%@\"\n", i, EscapedGraphVizString(label)]; + [graphViz appendFormat:@"\tsubgraph cluster_%lu\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%lu_%lu [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%lu_%lu", i, j] nodeCount:count]; } } From f7fe72ac3893c8c4abcc0027c9afc07835f03aec Mon Sep 17 00:00:00 2001 From: mcarans Date: Mon, 31 Aug 2026 17:52:00 +1200 Subject: [PATCH 2/5] Fix remaining warnings wormhole warning was actually a bug --- src/Core/Entities/PlayerEntityControls.m | 2 ++ src/Core/Entities/WormholeEntity.m | 11 ++++++----- src/Core/NSBundle+Override.m | 5 ++++- src/Core/NSUserDefaults+Override.m | 3 +++ src/Core/OOCocoa.m | 5 +++-- src/Core/Scripting/OOJSEngineTimeManagement.m | 3 +++ 6 files changed, 21 insertions(+), 8 deletions(-) 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/WormholeEntity.m b/src/Core/Entities/WormholeEntity.m index 5492c3e66..ba4eae99e 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); 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/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/Scripting/OOJSEngineTimeManagement.m b/src/Core/Scripting/OOJSEngineTimeManagement.m index 4f617f1c4..b20ea02c9 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 From 6dbe050b5fe2e43136debd267a0a54c311f26c79 Mon Sep 17 00:00:00 2001 From: mcarans Date: Tue, 1 Sep 2026 16:09:47 +1200 Subject: [PATCH 3/5] This seems to produce no warning on Linux --- src/Core/CollisionRegion.m | 2 +- src/Core/Debug/OODebugTCPConsoleClient.m | 2 +- src/Core/Debug/OOTCPStreamDecoder.c | 2 +- src/Core/Entities/Entity.m | 2 +- src/Core/Entities/PlayerEntity.m | 6 ++--- src/Core/Entities/PlayerEntityContracts.m | 2 +- src/Core/Entities/PlayerEntityKeyMapper.m | 8 +++---- .../Entities/PlayerEntityLegacyScriptEngine.m | 4 ++-- src/Core/Entities/PlayerEntityLoadSave.m | 2 +- src/Core/Entities/PlayerEntityStickMapper.m | 4 ++-- src/Core/Entities/ShipEntity.m | 6 ++--- src/Core/Entities/ShipEntityScriptMethods.m | 2 +- src/Core/Entities/StationEntity.m | 4 ++-- src/Core/Entities/WormholeEntity.m | 2 +- src/Core/GameController.m | 4 ++-- src/Core/GuiDisplayGen.h | 4 ++-- .../Materials/OODefaultShaderSynthesizer.m | 16 ++++++------- src/Core/Materials/OOMultiTextureMaterial.m | 2 +- src/Core/Materials/OOTexture.m | 10 ++++---- src/Core/Materials/OOTextureLoader.m | 2 +- src/Core/OOCPUInfo.m | 2 +- src/Core/OOCacheManager.m | 2 +- src/Core/OOCharacter.m | 2 +- src/Core/OOConvertSystemDescriptions.m | 4 ++-- src/Core/OODeepCopy.m | 6 ++--- src/Core/OOLogHeader.m | 10 ++++---- src/Core/OOLogging.m | 4 ++-- src/Core/OOMesh.m | 2 +- src/Core/OOMeshToOctreeConverter.m | 2 +- src/Core/OOOXZManager.m | 16 ++++++------- src/Core/OOOpenGLExtensionManager.m | 2 +- src/Core/OOPriorityQueue.m | 10 ++++---- src/Core/OOProbabilitySet.m | 4 ++-- src/Core/OOShipGroup.m | 2 +- src/Core/OOShipRegistry.m | 4 ++-- src/Core/OOSystemDescriptionManager.m | 8 +++---- src/Core/OOTextureScaling.m | 2 +- .../OOAIStateMachineVerifierStage.m | 4 ++-- .../OOCheckEquipmentPListVerifierStage.m | 4 ++-- src/Core/OXPVerifier/OOPListSchemaVerifier.m | 4 ++-- src/Core/OXPVerifier/OOTextureVerifierStage.m | 4 ++-- src/Core/OldSchoolPropertyListWriting.m | 2 +- src/Core/ResourceManager.m | 2 +- src/Core/Scripting/OOJSEngineTimeManagement.m | 4 ++-- src/Core/Scripting/OOJSFrameCallbacks.m | 2 +- src/Core/Scripting/OOJSQuaternion.m | 14 +++++------ src/Core/Scripting/OOJSVector.m | 14 +++++------ src/Core/Scripting/OOJavaScriptEngine.m | 2 +- src/Core/Scripting/OOLegacyScriptWhitelist.m | 2 +- src/Core/Universe.m | 24 +++++++++---------- 50 files changed, 125 insertions(+), 125 deletions(-) diff --git a/src/Core/CollisionRegion.m b/src/Core/CollisionRegion.m index 45fb1ab67..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, %lu 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 4f83c3628..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: %lu, inStream status: %lu).", + @"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 800e1b040..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 %lu cannot be added to universe in session %lu. 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 366f6063b..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 (%lu) 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]]; @@ -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:@" %@.%lu ",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: %lu", 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 d6081b527..a114fb817 100644 --- a/src/Core/Entities/PlayerEntityContracts.m +++ b/src/Core/Entities/PlayerEntityContracts.m @@ -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:%lu", rowCount + skip] forRow:startRow + i]; + [gui setKey:[NSString stringWithFormat:@"More:%zu", rowCount + skip] forRow:startRow + i]; i++; } diff --git a/src/Core/Entities/PlayerEntityKeyMapper.m b/src/Core/Entities/PlayerEntityKeyMapper.m index 5f03b9e3a..7be91b14a 100644 --- a/src/Core/Entities/PlayerEntityKeyMapper.m +++ b/src/Core/Entities/PlayerEntityKeyMapper.m @@ -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:%lu", 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:%lu", n_rows + skip] forRow:start_row + i]; + [gui setKey:[NSString stringWithFormat:@"More:%zu", n_rows + skip] forRow:start_row + i]; i++; } @@ -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:%lu", 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:%lu", 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 44bd42dae..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 (%lu) is greater than available lines (%lu). 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: %lu.", [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 4cf553321..d0d0338f3 100644 --- a/src/Core/Entities/PlayerEntityStickMapper.m +++ b/src/Core/Entities/PlayerEntityStickMapper.m @@ -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:%lu", 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:%lu", 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 1ec66d664..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 %lu.",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(%lu). 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: %lu", [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 11a55fc18..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 %lu 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 da33152a1..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: %lu", 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", @"%lu 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 ba4eae99e..097ed5821 100644 --- a/src/Core/Entities/WormholeEntity.m +++ b/src/Core/Entities/WormholeEntity.m @@ -857,7 +857,7 @@ - (void)dumpSelfState OOLog(@"dumpState.wormholeEntity", @"Scanned State : %@", [self scanInfoString]); OOLog(@"dumpState.wormholeEntity", @"Mass : %.2lf", witch_mass); - OOLog(@"dumpState.wormholeEntity", @"Ships : %lu", [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 bae5836d0..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%lu", 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%luSample = texture2D(uTexture%lu, 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%luSample", 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 %lu 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 %lu 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%lu, 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 %lu 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 %lu 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 db114ff4b..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 %lu.", 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 -> %lu) - %@.", self, [self retainCount] + 1, context); - else OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %lu).", 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 -> %lu) - %@.", self, [self retainCount] - 1, context); - else OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %lu).", 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 3d9b77275..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 %lu x %lu to %lu x %lu.", [_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/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 30ad9fa6f..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 (%lu), 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 5ba0eaa5f..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: %lu", [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/OOConvertSystemDescriptions.m b/src/Core/OOConvertSystemDescriptions.m index 60d00ad86..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:@"%lu", index]]; - if (result == nil && useFallback) result = [NSString stringWithFormat:@"block_%lu", 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 861aea600..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: %@, %lu 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 %lu", sysCPUType]; + if (typeStr == nil) typeStr = [NSString stringWithFormat:@"CPU type %zu", sysCPUType]; NSString *countStr = nil; - if (sysCPUCount == sysLogicalCPUCount) countStr = [NSString stringWithFormat:@"%lu", sysCPUCount]; - else countStr = [NSString stringWithFormat:@"%lu (%lu logical)", sysCPUCount, sysLogicalCPUCount]; + if (sysCPUCount == sysLogicalCPUCount) countStr = [NSString stringWithFormat:@"%zu", sysCPUCount]; + else countStr = [NSString stringWithFormat:@"%zu (%zu logical)", sysCPUCount, sysLogicalCPUCount]; - return [NSString stringWithFormat:@"%@ x %@%@ @ %lu 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 ced1215b1..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:@"%lu triangles", _data.count]; + return [NSString stringWithFormat:@"%zu triangles", _data.count]; } diff --git a/src/Core/OOOXZManager.m b/src/Core/OOOXZManager.m index 6e3bf272b..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:@"%lu 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 %lu 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 %lu 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 %lu 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 8e67c4d76..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 (%lu):\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 048c62faf..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=%lu, capacity=%lu}", [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_%lu [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_%lu:f0 -> node_%lu:f1;\n", i, PQLeftChild(i)]; - if (PQRightChild(i) < _count) [result appendFormat:@"\tnode_%lu:f2 -> node_%lu: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 72e1fa5b5..cafb7d2f4 100644 --- a/src/Core/OOProbabilitySet.m +++ b/src/Core/OOProbabilitySet.m @@ -242,7 +242,7 @@ - (id) initPriv - (NSString *) descriptionComponents { - return [NSString stringWithFormat:@"count=%lu", [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 = %lu. %@", __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 1fd38b084..8a4dbe56b 100644 --- a/src/Core/OOShipGroup.m +++ b/src/Core/OOShipGroup.m @@ -133,7 +133,7 @@ - (void) dealloc - (NSString *) descriptionComponents { - NSString *desc = [NSString stringWithFormat:@"%lu ships", _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 b662c75b2..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 %lu).", 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 %lu). 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 3968acbf2..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",@"'%lu' 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:@"%lu %lu",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:@"%lu %lu",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 1099155e2..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 (%lux%lu) 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 68cad5c51..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 %lu 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 %lu 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 e9ad829f4..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 (%lu, 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 (%lu, 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 91ae92c6a..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 (%lu, minimum is %lu).", 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 (%lu, maximum is %lu).", 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 85e7ca9ca..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 %lux%lu pixels to %lux%lu 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", @"- %@ (%lux%lu 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 408c1e500..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 (%lu 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 e3a109f78..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 %lu 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 b20ea02c9..18054e5a7 100644 --- a/src/Core/Scripting/OOJSEngineTimeManagement.m +++ b/src/Core/Scripting/OOJSEngineTimeManagement.m @@ -876,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 @@ -887,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 9f96a0b6e..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:@"%@:%lu", 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 6750b6aaa..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] = %lu,\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 %@ (%lu).", [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 %lu, current session is %lu).", [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_%lu [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_%lu", 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:@"%lu", i]]; - if (label == nil) label = [NSString stringWithFormat:@"[%lu]", i]; - else label = [NSString stringWithFormat:@"[%lu] (%@)", 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_%lu\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%lu_%lu [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%lu_%lu", i, j] + fromNode:[NSString stringWithFormat:@"n%zu_%zu", i, j] nodeCount:count]; } } From 0bfc8aef8c2a012c4e8f10098b216ab79e840198 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 1 Sep 2026 16:42:41 +1200 Subject: [PATCH 4/5] Fix Windows warnings - let's hope this doesn't mess up Linux lol --- src/Core/AI.m | 2 +- src/Core/Entities/PlayerEntity.m | 4 ++-- src/Core/Entities/PlayerEntityContracts.m | 2 +- src/Core/Entities/PlayerEntityKeyMapper.m | 4 ++-- src/Core/Entities/PlayerEntityLoadSave.m | 2 +- src/Core/Entities/PlayerEntityStickMapper.m | 2 +- src/Core/GameController.m | 4 ++-- src/Core/GuiDisplayGen.m | 4 ++-- src/Core/HeadUpDisplay.m | 4 ++-- src/Core/Materials/OOTextureLoader.m | 2 +- src/Core/OOCPUInfo.m | 2 +- src/Core/OODeepCopy.m | 6 +++--- src/Core/OOLogging.m | 4 ++-- src/Core/OOMeshToOctreeConverter.m | 2 +- src/Core/OOOXZManager.m | 8 ++++---- src/Core/OOSystemDescriptionManager.m | 2 +- src/Core/OOTextureScaling.m | 2 +- src/Core/OXPVerifier/OOTextureVerifierStage.m | 4 ++-- src/Core/Scripting/OOJSEngineTimeManagement.m | 4 ++-- src/Core/Scripting/OOLegacyScriptWhitelist.m | 2 +- 20 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/Core/AI.m b/src/Core/AI.m index f6b1f8ca5..a19809304 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", @"%3lu: %@: %@", count, [preservedMachine name], [preservedMachine state]); + OOLog(@"ai.error.stackOverflow.dump", @"%3zu: %@: %@", count, [preservedMachine name], [preservedMachine state]); } OOLogOutdent(); diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 7a820895e..d30ad72b1 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -4914,7 +4914,7 @@ - (NSString *) dial_fpsinfo - (NSString *) dial_objinfo { - NSString *result = [NSString stringWithFormat:@"Entities: %3lu", [UNIVERSE entityCount]]; + NSString *result = [NSString stringWithFormat:@"Entities: %3zu", [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:@" %@.%zu ",OOPadStringToEms([NSString stringWithFormat:@"%zu",(unsigned long)(pricePerUnit/10)],2.5),priceDecimal]; + NSString *price = [NSString stringWithFormat:@" %@.%zu ",OOPadStringToEms([NSString stringWithFormat:@"%zu",(pricePerUnit/10)],2.5),priceDecimal]; // this works with up to 9999 tons of gemstones. Any more than that, they deserve the formatting they get! :) diff --git a/src/Core/Entities/PlayerEntityContracts.m b/src/Core/Entities/PlayerEntityContracts.m index a114fb817..65b3370b8 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:%ld", previous] forRow:GUI_ROW_SHIPYARD_START]; + [gui setKey:[NSString stringWithFormat:@"More:%zd", previous] forRow:GUI_ROW_SHIPYARD_START]; } for (i = 0; i < (shipCount - skip) && (int)i < rowCount; i++) { diff --git a/src/Core/Entities/PlayerEntityKeyMapper.m b/src/Core/Entities/PlayerEntityKeyMapper.m index 7be91b14a..c706d985b 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:%ld", previous] forRow:GUI_ROW_KC_FUNCSTART]; + [gui setKey:[NSString stringWithFormat:@"More:%zd", previous] forRow:GUI_ROW_KC_FUNCSTART]; } for(i = 0; i < (n_functions - skip) && (int)i < n_rows; 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:%ld", previous] forRow:GUI_ROW_KC_FUNCSTART]; + [gui setKey:[NSString stringWithFormat:@"More:%zd", previous] forRow:GUI_ROW_KC_FUNCSTART]; } NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; diff --git a/src/Core/Entities/PlayerEntityLoadSave.m b/src/Core/Entities/PlayerEntityLoadSave.m index 18055de23..e13eebd6b 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:%zu", (unsigned long)i] forRow:row]; + [gui setKey:[NSString stringWithFormat:@"Scenario:%zu", i] forRow:row]; ++row; } diff --git a/src/Core/Entities/PlayerEntityStickMapper.m b/src/Core/Entities/PlayerEntityStickMapper.m index d0d0338f3..d20951aa3 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:%ld", previous] forRow:GUI_ROW_FUNCSTART]; + [gui setKey:[NSString stringWithFormat:@"More:%zd", previous] forRow:GUI_ROW_FUNCSTART]; } for(i=0; i < (n_functions - skip) && (int)i < n_rows; i++) diff --git a/src/Core/GameController.m b/src/Core/GameController.m index b1faaf4ca..5956c54ea 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 %zu", GetLastError()); + OOLog(@"gameController.setEcoQos", @"SetPriorityClass failed with error %lu", 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 %zu", GetLastError()); + OOLog(@"gameController.setEcoQos", @"SetProcessInformation failed with error %lu", GetLastError()); } } #endif diff --git a/src/Core/GuiDisplayGen.m b/src/Core/GuiDisplayGen.m index 406afc956..b40323a82 100644 --- a/src/Core/GuiDisplayGen.m +++ b/src/Core/GuiDisplayGen.m @@ -2056,7 +2056,7 @@ - (void) drawStarChart:(GLfloat)x :(GLfloat)y :(GLfloat)z :(GLfloat) alpha :(BOO { systemParameter = nearby_systems[i].eco; GLfloat ce1 = 1.0f - 0.125f * systemParameter; - [self setGLColorFromSetting:[NSString stringWithFormat:kGuiChartEconomyUColor, (unsigned long)systemParameter] + [self setGLColorFromSetting:[NSString stringWithFormat:kGuiChartEconomyUColor, systemParameter] defaultValue:[OOColor colorWithRed:ce1 green:1.0f blue:0.0f alpha:1.0f] alpha:1.0]; } @@ -2070,7 +2070,7 @@ - (void) drawStarChart:(GLfloat)x :(GLfloat)y :(GLfloat)z :(GLfloat) alpha :(BOO if (EXPECT(noNova)) { systemParameter = nearby_systems[i].gov; - [self setGLColorFromSetting:[NSString stringWithFormat:kGuiChartGovernmentUColor, (unsigned long)systemParameter] + [self setGLColorFromSetting:[NSString stringWithFormat:kGuiChartGovernmentUColor, systemParameter] defaultValue:[OOColor colorWithRed:govcol[systemParameter*3] green:govcol[1+(systemParameter*3)] blue:govcol[2+(systemParameter*3)] alpha:1.0f] alpha:1.0]; } diff --git a/src/Core/HeadUpDisplay.m b/src/Core/HeadUpDisplay.m index 96c1d69fa..2a266634d 100644 --- a/src/Core/HeadUpDisplay.m +++ b/src/Core/HeadUpDisplay.m @@ -4065,13 +4065,13 @@ void OODrawPlanetInfo(int gov, int eco, int tec, GLfloat x, GLfloat y, GLfloat z OOGLBEGIN(GL_QUADS); { - [[UNIVERSE gui] setGLColorFromSetting:[NSString stringWithFormat:kGuiChartEconomyUColor, (unsigned long)eco] + [[UNIVERSE gui] setGLColorFromSetting:[NSString stringWithFormat:kGuiChartEconomyUColor, (size_t)eco] defaultValue:[OOColor colorWithRed:ce1 green:1.0f blue:0.0f alpha:1.0f] alpha:1.0]; // see OODrawHilightedPlanetInfo cx += drawCharacterQuad(23 - eco, cx, y, z, siz); // characters 16..23 are economy symbols - [[UNIVERSE gui] setGLColorFromSetting:[NSString stringWithFormat:kGuiChartGovernmentUColor, (unsigned long)gov] + [[UNIVERSE gui] setGLColorFromSetting:[NSString stringWithFormat:kGuiChartGovernmentUColor, (size_t)gov] defaultValue:[OOColor colorWithRed:govcol[gov*3] green:govcol[1+(gov*3)] blue:govcol[2+(gov*3)] alpha:1.0f] alpha:1.0]; diff --git a/src/Core/Materials/OOTextureLoader.m b/src/Core/Materials/OOTextureLoader.m index 103933d3f..b4b749497 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 %zu x %zu to %zu x %zu.", [_path lastPathComponent], pixMap.width, pixMap.height, desiredWidth, desiredHeight); + OOLog(@"texture.load.rescale", @"Rescaling texture \"%@\" from %u x %u to %u x %u.", [_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/OOCPUInfo.m b/src/Core/OOCPUInfo.m index 71c4502a0..79cdaad31 100644 --- a/src/Core/OOCPUInfo.m +++ b/src/Core/OOCPUInfo.m @@ -212,7 +212,7 @@ OOMemoryStatus OOSystemMemoryStatus(void) } } - return [NSString stringWithFormat:@"%zu.%zu.%zu%s %S", + return [NSString stringWithFormat:@"%lu.%lu.%lu%s %S", osver.dwMajorVersion, osver.dwMinorVersion, osver.dwBuildNumber, outUBRString, (const WCHAR *)osver.szCSDVersion]; } diff --git a/src/Core/OODeepCopy.m b/src/Core/OODeepCopy.m index d172aff83..19038bdc0 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 %zu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; + [NSException raise:NSMallocException format:@"Failed to allocate space for %zu objects in %s.", 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 %zu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; + [NSException raise:NSMallocException format:@"Failed to allocate space for %zu objects in %s.", 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 %zu objects in %s.", (unsigned long)count, __PRETTY_FUNCTION__]; + [NSException raise:NSMallocException format:@"Failed to allocate space for %zu objects in %s.", count, __PRETTY_FUNCTION__]; } // Ensure there's an objects set even if passed nil. diff --git a/src/Core/OOLogging.m b/src/Core/OOLogging.m index c084d2cd2..4d35b6932 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 (%@:%zu): %@", inFunction, OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; + formattedMessage = [NSString stringWithFormat:@"%s (%@:%lu): %@", inFunction, OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; } else { - formattedMessage = [NSString stringWithFormat:@"%@:%zu: %@", OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; + formattedMessage = [NSString stringWithFormat:@"%@:%lu: %@", OOLogAbbreviatedFileName(inFile), inLine, formattedMessage]; } } else diff --git a/src/Core/OOMeshToOctreeConverter.m b/src/Core/OOMeshToOctreeConverter.m index d9eb27b09..6e20f962d 100644 --- a/src/Core/OOMeshToOctreeConverter.m +++ b/src/Core/OOMeshToOctreeConverter.m @@ -261,7 +261,7 @@ + (instancetype) converterWithCapacity:(NSUInteger)capacity - (NSString *) descriptionComponents { - return [NSString stringWithFormat:@"%zu triangles", _data.count]; + return [NSString stringWithFormat:@"%u triangles", _data.count]; } diff --git a/src/Core/OOOXZManager.m b/src/Core/OOOXZManager.m index 672d9c313..545400761 100644 --- a/src/Core/OOOXZManager.m +++ b/src/Core/OOOXZManager.m @@ -1522,12 +1522,12 @@ - (void) processSelection } else if (_interfaceState == OXZ_STATE_PICK_INSTALL) { - OOLog(kOOOXZDebugLog, @"Trying to install index %zu", (unsigned long)item); + OOLog(kOOOXZDebugLog, @"Trying to install index %zu", item); [self installOXZ:item]; } else if (_interfaceState == OXZ_STATE_PICK_INSTALLED) { - OOLog(kOOOXZDebugLog, @"Trying to install index %zu", (unsigned long)item); + OOLog(kOOOXZDebugLog, @"Trying to install index %zu", 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 %zu as only %zu in list", (unsigned long)item, (unsigned long)[remList count]); + OOLog(kOOOXZDebugLog, @"Unable to remove item %zu as only %zu in list", item, [remList count]); return NO; } NSString *filename = [[remList objectAtIndex:item] oo_stringForKey:kOOManifestFilePath]; if (filename == nil) { - OOLog(kOOOXZDebugLog, @"Unable to remove item %zu as filename not found", (unsigned long)item); + OOLog(kOOOXZDebugLog, @"Unable to remove item %zu as filename not found", item); return NO; } diff --git a/src/Core/OOSystemDescriptionManager.m b/src/Core/OOSystemDescriptionManager.m index 227bdb52c..a15b531da 100644 --- a/src/Core/OOSystemDescriptionManager.m +++ b/src/Core/OOSystemDescriptionManager.m @@ -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",@"'%zu' 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.",index); return kNilRandomSeed; } return RandomSeedFromString([propertyCache[index] oo_stringForKey:@"random_seed"]); diff --git a/src/Core/OOTextureScaling.m b/src/Core/OOTextureScaling.m index bf85b0fe6..fda6bb38d 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 (%zux%zu) passed to %s() - ignoring, data will be junk.", width, height, __PRETTY_FUNCTION__); + OOLog(kOOLogParameterError, @"Non-power-of-two dimensions (%ux%u) 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/OOTextureVerifierStage.m b/src/Core/OXPVerifier/OOTextureVerifierStage.m index 9b8bf0026..36fd530e6 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 %zux%zu pixels to %zux%zu 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 %ux%u pixels to %ux%u pixels) at runtime.", displayName, pixmap.width, pixmap.height, rWidth, rHeight); } else { - OOLog(@"verifyOXP.verbose.texture.OK", @"- %@ (%zux%zu px) OK.", displayName, pixmap.width, pixmap.height); + OOLog(@"verifyOXP.verbose.texture.OK", @"- %@ (%ux%u px) OK.", displayName, pixmap.width, pixmap.height); } OOFreePixMap(&pixmap); diff --git a/src/Core/Scripting/OOJSEngineTimeManagement.m b/src/Core/Scripting/OOJSEngineTimeManagement.m index 18054e5a7..b20ea02c9 100644 --- a/src/Core/Scripting/OOJSEngineTimeManagement.m +++ b/src/Core/Scripting/OOJSEngineTimeManagement.m @@ -876,7 +876,7 @@ - (NSString *) description } else { - return [NSString stringWithFormat:@"%@: %zu times, total %g ms, avg %g ms, max %g ms", _function, _hitCount, totalTimeSum, totalTimeSum / _hitCount, totalTimeMax]; + return [NSString stringWithFormat:@"%@: %lu times, total %g ms, avg %g ms, max %g ms", _function, _hitCount, totalTimeSum, totalTimeSum / _hitCount, totalTimeMax]; } } else @@ -887,7 +887,7 @@ - (NSString *) description } else { - 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]; + 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]; } } } diff --git a/src/Core/Scripting/OOLegacyScriptWhitelist.m b/src/Core/Scripting/OOLegacyScriptWhitelist.m index d261251af..4594b9e14 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:@"%zu", (unsigned long)topOfStack->index]; + if (string == nil) string = [NSString stringWithFormat:@"%zu", topOfStack->index]; if ([base length] > 0) [base appendString:@"."]; [base appendString:string]; From 563d561f384551abb4ffe6526508a619fa0ecb1c Mon Sep 17 00:00:00 2001 From: mcarans Date: Tue, 1 Sep 2026 17:49:42 +1200 Subject: [PATCH 5/5] Don't use uint_fast32_t, int_fast32_t or other fast versions which are inconsistent between Windows and Linux --- src/Core/Entities/OOECMBlastEntity.h | 2 +- src/Core/Materials/OOPixMap.h | 2 +- .../Materials/OOPixMapChannelOperations.m | 34 +++--- src/Core/OOMeshToOctreeConverter.h | 6 +- src/Core/OOMeshToOctreeConverter.m | 30 ++--- src/Core/OOProfilingStopwatch.m | 4 +- src/Core/OOTextureScaling.m | 106 +++++++++--------- src/Core/Octree.h | 4 +- src/Core/Octree.m | 2 +- src/Core/legacy_random.c | 4 +- 10 files changed, 97 insertions(+), 97 deletions(-) diff --git a/src/Core/Entities/OOECMBlastEntity.h b/src/Core/Entities/OOECMBlastEntity.h index 283423f85..38e9c0614 100644 --- a/src/Core/Entities/OOECMBlastEntity.h +++ b/src/Core/Entities/OOECMBlastEntity.h @@ -34,7 +34,7 @@ MA 02110-1301, USA. { @private OOTimeDelta _nextBlast; - uint_fast8_t _blastsRemaining; + uint8_t _blastsRemaining; OOWeakReference *_ship; } diff --git a/src/Core/Materials/OOPixMap.h b/src/Core/Materials/OOPixMap.h index 96a1eb4f0..c73c2e2f1 100644 --- a/src/Core/Materials/OOPixMap.h +++ b/src/Core/Materials/OOPixMap.h @@ -30,7 +30,7 @@ SOFTWARE. #import "OOMaths.h" -typedef uint_fast32_t OOPixMapDimension; // Note: dimensions are assumed to be less than 1048576 (2^20) pixels. +typedef uint32_t OOPixMapDimension; // Note: dimensions are assumed to be less than 1048576 (2^20) pixels. #define OORoundUpToPowerOf2_PixMap OORoundUpToPowerOf2_32 diff --git a/src/Core/Materials/OOPixMapChannelOperations.m b/src/Core/Materials/OOPixMapChannelOperations.m index c8341d790..8e15cf812 100644 --- a/src/Core/Materials/OOPixMapChannelOperations.m +++ b/src/Core/Materials/OOPixMapChannelOperations.m @@ -64,8 +64,8 @@ static void ExtractChannel_4(OOPixMap *ioPixMap, uint8_t channelIndex) uint32_t *src; uint8_t *dst; - uint_fast8_t shift; - uint_fast32_t xCount, y; + uint8_t shift; + uint32_t xCount, y; dst = ioPixMap->pixels; shift = 8 * channelIndex; @@ -132,7 +132,7 @@ static void ToRGBA_1(OOPixMap srcPx, OOPixMap dstPx) uint8_t *src; uint32_t *dst; - uint_fast32_t xCount, y; + uint32_t xCount, y; dst = dstPx.pixels; @@ -155,9 +155,9 @@ static void ToRGBA_2(OOPixMap srcPx, OOPixMap dstPx) NSCParameterAssert(OOPixMapBytesPerPixel(srcPx) == 2 && dstPx.format == kOOPixMapRGBA && srcPx.width == dstPx.width && srcPx.height == dstPx.height); uint16_t *src; - uint_fast32_t px; + uint32_t px; uint32_t *dst; - uint_fast32_t xCount, y; + uint32_t xCount, y; dst = dstPx.pixels; @@ -198,9 +198,9 @@ static void ModulateUniform_4(OOPixMap pixMap, uint16_t f3, uint16_t f2, uint16_ NSCParameterAssert(OOPixMapBytesPerPixel(pixMap) == 4); uint32_t *curr; - uint_fast32_t px; - uint_fast32_t p0, p1, p2, p3; - uint_fast32_t xCount, y; + uint32_t px; + uint32_t p0, p1, p2, p3; + uint32_t xCount, y; for (y = 0; y < pixMap.height; y++) { @@ -255,10 +255,10 @@ BOOL OOPixMapModulatePixMap(OOPixMap *ioDstPixMap, OOPixMap otherPixMap) static void ModulatePixMap_4(OOPixMap mainPx, OOPixMap otherPx) { uint32_t *dst, *other; - uint_fast32_t px; - uint_fast16_t m0, m1, m2, m3; - uint_fast16_t o0, o1, o2, o3; - uint_fast32_t xCount, y; + uint32_t px; + uint16_t m0, m1, m2, m3; + uint16_t o0, o1, o2, o3; + uint32_t xCount, y; for (y = 0; y < mainPx.height; y++) { @@ -290,7 +290,7 @@ static void ModulatePixMap_4(OOPixMap mainPx, OOPixMap otherPx) m2 = (m2 * o2) / 255; m3 = (m3 * o3) / 255; - *dst++ = ((uint_fast32_t)m0 << 24) | ((uint_fast32_t)m1 << 16) | (m2 << 8) | m3; + *dst++ = ((uint32_t)m0 << 24) | ((uint32_t)m1 << 16) | (m2 << 8) | m3; other++; } while (--xCount); @@ -314,10 +314,10 @@ BOOL OOPixMapAddPixMap(OOPixMap *ioDstPixMap, OOPixMap otherPixMap) static void AddPixMap_4(OOPixMap mainPx, OOPixMap otherPx) { uint32_t *dst, *other; - uint_fast32_t px; - uint_fast32_t m02, m13; - uint_fast32_t o02, o13; - uint_fast32_t xCount, y; + uint32_t px; + uint32_t m02, m13; + uint32_t o02, o13; + uint32_t xCount, y; for (y = 0; y < mainPx.height; y++) { diff --git a/src/Core/OOMeshToOctreeConverter.h b/src/Core/OOMeshToOctreeConverter.h index 9c944f762..c3f9cf923 100644 --- a/src/Core/OOMeshToOctreeConverter.h +++ b/src/Core/OOMeshToOctreeConverter.h @@ -44,9 +44,9 @@ enum struct OOMeshToOctreeConverterInternalData { Triangle *triangles; - uint_fast32_t count; - uint_fast32_t capacity; - uint_fast32_t pendingCapacity; + uint32_t count; + uint32_t capacity; + uint32_t pendingCapacity; Triangle smallData[kOOMeshToOctreeConverterSmallDataCapacity]; } _data; } diff --git a/src/Core/OOMeshToOctreeConverter.m b/src/Core/OOMeshToOctreeConverter.m index 6e20f962d..f760e7f92 100644 --- a/src/Core/OOMeshToOctreeConverter.m +++ b/src/Core/OOMeshToOctreeConverter.m @@ -94,13 +94,13 @@ The current implementation uses a struct (defined in the header as Triangle *triangles Pointer to the triangle array. Initially points at smallData. - uint_fast32_t count + uint32_t count The number of triangles currently in the GeometryData. - uint_fast32_t capacity + uint32_t capacity The number of slots in triangles. Invariant: count <= capacity. - uint_fast32_t pendingCapacity + uint32_t pendingCapacity The capacity hint passed to InitGeometryData(). Used by AddTriangle_slow(). @@ -118,7 +118,7 @@ The capacity hint passed to InitGeometryData(). Used by The data has to be by reference rather than a return value so that the triangles pointer can be pointed into the struct. */ -OOINLINE void InitGeometryData(GeometryData *data, uint_fast32_t capacity); +OOINLINE void InitGeometryData(GeometryData *data, uint32_t capacity); /* DestroyGeometryData(data) @@ -182,7 +182,7 @@ triangles will be offset by the specified amount (half of data's half-width) // MARK: Inline function bodies. -void InitGeometryData(GeometryData *data, uint_fast32_t capacity) +void InitGeometryData(GeometryData *data, uint32_t capacity) { NSCParameterAssert(data != NULL); @@ -238,7 +238,7 @@ - (id) initWithCapacity:(NSUInteger)capacity if ((self = [super init])) { - InitGeometryData(&_data, (uint_fast32_t)capacity); + InitGeometryData(&_data, (uint32_t)capacity); } return self; @@ -292,7 +292,7 @@ static OOScalar MaxDimensionFromOrigin(GeometryData *data) NSCParameterAssert(data != NULL); OOScalar result = 0.0f; - uint_fast32_t i, j; + uint32_t i, j; for (i = 0; i < data->count; i++) for (j = 0; j < 3; j++) { Vector v = data->triangles[i].v[j]; @@ -361,7 +361,7 @@ vanilla Oolite r5352 (plus instrumentation). Values aren't precisely { kFactor = 2 }; - uint_fast32_t subCapacity = data->count * kFactor; + uint32_t subCapacity = data->count * kFactor; #define DECL_GEOMETRY(NAME, CAP) GeometryData NAME; InitGeometryData(&NAME, CAP); @@ -444,7 +444,7 @@ static void TranslateGeometryX(GeometryData *data, OOScalar offset) // Optimization note: offset is never zero, so no early return. - uint_fast32_t i, count = data->count; + uint32_t i, count = data->count; for (i = 0; i < count; i++) { data->triangles[i].v[0].x += offset; @@ -460,7 +460,7 @@ static void TranslateGeometryY(GeometryData *data, OOScalar offset) // Optimization note: offset is never zero, so no early return. - uint_fast32_t i, count = data->count; + uint32_t i, count = data->count; for (i = 0; i < count; i++) { data->triangles[i].v[0].y += offset; @@ -476,7 +476,7 @@ static void TranslateGeometryZ(GeometryData *data, OOScalar offset) // Optimization note: offset is never zero, so no early return. - uint_fast32_t i, count = data->count; + uint32_t i, count = data->count; for (i = 0; i < count; i++) { data->triangles[i].v[0].z += offset; @@ -491,7 +491,7 @@ static void SplitGeometryX(GeometryData *data, GeometryData *dPlus, GeometryData NSCParameterAssert(data != NULL && dPlus != NULL && dMinus != NULL); // test each triangle splitting against x == 0.0 - uint_fast32_t i, count = data->count; + uint32_t i, count = data->count; for (i = 0; i < count; i++) { bool done_tri = false; @@ -623,7 +623,7 @@ static void SplitGeometryY(GeometryData *data, GeometryData *dPlus, GeometryData NSCParameterAssert(data != NULL && dPlus != NULL && dMinus != NULL); // test each triangle splitting against y == 0.0 - uint_fast32_t i, count = data->count; + uint32_t i, count = data->count; for (i = 0; i < count; i++) { bool done_tri = false; @@ -756,7 +756,7 @@ static void SplitGeometryZ(GeometryData *data, GeometryData *dPlus, GeometryData NSCParameterAssert(data != NULL && dPlus != NULL && dMinus != NULL); // test each triangle splitting against z == 0.0 - uint_fast32_t i, count = data->count; + uint32_t i, count = data->count; for (i = 0; i < count; i++) { bool done_tri = false; @@ -907,7 +907,7 @@ static NO_INLINE_FUNC void AddTriangle_slow(GeometryData *data, Triangle tri) if (data->capacity == kOOMeshToOctreeConverterSmallDataCapacity) { - data->capacity = MAX(data->pendingCapacity, (uint_fast32_t)kOOMeshToOctreeConverterSmallDataCapacity * 2); + data->capacity = MAX(data->pendingCapacity, (uint32_t)kOOMeshToOctreeConverterSmallDataCapacity * 2); data->triangles = malloc(data->capacity * sizeof(Triangle)); memcpy(data->triangles, data->smallData, sizeof data->smallData); } diff --git a/src/Core/OOProfilingStopwatch.m b/src/Core/OOProfilingStopwatch.m index aecb2ecbb..784e83592 100644 --- a/src/Core/OOProfilingStopwatch.m +++ b/src/Core/OOProfilingStopwatch.m @@ -133,8 +133,8 @@ OOTimeDelta OOHighResTimeDeltaInSeconds(OOHighResTimeValue startTime, OOHighResT #elif OO_PROFILING_STOPWATCH_WINDOWS return 1e-3 * (double)(endTime - startTime); #elif OO_PROFILING_STOPWATCH_GETTIMEOFDAY - int_fast32_t deltaS = (int_fast32_t)endTime.tv_sec - (int_fast32_t)startTime.tv_sec; - int_fast32_t deltaU = (int_fast32_t)endTime.tv_usec - (int_fast32_t)startTime.tv_usec; + int32_t deltaS = (int32_t)endTime.tv_sec - (int32_t)startTime.tv_sec; + int32_t deltaU = (int32_t)endTime.tv_usec - (int32_t)startTime.tv_usec; double result = deltaU; result = (result * 1e-6) + deltaS; return result; diff --git a/src/Core/OOTextureScaling.m b/src/Core/OOTextureScaling.m index fda6bb38d..3e9cb3e72 100644 --- a/src/Core/OOTextureScaling.m +++ b/src/Core/OOTextureScaling.m @@ -431,8 +431,8 @@ static void ScaleToHalf_1_x1(void *srcBytes, void *dstBytes, OOPixMapDimension s { OOPixMapDimension x, y; uint8_t *src0, *src1, *dst; - uint_fast8_t px00, px01, px10, px11; - uint_fast16_t sum; + uint8_t px00, px01, px10, px11; + uint16_t sum; src0 = srcBytes; src1 = src0 + srcWidth; @@ -473,8 +473,8 @@ static void ScaleToHalf_1_x4(void *srcBytes, void *dstBytes, OOPixMapDimension s { OOPixMapDimension x, y; uint32_t *src0, *src1, *dst; - uint_fast32_t px00, px01, px10, px11; - uint_fast32_t sum0, sum1; + uint32_t px00, px01, px10, px11; + uint32_t sum0, sum1; srcWidth >>= 2; // Four (output) pixels at a time src0 = srcBytes; @@ -656,8 +656,8 @@ static void ScaleToHalf_2_x1(void *srcBytes, void *dstBytes, OOPixMapDimension s { OOPixMapDimension x, y; uint16_t *src0, *src1, *dst; - uint_fast16_t px00, px01, px10, px11; - uint_fast32_t sumHi, sumLo; + uint16_t px00, px01, px10, px11; + uint32_t sumHi, sumLo; src0 = srcBytes; src1 = src0 + srcWidth; @@ -748,14 +748,14 @@ static void ScaleToHalf_4_x1(void *srcBytes, void *dstBytes, OOPixMapDimension s { OOPixMapDimension x, y; uint32_t *src0, *src1, *dst; - uint_fast32_t px00, px01, px10, px11; + uint32_t px00, px01, px10, px11; /* We treat channel layout as ABGR -- actual layout doesn't matter since each channel is handled the same. We use two accumulators, with alternating channels, so overflow doesn't cross channel boundaries, while having less overhead than one accumulator per channel. */ - uint_fast32_t ag, br; + uint32_t ag, br; src0 = srcBytes; src1 = src0 + srcWidth; @@ -890,10 +890,10 @@ static void StretchVerticallyN_x1(OOPixMap srcPx, OOPixMap dstPx) { uint8_t *src, *src0, *src1, *prev, *dst; uint8_t px0, px1; - uint_fast32_t x, y, xCount; + uint32_t x, y, xCount; size_t srcRowBytes; - uint_fast16_t weight0, weight1; - uint_fast32_t fractY; // Y coordinate, fixed-point (24.8) + uint16_t weight0, weight1; + uint32_t fractY; // Y coordinate, fixed-point (24.8) src = srcPx.pixels; srcRowBytes = srcPx.rowBytes; @@ -939,10 +939,10 @@ static void StretchVerticallyN_x4(OOPixMap srcPx, OOPixMap dstPx) uint8_t *src; uint32_t *src0, *src1, *prev, *dst; uint32_t px0, px1, ag, br; - uint_fast32_t x, y, xCount; + uint32_t x, y, xCount; size_t srcRowBytes; - uint_fast16_t weight0, weight1; - uint_fast32_t fractY; // Y coordinate, fixed-point (24.8) + uint16_t weight0, weight1; + uint32_t fractY; // Y coordinate, fixed-point (24.8) src = srcPx.pixels; srcRowBytes = srcPx.rowBytes; @@ -990,10 +990,10 @@ static void StretchVerticallyN_x8(OOPixMap srcPx, OOPixMap dstPx) uint8_t *src; uint64_t *src0, *src1, *prev, *dst; uint64_t px0, px1, agag, brbr; - uint_fast32_t x, y, xCount; + uint32_t x, y, xCount; size_t srcRowBytes; - uint_fast16_t weight0, weight1; - uint_fast32_t fractY; // Y coordinate, fixed-point (24.8) + uint16_t weight0, weight1; + uint32_t fractY; // Y coordinate, fixed-point (24.8) src = srcPx.pixels; srcRowBytes = srcPx.rowBytes; @@ -1040,10 +1040,10 @@ static void StretchHorizontally1(OOPixMap srcPx, OOPixMap dstPx) { uint8_t *src, *srcStart, *dst; uint8_t px0, px1; - uint_fast32_t x, y, xCount; + uint32_t x, y, xCount; size_t srcRowBytes; - uint_fast16_t weight0, weight1; - uint_fast32_t fractX, deltaX; // X coordinate, fixed-point (20.12), allowing widths up to 1 mebipixel + uint16_t weight0, weight1; + uint32_t fractX, deltaX; // X coordinate, fixed-point (20.12), allowing widths up to 1 mebipixel NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 1 && OOIsValidPixMap(dstPx) && OOPixMapBytesPerPixel(dstPx) == 1); @@ -1099,11 +1099,11 @@ static void StretchHorizontally2(OOPixMap srcPx, OOPixMap dstPx) { uint16_t *src, *srcStart, *dst; uint16_t px0, px1; - uint_fast32_t hi, lo; - uint_fast32_t x, y, xCount; + uint32_t hi, lo; + uint32_t x, y, xCount; size_t srcRowBytes; - uint_fast16_t weight0, weight1; - uint_fast32_t fractX, deltaX; // X coordinate, fixed-point (20.12), allowing widths up to 1 mebipixel + uint16_t weight0, weight1; + uint32_t fractX, deltaX; // X coordinate, fixed-point (20.12), allowing widths up to 1 mebipixel NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 2 && OOIsValidPixMap(dstPx) && OOPixMapBytesPerPixel(dstPx) == 2); @@ -1166,10 +1166,10 @@ static void StretchHorizontally4(OOPixMap srcPx, OOPixMap dstPx) uint32_t *src, *srcStart, *dst; uint32_t px0, px1; uint32_t ag, br; - uint_fast32_t x, y, xCount; + uint32_t x, y, xCount; size_t srcRowBytes; - uint_fast16_t weight0, weight1; - uint_fast32_t fractX, deltaX; // X coordinate, fixed-point (20.12), allowing widths up to 1 mebipixel + uint16_t weight0, weight1; + uint32_t fractX, deltaX; // X coordinate, fixed-point (20.12), allowing widths up to 1 mebipixel NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 4 && OOIsValidPixMap(dstPx) && OOPixMapBytesPerPixel(dstPx) == 4); @@ -1231,11 +1231,11 @@ static void SqueezeHorizontally1(OOPixMap srcPx, OOPixMapDimension dstWidth) { uint8_t *src, *srcStart, *dst; uint8_t borderPx; - uint_fast32_t x, y, xCount, endX; + uint32_t x, y, xCount, endX; size_t srcRowBytes; - uint_fast32_t endFractX, deltaX; - uint_fast32_t accum, weight; - uint_fast8_t borderWeight; + uint32_t endFractX, deltaX; + uint32_t accum, weight; + uint8_t borderWeight; NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 1); @@ -1294,11 +1294,11 @@ static void SqueezeHorizontally1(OOPixMap srcPx, OOPixMapDimension dstWidth) static void SqueezeVertically1(OOPixMap srcPx, OOPixMapDimension dstHeight) { uint8_t *src, *srcStart, *dst; - uint_fast32_t x, y, xCount, startY, endY, lastRow; + uint32_t x, y, xCount, startY, endY, lastRow; size_t srcRowBytes; - uint_fast32_t endFractY, deltaY; - uint_fast32_t accum, weight; - uint_fast8_t startWeight, endWeight; + uint32_t endFractY, deltaY; + uint32_t accum, weight; + uint8_t startWeight, endWeight; NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 1); @@ -1361,7 +1361,7 @@ static void SqueezeVertically1(OOPixMap srcPx, OOPixMapDimension dstHeight) */ #define ACCUM2(PX, WT) do { \ uint16_t px = PX; \ - uint_fast32_t wt = WT; \ + uint32_t wt = WT; \ accumHi += (px & 0xFF00) * wt; \ accumLo += (px & 0x00FF) * wt; \ weight += wt; \ @@ -1383,11 +1383,11 @@ static void SqueezeHorizontally2(OOPixMap srcPx, OOPixMapDimension dstWidth) { uint16_t *src, *srcStart, *dst; uint16_t borderPx; - uint_fast32_t x, y, xCount, endX; + uint32_t x, y, xCount, endX; size_t srcRowBytes; - uint_fast32_t endFractX, deltaX; - uint_fast32_t accumHi, accumLo, weight; - uint_fast8_t borderWeight; + uint32_t endFractX, deltaX; + uint32_t accumHi, accumLo, weight; + uint8_t borderWeight; NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 2); @@ -1445,11 +1445,11 @@ static void SqueezeHorizontally2(OOPixMap srcPx, OOPixMapDimension dstWidth) static void SqueezeVertically2(OOPixMap srcPx, OOPixMapDimension dstHeight) { uint16_t *src, *srcStart, *dst; - uint_fast32_t x, y, xCount, startY, endY, lastRow; + uint32_t x, y, xCount, startY, endY, lastRow; size_t srcRowBytes; - uint_fast32_t endFractY, deltaY; - uint_fast32_t accumHi, accumLo, weight; - uint_fast8_t startWeight, endWeight; + uint32_t endFractY, deltaY; + uint32_t accumHi, accumLo, weight; + uint8_t startWeight, endWeight; NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 2); @@ -1512,7 +1512,7 @@ static void SqueezeVertically2(OOPixMap srcPx, OOPixMapDimension dstHeight) */ #define ACCUM4(PX, WT) do { \ uint32_t px = PX; \ - uint_fast32_t wt = WT; \ + uint32_t wt = WT; \ ag = ((px & 0xFF00FF00) >> 8) * wt; \ br = (px & 0x00FF00FF) * wt; \ accum1 += ag >> 16; \ @@ -1548,11 +1548,11 @@ static void SqueezeHorizontally4(OOPixMap srcPx, OOPixMapDimension dstWidth) { uint32_t *src, *srcStart, *dst; uint32_t borderPx, ag, br; - uint_fast32_t x, y, xCount, endX; + uint32_t x, y, xCount, endX; size_t srcRowBytes; - uint_fast32_t endFractX, deltaX; - uint_fast32_t accum1, accum2, accum3, accum4, weight; - uint_fast8_t borderWeight; + uint32_t endFractX, deltaX; + uint32_t accum1, accum2, accum3, accum4, weight; + uint8_t borderWeight; NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 4); @@ -1610,12 +1610,12 @@ static void SqueezeHorizontally4(OOPixMap srcPx, OOPixMapDimension dstWidth) static void SqueezeVertically4(OOPixMap srcPx, OOPixMapDimension dstHeight) { uint32_t *src, *srcStart, *dst; - uint_fast32_t x, y, xCount, startY, endY, lastRow; + uint32_t x, y, xCount, startY, endY, lastRow; size_t srcRowBytes; uint32_t ag, br; - uint_fast32_t endFractY, deltaY; - uint_fast32_t accum1, accum2, accum3, accum4, weight; - uint_fast8_t startWeight, endWeight; + uint32_t endFractY, deltaY; + uint32_t accum1, accum2, accum3, accum4, weight; + uint8_t startWeight, endWeight; NSCParameterAssert(OOIsValidPixMap(srcPx) && OOPixMapBytesPerPixel(srcPx) == 4); diff --git a/src/Core/Octree.h b/src/Core/Octree.h index ebed384f8..b13a429dd 100644 --- a/src/Core/Octree.h +++ b/src/Core/Octree.h @@ -93,13 +93,13 @@ enum { @private int *_octree; - uint_fast32_t _nodeCount, _capacity; + uint32_t _nodeCount, _capacity; struct OOOctreeBuildState { uint32_t insertionPoint; uint32_t remaining; } _stateStack[kMaxOctreeDepth + 1]; - uint_fast8_t _level; + uint8_t _level; } /* diff --git a/src/Core/Octree.m b/src/Core/Octree.m index 255b7719d..392302bbe 100644 --- a/src/Core/Octree.m +++ b/src/Core/Octree.m @@ -931,7 +931,7 @@ entirely solid subtree will always use the last eight nodes (any solid */ NSAssert(_nodeCount > 8, @"After ending an inner node, there must be at least eight nodes in buffer."); - for (uint_fast32_t node = _nodeCount - 8; node < _nodeCount; node++) + for (uint32_t node = _nodeCount - 8; node < _nodeCount; node++) { if (_octree[node] != -1) return; } diff --git a/src/Core/legacy_random.c b/src/Core/legacy_random.c index 140f2d20d..24c1dcf93 100644 --- a/src/Core/legacy_random.c +++ b/src/Core/legacy_random.c @@ -319,8 +319,8 @@ void make_pseudo_random_seed (Random_Seed *seed_ptr) void rotate_seed (Random_Seed *seed_ptr) { - uint_fast16_t x; - uint_fast16_t y; + uint16_t x; + uint16_t y; /* Note: this is equivalent to adding three (little-endian) 16-bit values together, rotating the three numbers and replacing one of them with