Fix for formatting mismatches between unsigned long long credit quantities and %d format specifiers.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1575 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2008-04-20 21:58:06 +00:00
parent 431c04b2e5
commit b07b78a42d
5 changed files with 27 additions and 27 deletions

View File

@ -370,7 +370,7 @@
// *** Misc. messages ***
// Messages used when awarding bounties
"bounty-d" = ( "Bounty: %d" );
"bounty-llu" = ( "Bounty: %llu" );
"total-f-credits" = ( "Total: %.1f ₢" );
"right-on-commander" = ( "Right On, Commander!" );
@ -573,10 +573,10 @@
// /station
"fined" =
(
"You have been fined %d credits.",
"You have been fined %d credits, and made to pick up litter in the main hangar deck.",
"You have been fined %d credits, and are forced to clean up after the [6]oids.",
"You have been fined %d credits, and sent for “attitude adjustment”."
"You have been fined %llu credits.",
"You have been fined %llu credits, and made to pick up litter in the main hangar deck.",
"You have been fined %llu credits, and are forced to clean up after the [6]oids.",
"You have been fined %llu credits, and sent for “attitude adjustment”."
);
// system description after a nova
"nova-system-description" =
@ -863,7 +863,7 @@
"starboard-facing-string" = " Starboard ";
// Purchase ship screen
"ship-purchase-price" = "%d ₢";
"ship-purchase-price" = "%llu ₢";
// Contracts screen
"@-contracts-title" = "%@ Carrier Market";
@ -881,7 +881,7 @@
"contracts-@-a-@-wishes-to-go-to-@" = "%@, a %@, wishes to go to %@.";
"contracts-@-the-route-is-f-light-years-long-a-minimum-of-d-jumps" = "%@ The route is %.1f light years long, a minimum of %d jumps.";
"contracts-@-you-will-need-to-depart-within-@-in-order-to-arrive-within-@-time" = "%@ You will need to depart within %@, in order to arrive within %@ time.";
"contracts-@-will-pay-llu-credits-d-in-advance-and-llu-credits-on-arrival" = "%@ Will pay %llu ₢: %d ₢ in advance, and %llu ₢ on arrival.";
"contracts-@-will-pay-llu-credits-llu-in-advance-and-llu-credits-on-arrival" = "%@ Will pay %llu ₢: %llu ₢ in advance, and %llu ₢ on arrival.";
"contracts-deliver-a-cargo-of-@-to-@" = "Deliver a cargo of %@ to %@.";
"contracts-@-the-contract-will-cost-you-f-credits-and-pay-a-total-of-f-credits" = "%@ The contract will cost you %.1f ₢, and pay a total of %.1f ₢.";
"contracts-no-time" = "no time";
@ -927,8 +927,8 @@
"shipyard-standard-customer-model" = " Standard customer model.";
"shipyard-forward-weapon-has-been-upgraded-to-a-@" = " Forward weapon has been upgraded to a %@.";
"shipyard-forward-weapon-upgraded-to-@" = " Forward weapon upgraded to %@.";
"shipyard-selling-price-d-credits" = " Selling price %d ₢.";
"shipyard-price-d-credits" = " Price %d ₢.";
"shipyard-selling-price-llu-credits" = " Selling price %llu ₢.";
"shipyard-price-llu-credits" = " Price %llu ₢.";
// Load/Save screens shared information
"loadsavescreen-commander-name" = "Commander Name";
@ -980,8 +980,8 @@
// delivery reports
"arrival-report-title" = "%H Arrival Report";
"passenger-delivered-okay-@-d-@" = "%@ thanks you, and pays you %d ₢ for delivering them to %@.";
"passenger-delivered-late-@-d-@" = "%@ pays you %d ₢ for eventually delivering them to %@.";
"passenger-delivered-okay-@-llu-@" = "%@ thanks you, and pays you %lld ₢ for delivering them to %@.";
"passenger-delivered-late-@-llu-@" = "%@ pays you %lld ₢ for eventually delivering them to %@.";
"passenger-failed-@" = "%@ leaves your ship, annoyed that you have wasted so much of their time.";
"cargo-delivered-okay-@-f" = "Droids unload the %@ and you are paid %.1f ₢.";

View File

@ -3276,7 +3276,7 @@ double scoopSoundPlayTime = 0.0;
if (score > 9)
{
NSString *bonusMS1 = [NSString stringWithFormat:DESC(@"bounty-d"), (int)((score / 10) +.5)];
NSString *bonusMS1 = [NSString stringWithFormat:DESC(@"bounty-llu"), (unsigned long long)score];
NSString *bonusMS2 = [NSString stringWithFormat:DESC(@"total-f-credits"), 0.1 * credits];
[UNIVERSE addDelayedMessage:bonusMS1 forCount:6 afterDelay:0.15];
@ -5742,7 +5742,7 @@ OOSound* burnersound;
credits -= fine;
}
fine /= 10; // divide by ten for display
NSString* fined_message = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[fined]"), fine];
NSString* fined_message = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[fined]"), (unsigned long long)fine];
[UNIVERSE addMessage:fined_message forCount:6];
ship_clock_adjust = 24 * 3600; // take up a day
if (gui_screen != GUI_SCREEN_STATUS)

View File

@ -140,7 +140,7 @@ static NSString * const kOOLogNoteShowShipyardModel = @"script.debug.note.showSh
if (dest_eta > 0)
{
// and in good time
int fee = [(NSNumber*)[passenger_info objectForKey:PASSENGER_KEY_FEE] intValue];
long long fee = [passenger_info longLongForKey:PASSENGER_KEY_FEE];
while ((randf() < 0.75)&&(dest_eta > 3600)) // delivered with more than an hour to spare and a decent customer?
{
fee *= 110; // tip + 10%
@ -149,23 +149,23 @@ static NSString * const kOOLogNoteShowShipyardModel = @"script.debug.note.showSh
}
credits += 10 * fee;
if (!result)
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[passenger-delivered-okay-@-d-@]"), passenger_name, fee, passenger_dest_name];
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[passenger-delivered-okay-@-llu-@]"), passenger_name, fee, passenger_dest_name];
else
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"%@\n[passenger-delivered-okay-@-d-@]"), result, passenger_name, fee, passenger_dest_name];
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"%@\n[passenger-delivered-okay-@-llu-@]"), result, passenger_name, fee, passenger_dest_name];
[passengers removeObjectAtIndex:i--];
[self increasePassengerReputation];
}
else
{
// but we're late!
int fee = [(NSNumber*)[passenger_info objectForKey:PASSENGER_KEY_FEE] intValue] / 2; // halve fare
long long fee = [passenger_info longLongForKey:PASSENGER_KEY_FEE] / 2; // halve fare
while (randf() < 0.5) // maybe halve fare a few times!
fee /= 2;
credits += 10 * fee;
if (!result)
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[passenger-delivered-late-@-d-@]"), passenger_name, fee, passenger_dest_name];
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[passenger-delivered-late-@-llu-@]"), passenger_name, fee, passenger_dest_name];
else
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"%@\n[passenger-delivered-late-@-d-@]"), result, passenger_name, fee, passenger_dest_name];
result = [NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"%@\n[passenger-delivered-late-@-llu-@]"), result, passenger_name, fee, passenger_dest_name];
[passengers removeObjectAtIndex:i--];
}
}
@ -1207,12 +1207,12 @@ static NSMutableDictionary* currentShipyard = nil;
}
for (i = 0; i < (n_ships - skip) && (int)i < n_rows; i++)
{
NSDictionary* ship_info = (NSDictionary*)[shipyard objectAtIndex:i + skip];
int ship_price = [(NSNumber*)[ship_info objectForKey:SHIPYARD_KEY_PRICE] intValue];
NSDictionary* ship_info = [shipyard dictionaryAtIndex:i + skip];
OOCreditsQuantity ship_price = [ship_info unsignedLongLongForKey:SHIPYARD_KEY_PRICE];
[gui setColor:[OOColor yellowColor] forRow:start_row + i];
[gui setArray:[NSArray arrayWithObjects:
[NSString stringWithFormat:@" %@ ",[[ship_info dictionaryForKey:SHIPYARD_KEY_SHIP] stringForKey:@"display_name" defaultValue:[[ship_info dictionaryForKey:SHIPYARD_KEY_SHIP] stringForKey:KEY_NAME]]],
[NSString stringWithFormat:DESC(@"ship-purchase-price"),ship_price],
[NSString stringWithFormat:DESC(@"ship-purchase-price"), (unsigned long long)ship_price],
nil]
forRow:start_row + i];
[gui setKey:(NSString*)[ship_info objectForKey:SHIPYARD_KEY_ID] forRow:start_row + i];

View File

@ -64,7 +64,7 @@ static NSString * const kCacheKeyCaches = @"_caches";
enum
{
kEndianTagValue = 0x12345678UL,
kFormatVersionValue = 11
kFormatVersionValue = 12
};

View File

@ -6685,8 +6685,8 @@ double estimatedTimeForJourney(double distance, int hops)
[self shortTimeDescription:(passenger_departure_time - current_time)], [self shortTimeDescription:(passenger_arrival_time - current_time)]];
long_description = [NSString stringWithFormat:
DESC(@"contracts-@-will-pay-llu-credits-d-in-advance-and-llu-credits-on-arrival"), long_description,
premium + fee, premium, fee];
DESC(@"contracts-@-will-pay-llu-credits-llu-in-advance-and-llu-credits-on-arrival"), long_description,
(unsigned long long)(premium + fee), (unsigned long long)premium, (unsigned long long)fee];
NSDictionary* passenger_info_dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
passenger_name, PASSENGER_KEY_NAME,
@ -7263,8 +7263,8 @@ double estimatedTimeForJourney(double distance, int hops)
price = base_price + cunningFee(price - base_price);
}
[description appendFormat:DESC(@"shipyard-selling-price-d-credits"), (int) price];
[short_description appendFormat:DESC(@"shipyard-price-d-credits"), (int) price];
[description appendFormat:DESC(@"shipyard-selling-price-llu-credits"), (unsigned long long)price];
[short_description appendFormat:DESC(@"shipyard-selling-price-llu-credits"), (unsigned long long)price];
NSString* ship_id = [NSString stringWithFormat:@"%06x-%06x", super_rand1, super_rand2];