diff --git a/src/action/action_attack.cpp b/src/action/action_attack.cpp
index c174ab343..a5120ba6b 100644
--- a/src/action/action_attack.cpp
+++ b/src/action/action_attack.cpp
@@ -115,7 +115,7 @@ local Unit* CheckForDeadGoal(Unit* unit)
 	    unit->Orders[0].Y=goal->Y+goal->Type->TileHeight/2;
 	    unit->Orders[0].RangeX=unit->Orders[0].RangeY=0;
 
-	    DebugLevel0Fn("destroyed unit %Zd\n",UnitNumber(goal));
+	    DebugLevel0Fn("destroyed unit %d\n",UnitNumber(goal));
 	    RefsDebugCheck( !goal->Refs );
 	    if( !--goal->Refs ) {
 		ReleaseUnit(goal);
@@ -243,7 +243,7 @@ local void MoveToTarget(Unit* unit)
 		unit->Orders[0].X=unit->Orders[0].Y=-1;
 		unit->SubAction|=WEAK_TARGET;		// weak target
 		NewResetPath(unit);
-		DebugLevel3Fn("%Zd in react range %Zd\n"
+		DebugLevel3Fn("%d in react range %d\n"
 			,UnitNumber(unit),UnitNumber(goal));
 	    }
 
@@ -262,7 +262,7 @@ local void MoveToTarget(Unit* unit)
 		    // Save current command to come back.
 		    unit->SavedOrder=unit->Orders[0];
 		    if( (goal=unit->SavedOrder.Goal) ) {
-			DebugLevel0Fn("Have goal to come back %Zd\n",
+			DebugLevel0Fn("Have goal to come back %d\n",
 				UnitNumber(goal));
 			unit->SavedOrder.X=goal->X+goal->Type->TileWidth/2;
 			unit->SavedOrder.Y=goal->Y+goal->Type->TileHeight/2;
@@ -407,7 +407,7 @@ local void AttackTarget(Unit* unit)
 	    if( unit->SavedOrder.Action==UnitActionStill ) {
 		unit->SavedOrder=unit->Orders[0];
 		if( (temp=unit->SavedOrder.Goal) ) {
-		    DebugLevel0Fn("Have unit to come back %Zd?\n",
+		    DebugLevel0Fn("Have unit to come back %d?\n",
 			    UnitNumber(temp));
 		    unit->SavedOrder.X=temp->X+temp->Type->TileWidth/2;
 		    unit->SavedOrder.Y=temp->Y+temp->Type->TileHeight/2;
@@ -418,7 +418,7 @@ local void AttackTarget(Unit* unit)
 
 	    RefsDebugCheck( goal->Destroyed || !goal->Refs );
 	    goal->Refs++;
-	    DebugLevel3Fn("%Zd Unit in react range %Zd\n"
+	    DebugLevel3Fn("%d Unit in react range %d\n"
 		    ,UnitNumber(unit),UnitNumber(goal));
 	    unit->Orders[0].Goal=goal;
 	    unit->Orders[0].X=unit->Orders[0].Y=-1;
@@ -443,7 +443,7 @@ local void AttackTarget(Unit* unit)
 		    // Save current order to come back or to continue it.
 		    unit->SavedOrder=unit->Orders[0];
 		    if( (goal=unit->SavedOrder.Goal) ) {
-			DebugLevel0Fn("Have goal to come back %Zd\n",
+			DebugLevel0Fn("Have goal to come back %d\n",
 				UnitNumber(goal));
 			unit->SavedOrder.X=goal->X+goal->Type->TileWidth/2;
 			unit->SavedOrder.Y=goal->Y+goal->Type->TileHeight/2;
@@ -466,7 +466,7 @@ local void AttackTarget(Unit* unit)
 		// Save current order to come back or to continue it.
 		unit->SavedOrder=unit->Orders[0];
 		if( (temp=unit->SavedOrder.Goal) ) {
-		    DebugLevel0Fn("Have goal to come back %Zd\n",
+		    DebugLevel0Fn("Have goal to come back %d\n",
 			    UnitNumber(temp));
 		    unit->SavedOrder.X=temp->X+temp->Type->TileWidth/2;
 		    unit->SavedOrder.Y=temp->Y+temp->Type->TileHeight/2;
@@ -508,7 +508,7 @@ local void AttackTarget(Unit* unit)
 */
 global void HandleActionAttack(Unit* unit)
 {
-    DebugLevel3Fn("Attack %Zd\n",UnitNumber(unit));
+    DebugLevel3Fn("Attack %d\n",UnitNumber(unit));
 
     switch( unit->SubAction ) {
 	//
diff --git a/src/action/action_board.cpp b/src/action/action_board.cpp
index 7df2be1c7..a04ecd625 100644
--- a/src/action/action_board.cpp
+++ b/src/action/action_board.cpp
@@ -176,7 +176,7 @@ global void HandleActionBoard(Unit* unit)
 {
     int i;
 
-    DebugLevel3Fn("%p(%Zd) SubAction %d\n"
+    DebugLevel3Fn("%p(%d) SubAction %d\n"
 	    ,unit,UnitNumber(unit),unit->SubAction);
 
     switch( unit->SubAction ) {
diff --git a/src/action/action_demolish.cpp b/src/action/action_demolish.cpp
index 2456186f5..c3e5ab4b1 100644
--- a/src/action/action_demolish.cpp
+++ b/src/action/action_demolish.cpp
@@ -50,7 +50,7 @@ global void HandleActionDemolish(Unit* unit)
     Unit* goal;
     int err;
 
-    DebugLevel3Fn("Demolish %Zd\n",UnitNumber(unit));
+    DebugLevel3Fn("Demolish %d\n",UnitNumber(unit));
 
     switch( unit->SubAction ) {
 	//
diff --git a/src/action/action_die.cpp b/src/action/action_die.cpp
index bb8bfc5ad..0dd1c1eb9 100644
--- a/src/action/action_die.cpp
+++ b/src/action/action_die.cpp
@@ -54,7 +54,7 @@ global void HandleActionDie(Unit* unit)
     //	Die sequence terminated, generate corpse.
     //
     if( unit->Reset ) {
-	DebugLevel3("Die complete %Zd\n",UnitNumber(unit));
+	DebugLevel3("Die complete %d\n",UnitNumber(unit));
 	if( !unit->Type->CorpseType ) {
 	    ReleaseUnit(unit);
 	    return;
diff --git a/src/action/action_follow.cpp b/src/action/action_follow.cpp
index 6001ffbe8..e0a0d39c4 100644
--- a/src/action/action_follow.cpp
+++ b/src/action/action_follow.cpp
@@ -46,7 +46,7 @@ global void HandleActionFollow(Unit* unit)
 {
     Unit* goal;
 
-    DebugLevel3Fn("%Zd: %Zd %d,%d \n",UnitNumber(unit),
+    DebugLevel3Fn("%d: %d %d,%d \n",UnitNumber(unit),
 	    unit->Orders[0].Goal ? UnitNumber(unit->Orders[0].Goal) : -1,
 	    unit->Orders[0].X,unit->Orders[0].Y);
 
diff --git a/src/action/action_harvest.cpp b/src/action/action_harvest.cpp
index 2dd3cfd34..31505f78a 100644
--- a/src/action/action_harvest.cpp
+++ b/src/action/action_harvest.cpp
@@ -303,7 +303,7 @@ local int ReturnWithWood(Unit* unit)
 
     if( i==PF_UNREACHABLE ) {
 	// FIXME: could try another depot, or retry later.
-	DebugLevel2Fn("WOOD-DEPOSIT NOT REACHED %Zd=%d,%d ? %d\n"
+	DebugLevel2Fn("WOOD-DEPOSIT NOT REACHED %d=%d,%d ? %d\n"
 		  ,UnitNumber(destu),destu->X,destu->Y
 		  ,MapDistanceToUnit(unit->X,unit->Y,destu));
 	unit->Orders[0].Action=UnitActionStill;
diff --git a/src/action/action_minegold.cpp b/src/action/action_minegold.cpp
index 146fd7af4..5be1c7106 100644
--- a/src/action/action_minegold.cpp
+++ b/src/action/action_minegold.cpp
@@ -91,7 +91,7 @@ local int MoveToGoldMine(Unit* unit)
     //
     if( i==PF_UNREACHABLE ) {
 	// FIXME: could try another mine, or retry later.
-	DebugLevel3Fn("GOLD-MINE NOT REACHED %Zd=%d,%d ? %d\n"
+	DebugLevel3Fn("GOLD-MINE NOT REACHED %d=%d,%d ? %d\n"
 	      ,UnitNumber(destu),x,y,MapDistanceToUnit(unit->X,unit->Y,destu));
 	return -1;
     }
@@ -147,7 +147,7 @@ local int MineInGoldmine(Unit* unit)
 	//
 	mine=GoldMineOnMap(unit->X,unit->Y);
 	IfDebug(
-	    DebugLevel3Fn("Found %d,%d=%Zd\n",unit->X,unit->Y,UnitNumber(mine));
+	    DebugLevel3Fn("Found %d,%d=%d\n",unit->X,unit->Y,UnitNumber(mine));
 	    if( !mine ) {
 		DebugLevel0Fn("No unit? (%d,%d)\n",unit->X,unit->Y);
 		abort();
@@ -298,7 +298,7 @@ local int MoveToGoldDeposit(Unit* unit)
     //
     if( i==PF_UNREACHABLE ) {
 	// FIXME: could try another depot, or retry later.
-	DebugLevel3Fn("GOLD-DEPOT NOT REACHED %Zd=%d,%d ? %d\n"
+	DebugLevel3Fn("GOLD-DEPOT NOT REACHED %d=%d,%d ? %d\n"
 	      ,UnitNumber(destu),x,y,MapDistanceToUnit(unit->X,unit->Y,destu));
 	return -1;
     }
diff --git a/src/action/action_move.cpp b/src/action/action_move.cpp
index 59f2a839d..6484e80eb 100644
--- a/src/action/action_move.cpp
+++ b/src/action/action_move.cpp
@@ -222,7 +222,7 @@ global void HandleActionMove(Unit* unit)
 {
     Unit* goal;
 
-    DebugLevel3Fn("%Zd: %Zd %d,%d \n",UnitNumber(unit),
+    DebugLevel3Fn("%d: %d %d,%d \n",UnitNumber(unit),
 	    unit->Orders[0].Goal ? UnitNumber(unit->Orders[0].Goal) : -1,
 	    unit->Orders[0].X,unit->Orders[0].Y);
 
diff --git a/src/action/action_patrol.cpp b/src/action/action_patrol.cpp
index 03181791e..9f349cb3c 100644
--- a/src/action/action_patrol.cpp
+++ b/src/action/action_patrol.cpp
@@ -79,7 +79,7 @@ global void HandleActionPatrol(Unit* unit)
 	    if( goal ) {
 		Order order;
 
-		DebugLevel3("Patrol attack %Zd\n",UnitNumber(goal));
+		DebugLevel3("Patrol attack %d\n",UnitNumber(goal));
 		order=unit->Orders[0];
 		CommandAttack(unit,goal->X,goal->Y,NULL,FlushCommands);
 		// Save current command to come back.
diff --git a/src/action/action_repair.cpp b/src/action/action_repair.cpp
index 027506cad..fa30ba733 100644
--- a/src/action/action_repair.cpp
+++ b/src/action/action_repair.cpp
@@ -152,7 +152,7 @@ global void HandleActionRepair(Unit* unit)
     Unit* goal;
     int err;
 
-    DebugLevel3("Repair %Zd\n",UnitNumber(unit));
+    DebugLevel3("Repair %d\n",UnitNumber(unit));
 
     switch( unit->SubAction ) {
 	case 0:
diff --git a/src/action/action_research.cpp b/src/action/action_research.cpp
index 982cf7c77..91d90b263 100644
--- a/src/action/action_research.cpp
+++ b/src/action/action_research.cpp
@@ -48,7 +48,7 @@ global void HandleActionResearch(Unit* unit)
 {
     Upgrade* upgrade;
 
-    DebugLevel3("Research %Zd\n",UnitNumber(unit));
+    DebugLevel3("Research %d\n",UnitNumber(unit));
 
     if( !unit->SubAction ) {		// first entry
 	unit->SubAction=1;
diff --git a/src/action/action_resource.cpp b/src/action/action_resource.cpp
index fe031033f..55cfe1ba5 100644
--- a/src/action/action_resource.cpp
+++ b/src/action/action_resource.cpp
@@ -185,7 +185,7 @@ local int WaitInResource(Unit* unit,const Resource* resource)
 	//
 	source=resource->ResourceOnMap(unit->X,unit->Y);
 	IfDebug(
-	    DebugLevel2Fn("Found %d,%d=%Zd\n",unit->X,unit->Y
+	    DebugLevel2Fn("Found %d,%d=%d\n",unit->X,unit->Y
 		,UnitNumber(source));
 	    if( !source ) {
 		DebugLevel0Fn("No unit? (%d,%d)\n",unit->X,unit->Y);
@@ -452,7 +452,7 @@ global void HandleActionResource(Unit* unit,const Resource* resource)
 {
     int ret;
 
-    DebugLevel3Fn("%s(%Zd) SubAction %d\n"
+    DebugLevel3Fn("%s(%d) SubAction %d\n"
 	,unit->Type->Ident,UnitNumber(unit),unit->SubAction);
 
     switch( unit->SubAction ) {
diff --git a/src/action/action_returngoods.cpp b/src/action/action_returngoods.cpp
index 0bf9a89d5..f26aeac28 100644
--- a/src/action/action_returngoods.cpp
+++ b/src/action/action_returngoods.cpp
@@ -85,7 +85,7 @@ global void HandleActionReturnGoods(Unit* unit)
 	}
 	unit->Orders[0].X=unit->X;
 	unit->Orders[0].Y=unit->Y;	// Return point to continue.
-	DebugLevel3("Return to %Zd=%d,%d\n"
+	DebugLevel3("Return to %d=%d,%d\n"
 		,UnitNumber(destu),unit->Orders[0].X,unit->Orders[0].Y);
 	unit->Orders[0].Action=UnitActionHarvest;
 	NewResetPath(unit);
@@ -106,7 +106,7 @@ global void HandleActionReturnGoods(Unit* unit)
 	    RefsDebugCheck( !destu->Refs );
 	    ++destu->Refs;
 	}
-	DebugLevel3("Return to %Zd=%d,%d\n"
+	DebugLevel3("Return to %d=%d,%d\n"
 	    ,UnitNumber(destu),unit->Orders[0].X,unit->Orders[0].Y);
 	unit->Orders[0].Action=UnitActionHaulOil;
 	NewResetPath(unit);
diff --git a/src/action/action_spellcast.cpp b/src/action/action_spellcast.cpp
index 6a7572ed3..e64b1b6ad 100644
--- a/src/action/action_spellcast.cpp
+++ b/src/action/action_spellcast.cpp
@@ -127,7 +127,7 @@ global void HandleActionSpellCast(Unit * unit)
 
     repeat = 0;			// repeat spell on next pass? (defaults to `no')
 
-    DebugLevel3Fn("%Zd %d,%d+%d+%d\n",
+    DebugLevel3Fn("%d %d,%d+%d+%d\n",
 	UnitNumber(unit),unit->Orders[0].X,unit->Orders[0].Y,
 	unit->Orders[0].RangeX,unit->Orders[0].RangeY);
 
diff --git a/src/action/action_still.cpp b/src/action/action_still.cpp
index a6d984000..55ea7a5a8 100644
--- a/src/action/action_still.cpp
+++ b/src/action/action_still.cpp
@@ -49,7 +49,7 @@ global void ActionStillGeneric(Unit* unit,int ground)
     Unit* temp;
     Unit* goal;
 
-    DebugLevel3Fn(" %Zd\n",UnitNumber(unit));
+    DebugLevel3Fn(" %d\n",UnitNumber(unit));
 
     if( unit->Removed ) {		// Removed units, do nothing?
 	// If peon is in building or unit is in transporter it is removed.
@@ -151,7 +151,7 @@ global void ActionStillGeneric(Unit* unit,int ground)
 	    if( (goal=AttackUnitsInReactRange(unit)) ) {
 		// Weak goal, can choose other unit, come back after attack
 		CommandAttack(unit,goal->X,goal->Y,NULL,FlushCommands);
-		DebugLevel3Fn(" %Zd Attacking in range %d\n"
+		DebugLevel3Fn(" %d Attacking in range %d\n"
 			,UnitNumber(unit),unit->SubAction);
 		DebugCheck( unit->SavedOrder.Action!=UnitActionStill );
 		DebugCheck( unit->SavedOrder.Goal );
@@ -162,13 +162,13 @@ global void ActionStillGeneric(Unit* unit,int ground)
 		unit->SavedOrder.Goal=NoUnitP;
 	    }
 	} else if( (goal=AttackUnitsInRange(unit)) ) {
-	    DebugLevel3Fn(" %Zd #%d\n",UnitNumber(goal),goal->Refs);
+	    DebugLevel3Fn(" %d #%d\n",UnitNumber(goal),goal->Refs);
 	    //
 	    //	Old goal destroyed.
 	    //
 	    temp=unit->Orders[0].Goal;
 	    if( temp && temp->Destroyed ) {
-		DebugLevel3Fn(" destroyed unit %Zd #%d\n"
+		DebugLevel3Fn(" destroyed unit %d #%d\n"
 			,UnitNumber(temp),temp->Refs);
 		RefsDebugCheck( !temp->Refs );
 		if( !--temp->Refs ) {
@@ -179,7 +179,7 @@ global void ActionStillGeneric(Unit* unit,int ground)
 	    if( !unit->SubAction || temp!=goal ) {
 		// New target.
 		if( temp ) {
-		    DebugLevel3Fn(" old unit %Zd #%d\n"
+		    DebugLevel3Fn(" old unit %d #%d\n"
 			    ,UnitNumber(temp),temp->Refs);
 		    RefsDebugCheck( !temp->Refs );
 		    temp->Refs--;
diff --git a/src/action/action_unload.cpp b/src/action/action_unload.cpp
index fd3fb0e45..2cbbdcd59 100644
--- a/src/action/action_unload.cpp
+++ b/src/action/action_unload.cpp
@@ -133,7 +133,7 @@ global void HandleActionUnload(Unit* unit)
 {
     int i;
 
-    DebugLevel3Fn("%p(%Zd) SubAction %d\n"
+    DebugLevel3Fn("%p(%d) SubAction %d\n"
 	    ,unit,UnitNumber(unit),unit->SubAction);
 
     switch( unit->SubAction ) {
diff --git a/src/action/action_upgradeto.cpp b/src/action/action_upgradeto.cpp
index 82fdd9356..2dda6f691 100644
--- a/src/action/action_upgradeto.cpp
+++ b/src/action/action_upgradeto.cpp
@@ -46,7 +46,7 @@ global void HandleActionUpgradeTo(Unit* unit)
     UnitType* type;
     const UnitStats* stats;
 
-    DebugLevel3Fn(" %Zd\n",UnitNumber(unit));
+    DebugLevel3Fn(" %d\n",UnitNumber(unit));
 
     player=unit->Player;
     if( !unit->SubAction ) {		// first entry
diff --git a/src/action/actions.cpp b/src/action/actions.cpp
index efd28e371..dda099f09 100644
--- a/src/action/actions.cpp
+++ b/src/action/actions.cpp
@@ -113,7 +113,7 @@ global int UnitShowAnimation(Unit* unit,const Animation* animation)
 local void HandleActionNone(Unit* unit)
 {
     DebugLevel1Fn("FIXME: Should not happen!\n");
-    DebugLevel1Fn("FIXME: Unit (%Zd) %s has action none.!\n",
+    DebugLevel1Fn("FIXME: Unit (%d) %s has action none.!\n",
 	    UnitNumber(unit),unit->Type->Ident);
 }
 
@@ -125,7 +125,7 @@ local void HandleActionNone(Unit* unit)
 local void HandleActionNotWritten(Unit* unit)
 {
     DebugLevel1Fn("FIXME: Not written!\n");
-    DebugLevel1Fn("FIXME: Unit (%Zd) %s has action %d.!\n",
+    DebugLevel1Fn("FIXME: Unit (%d) %s has action %d.!\n",
 	    UnitNumber(unit),unit->Type->Ident,unit->Orders[0].Action);
 }
 
@@ -350,17 +350,17 @@ global void UnitActions(void)
 	    if( !list
 		    && (!unit->Type->Vanishes
 			&& !unit->Orders[0].Action==UnitActionDie) ) {
-		DebugLevel0Fn("!removed not on map %Zd\n",UnitNumber(unit));
+		DebugLevel0Fn("!removed not on map %d\n",UnitNumber(unit));
 		abort();
 	    }
 	} else if( list ) {
-	    DebugLevel0Fn("remove on map %Zd\n",UnitNumber(unit));
+	    DebugLevel0Fn("remove on map %d\n",UnitNumber(unit));
 	    abort();
 	}
 	list=unit->Next;
 	while( list ) {
 	    if( list->X!=unit->X || list->Y!=unit->Y ) {
-		DebugLevel0Fn("Wrong X,Y %Zd %d,%d\n",UnitNumber(list)
+		DebugLevel0Fn("Wrong X,Y %d %d,%d\n",UnitNumber(list)
 			,list->X,list->Y);
 		abort();
 	    }
@@ -398,7 +398,7 @@ global void UnitActions(void)
 	}
 
 	fprintf(logf,"%d: ",FrameCounter);
-	fprintf(logf,"%Zd %s S%d/%d-%d P%d Refs %d\n",
+	fprintf(logf,"%d %s S%d/%d-%d P%d Refs %d\n",
 	    UnitNumber(unit),unit->Type ? unit->Type->Ident : "unit-killed",
 		unit->State,unit->SubAction,
 		unit->Orders[0].Action,
diff --git a/src/action/command.cpp b/src/action/command.cpp
index d9e754a00..9b0db7d23 100644
--- a/src/action/command.cpp
+++ b/src/action/command.cpp
@@ -1180,7 +1180,7 @@ global void CommandSpellCast(Unit* unit,int x,int y,Unit* dest
 	}
     );
 
-    DebugLevel3Fn(": %Zd spell-casts on %Zd\n"
+    DebugLevel3Fn(": %d spell-casts on %d\n"
 	,UnitNumber(unit),dest ? UnitNumber(dest) : 0);
 
     //
diff --git a/src/ai/old_ai.cpp b/src/ai/old_ai.cpp
index 1834da4fc..634f22684 100644
--- a/src/ai/old_ai.cpp
+++ b/src/ai/old_ai.cpp
@@ -360,15 +360,15 @@ local int AiNeedResources(const UnitType * type)
     player = AiPlayer->Player;
     if ((err = PlayerCheckUnitType(player, type))) {
 	if (err & (1 << GoldCost)) {
-	    DebugLevel3Fn("%Zd Need gold\n", AiPlayer->Player - Players);
+	    DebugLevel3Fn("%d Need gold\n", AiPlayer->Player - Players);
 	    AiPlayer->NeedGold = 1;
 	}
 	if (err & (1 << WoodCost)) {
-	    DebugLevel3Fn("%Zd Need wood\n", AiPlayer->Player - Players);
+	    DebugLevel3Fn("%d Need wood\n", AiPlayer->Player - Players);
 	    AiPlayer->NeedWood = 1;
 	}
 	if (err & (1 << OilCost)) {
-	    DebugLevel3Fn("%Zd Need oil\n", AiPlayer->Player - Players);
+	    DebugLevel3Fn("%d Need oil\n", AiPlayer->Player - Players);
 	    AiPlayer->NeedOil = 1;
 	}
 	// FIXME: more resources!!!
@@ -662,7 +662,7 @@ local int AiBuildHall(int type)
 	}
     }
     // Did use the first if no could be moved.
-    DebugLevel3("\tWorker %Zd %d,%d -> Goldmine %Zd %d,%d\n",
+    DebugLevel3("\tWorker %d %d,%d -> Goldmine %d %d,%d\n",
 		UnitNumber(workers[best_w])
 		, workers[best_w]->X, workers[best_w]->Y,
 		UnitNumber(goldmines[best_g])
@@ -916,7 +916,7 @@ local void AiAssignWorker(void)
 
     //  Count workers
     num_worker = AiFindFreeWorkers(workers);
-    DebugLevel3Fn("Player %Zd: %d\n", AiPlayer->Player - Players, num_worker);
+    DebugLevel3Fn("Player %d: %d\n", AiPlayer->Player - Players, num_worker);
     if (num_worker) {
 	num_still = num_gold = num_wood = num_repair = 0;
 	for (w = 0; w < num_worker; ++w) {
@@ -940,12 +940,12 @@ local void AiAssignWorker(void)
 	    }
 	}
 
-	DebugLevel3("Ai: Player %Zd: ", AiPlayer->Player - Players);
+	DebugLevel3("Ai: Player %d: ", AiPlayer->Player - Players);
 	DebugLevel3("Workers %d, Gold %d, Wood %d, Repair %d, Still %d.\n",
 		    num_worker, num_gold, num_wood, num_repair, num_still);
 
 	if (AiPlayer->NeedGold && AiPlayer->NeedWood) {
-	    DebugLevel3("Ai: Player %Zd need gold and wood\n",
+	    DebugLevel3("Ai: Player %d need gold and wood\n",
 			AiPlayer->Player - Players);
 	    //      Assign half to wood and gold.
 	    if (num_still) {		// assign the non-working
@@ -976,7 +976,7 @@ local void AiAssignWorker(void)
 	}
 
 	if (AiPlayer->NeedGold) {
-	    DebugLevel3("Ai: Player %Zd need gold\n",
+	    DebugLevel3("Ai: Player %d need gold\n",
 			AiPlayer->Player - Players);
 	    //      Assign all to mine gold.
 	    for (w = 0; w < num_worker; ++w) {
@@ -999,7 +999,7 @@ local void AiAssignWorker(void)
 	}
 
 	if (AiPlayer->NeedWood) {
-	    DebugLevel3("Ai: Player %Zd need wood\n",
+	    DebugLevel3("Ai: Player %d need wood\n",
 			AiPlayer->Player - Players);
 	    //      Assign all to harvest wood.
 	    for (w = 0; w < num_worker; ++w) {
@@ -1386,7 +1386,7 @@ global void AiHelpMe(Unit * unit)
 */
 global void AiWorkComplete(Unit * unit, Unit * what)
 {
-    DebugLevel3("Ai: Player %Zd: %Zd Work %Zd complete\n",
+    DebugLevel3("Ai: Player %d: %d Work %d complete\n",
 		unit->Player - Players, UnitNumber(unit), UnitNumber(what));
     // FIXME: correct position
     if (unit->Player->Type == PlayerHuman) {
@@ -1411,7 +1411,7 @@ global void AiCanNotBuild(Unit * unit, const UnitType * what)
 {
     int i;
 
-    DebugLevel1("Ai: Player %Zd: %Zd Can't build %d at %d,%d\n",
+    DebugLevel1("Ai: Player %d: %d Can't build %d at %d,%d\n",
 		unit->Player - Players, UnitNumber(unit), what->Type, unit->X,
 		unit->Y);
     // FIXME: correct position
@@ -1442,7 +1442,7 @@ global void AiCanNotReach(Unit * unit, const UnitType * what)
 {
     int i;
 
-    DebugLevel3("Ai: Player %Zd: %Zd Can't reach %d at %d,%d\n",
+    DebugLevel3("Ai: Player %d: %d Can't reach %d at %d,%d\n",
 		unit->Player - Players, UnitNumber(unit), what->Type, unit->X,
 		unit->Y);
     // FIXME: correct position
@@ -1474,7 +1474,7 @@ global void AiCanNotReach(Unit * unit, const UnitType * what)
 */
 global void AiTrainingComplete(Unit * unit, Unit * what)
 {
-    DebugLevel3("Ai: Player %Zd: %Zd Training %Zd complete\n",
+    DebugLevel3("Ai: Player %d: %d Training %d complete\n",
 		unit->Player - Players, UnitNumber(unit), UnitNumber(what));
     // FIXME: correct position
     if (unit->Player->Type == PlayerHuman) {
diff --git a/src/network/commands.cpp b/src/network/commands.cpp
index 00f981325..2272ec78e 100644
--- a/src/network/commands.cpp
+++ b/src/network/commands.cpp
@@ -93,7 +93,7 @@ local void CommandLog(const char* name,const Unit* unit,int flag,
     //
     //	Frame, unit, (type-ident only for better readable.
     //
-    fprintf(logf,"(log %d 'U%Zd '%s '%s '%s",
+    fprintf(logf,"(log %d 'U%d '%s '%s '%s",
 	    FrameCounter,UnitNumber(unit),unit->Type->Ident,name,
 	    flag ? "flush" : "append");
 
@@ -107,7 +107,7 @@ local void CommandLog(const char* name,const Unit* unit,int flag,
     //	Destination given.
     //
     if( dest ) {
-	fprintf(logf," 'U%Zd",UnitNumber(dest));
+	fprintf(logf," 'U%d",UnitNumber(dest));
     }
     //
     //	Value given.
@@ -594,7 +594,7 @@ global void ParseCommand(unsigned short msgnr,UnitRef unum,
     //	Check if unit is already killed?
     //
     if( unit->Destroyed ) {
-	DebugLevel0Fn(" destroyed unit skipping %Zd\n",UnitNumber(unit));
+	DebugLevel0Fn(" destroyed unit skipping %d\n",UnitNumber(unit));
 	return;
     }
 
diff --git a/src/pathfinder/astar.cpp b/src/pathfinder/astar.cpp
index 17aabfe33..c21293479 100644
--- a/src/pathfinder/astar.cpp
+++ b/src/pathfinder/astar.cpp
@@ -315,7 +315,7 @@ local int AStarFindPath(Unit* unit,int* pxd,int* pyd)
     static int xoffset[]={  0,-1,+1, 0, -1,+1,-1,+1 };
     static int yoffset[]={ -1, 0, 0,+1, -1,-1,+1,+1 };
 
-    DebugLevel3Fn("%Zd %d,%d->%d,%d\n",
+    DebugLevel3Fn("%d %d,%d->%d,%d\n",
 	    UnitNumber(unit),
 	    unit->X,unit->Y,
 	    unit->Command.Data.Move.DX,unit->Command.Data.Move.DY);
@@ -415,7 +415,7 @@ local int AStarFindPath(Unit* unit,int* pxd,int* pyd)
 	    //
 	    //	Select a "good" point from the open set.
 	    //		Nearest point to goal.
-	    DebugLevel0Fn("%Zd way too long\n",UnitNumber(unit));
+	    DebugLevel0Fn("%d way too long\n",UnitNumber(unit));
 	    ex=best_x;
 	    ey=best_y;
 	}
@@ -489,11 +489,11 @@ local int AStarFindPath(Unit* unit,int* pxd,int* pyd)
 	    ex=best_x;
 	    ey=best_y;
 	    if(ex==unit->X && ey==unit->Y) {
-		DebugLevel3Fn("%Zd unreachable\n",UnitNumber(unit));
+		DebugLevel3Fn("%d unreachable\n",UnitNumber(unit));
 		AStarCleanUp(num_in_close);
 		return -2;
 	    }
-	    DebugLevel3Fn("%Zd unreachable: going to closest\n",UnitNumber(unit));
+	    DebugLevel3Fn("%d unreachable: going to closest\n",UnitNumber(unit));
 	    break;
 	}
     }
@@ -525,7 +525,7 @@ local int AStarFindPath(Unit* unit,int* pxd,int* pyd)
 	if(j==AStarMovingUnitCrossingCost) {
 	    // we should wait, we are blocked by a moving unit
 	    //FIXME: this might lead to a deadlock, or something similar
-	    DebugLevel3("Unit %Zd waiting. Proposed move: %d %d\n",
+	    DebugLevel3("Unit %d waiting. Proposed move: %d %d\n",
 			UnitNumber(unit),*pxd,*pyd);
 	    path_length=0;
 	} else {
@@ -538,7 +538,7 @@ local int AStarFindPath(Unit* unit,int* pxd,int* pyd)
     }
     // let's clean up the matrix now
     AStarCleanUp(num_in_close);
-    DebugLevel3Fn("%Zd\n",UnitNumber(unit));
+    DebugLevel3Fn("%d\n",UnitNumber(unit));
     DebugLevel3Fn("proposed move: %d %d (%d)\n",*pxd,*pyd,path_length);
     return path_length;
 }
diff --git a/src/pathfinder/pathfinder.cpp b/src/pathfinder/pathfinder.cpp
index 0c3594a48..ae44143ba 100644
--- a/src/pathfinder/pathfinder.cpp
+++ b/src/pathfinder/pathfinder.cpp
@@ -345,7 +345,7 @@ global int UnitReachable(const Unit* src,const Unit* dst,int range)
     unsigned char* matrix;
     int depth;
 
-    DebugLevel3Fn("%Zd(%d,%d,%s)->%Zd(%d,%d,%s) "
+    DebugLevel3Fn("%d(%d,%d,%s)->%d(%d,%d,%s) "
 	,UnitNumber(src),src->X,src->Y,src->Type->Ident
 	,UnitNumber(dst),dst->X,dst->Y,dst->Type->Ident);
 
@@ -596,7 +596,7 @@ local int ComplexNewPath(Unit* unit,int gx,int gy,int ox,int oy,char* path)
     int add;
     int unreachable;
 
-    DebugLevel3Fn("%s(%Zd) to %Zd=%d,%d+%d+%d\n"
+    DebugLevel3Fn("%s(%d) to %d=%d,%d+%d+%d\n"
 	    ,unit->Type->Ident,UnitNumber(unit)
 	    ,unit->Command.Data.Move.Goal
 		? UnitNumber(unit->Command.Data.Move.Goal) : 0
@@ -708,7 +708,7 @@ local int ComplexNewPath(Unit* unit,int gx,int gy,int ox,int oy,char* path)
 		    }
 		    goal=UnitCacheOnXY(x,y,unit->Type->UnitType);
 		    if( !goal ) {	// Should not happen.
-			DebugLevel0Fn("%Zd %s: No goal for %d,%d on %d,%d?\n",
+			DebugLevel0Fn("%d %s: No goal for %d,%d on %d,%d?\n",
 				UnitNumber(unit),unit->Type->Ident,
 				unit->X,unit->Y,x,y);
 			*m=99;
@@ -856,7 +856,7 @@ global int NewPath(Unit* unit,int* xdp,int* ydp)
     rx=unit->Orders[0].RangeX;
     ry=unit->Orders[0].RangeY;
 
-    DebugLevel3Fn("%Zd: -> %s %p | %dx%d+%d+%d\n"
+    DebugLevel3Fn("%d: -> %s %p | %dx%d+%d+%d\n"
 	,UnitNumber(unit),unit->Command.Data.Move.Fast ? "F" : "C"
 	,goal,gx,gy,rx,ry);
 
diff --git a/src/stratagus/missile.cpp b/src/stratagus/missile.cpp
index e724ee9e5..4046662c5 100644
--- a/src/stratagus/missile.cpp
+++ b/src/stratagus/missile.cpp
@@ -789,7 +789,7 @@ global Missile* MakeMissile(MissileType* type,int sx,int sy,int dx,int dy)
 {
     Missile* missile;
 
-    DebugLevel3Fn("type %Zd(%s) at %d,%d to %d,%d\n"
+    DebugLevel3Fn("type %d(%s) at %d,%d to %d,%d\n"
 	    ,type-MissileTypes,type->Ident,sx,sy,dx,dy);
 
     //
diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp
index 2a4f51a5c..4739e93e3 100644
--- a/src/unit/unit.cpp
+++ b/src/unit/unit.cpp
@@ -110,7 +110,7 @@ global void FreeUnitMemory(Unit* unit)
 */
 global void ReleaseUnit(Unit* unit)
 {
-    DebugLevel2Fn("%d:Unit %p %Zd `%s'\n",FrameCounter,
+    DebugLevel2Fn("%d:Unit %p %d `%s'\n",FrameCounter,
 	    unit,UnitNumber(unit),unit->Type->Ident);
 
     DebugCheck( !unit->Type );		// already free.
@@ -146,7 +146,7 @@ global void ReleaseUnit(Unit* unit)
 	unit->Destroyed=1;		// mark as destroyed
 	RefsDebugCheck( !unit->Refs );
 	if( --unit->Refs>0 ) {
-	    DebugLevel2Fn("%d:More references of %Zd #%d\n",FrameCounter
+	    DebugLevel2Fn("%d:More references of %d #%d\n",FrameCounter
 		    ,UnitNumber(unit),unit->Refs);
 	    return;
 	}
@@ -176,7 +176,7 @@ global void ReleaseUnit(Unit* unit)
     ReleasedTail=&unit->Next;
     unit->Refs=FrameCounter+NetworkMaxLag;	// could be reuse after this.
     IfDebug(
-	DebugLevel2Fn("%d:No more references %Zd\n",
+	DebugLevel2Fn("%d:No more references %d\n",
 		FrameCounter,UnitNumber(unit));
 	unit->Type=NULL;			// for debugging.
     );
@@ -195,7 +195,7 @@ global Unit* MakeUnit(UnitType* type,Player* player)
     Unit* unit;
     Unit** slot;
 
-    DebugLevel3Fn("%s(%Zd)\n",type->Name,player-Players);
+    DebugLevel3Fn("%s(%d)\n",type->Name,player-Players);
 
     //
     //	Can use released unit?
@@ -240,7 +240,7 @@ global Unit* MakeUnit(UnitType* type,Player* player)
 	player->UnitTypesCount[type->Type]++;
     }
 
-    DebugLevel3Fn("%p %Zd\n",unit,UnitNumber(unit));
+    DebugLevel3Fn("%p %d\n",unit,UnitNumber(unit));
 
     //
     //	Initialise unit structure (must be zero filled!)
@@ -458,7 +458,7 @@ global void RemoveUnit(Unit* unit)
 	}
     }
 
-    DebugLevel3Fn("%Zd %p %p\n",UnitNumber(unit),unit,unit->Next);
+    DebugLevel3Fn("%d %p %p\n",UnitNumber(unit),unit,unit->Next);
     UnitCacheRemove(unit);
 #ifdef UNIT_ON_MAP
     if( 0 ) {
@@ -467,7 +467,7 @@ global void RemoveUnit(Unit* unit)
 	list=TheMap.Fields[unit->Y*TheMap.Width+unit->X].Here.Units;
 	while( list ) {				// find the unit
 	    if( list==unit ) {
-		DebugLevel0Fn("%Zd\n",UnitNumber(unit));
+		DebugLevel0Fn("%d\n",UnitNumber(unit));
 		abort();
 		break;
 	    }
@@ -551,7 +551,7 @@ global void UnitLost(const Unit* unit)
 	}
     }
 
-    DebugLevel3Fn("Lost %s(%Zd)\n",unit->Type->Ident,UnitNumber(unit));
+    DebugLevel3Fn("Lost %s(%d)\n",unit->Type->Ident,UnitNumber(unit));
 
     //
     //	Destroy oil-platform, must re-make oil patch.
@@ -582,7 +582,7 @@ global void UpdateForNewUnit(const Unit* unit,int upgrade)
     const UnitType* type;
     Player* player;
 
-    DebugLevel3Fn("unit %Zd (%d)\n"
+    DebugLevel3Fn("unit %d (%d)\n"
 	    ,UnitNumber(unit),unit->Type->Type);
 
     player=unit->Player;
@@ -1175,7 +1175,7 @@ global void RescueUnits(void)
 	    memcpy(table,p->Units,l*sizeof(Unit*));
 	    for( j=0; j<l; j++ ) {
 		unit=table[j];
-		DebugLevel3("Checking %Zd\n",UnitNumber(unit));
+		DebugLevel3("Checking %d\n",UnitNumber(unit));
 #ifdef UNIT_ON_MAP
 		// FIXME: could be done faster?
 #endif
@@ -1461,7 +1461,7 @@ global void DropOutNearest(Unit* unit,int gx,int gy,int addx,int addy)
     int bestd;
     int mask;
 
-    DebugLevel3Fn("%Zd\n",UnitNumber(unit));
+    DebugLevel3Fn("%d\n",UnitNumber(unit));
     DebugCheck( !unit->Removed );
 
     x=unit->X;
@@ -1834,7 +1834,7 @@ global Unit* FindGoldMine(const Unit* source,int x,int y)
 	    best=unit;
 	}
     }
-    DebugLevel3Fn("%Zd %d,%d\n",UnitNumber(best),best->X,best->Y);
+    DebugLevel3Fn("%d %d,%d\n",UnitNumber(best),best->X,best->Y);
     return best;
 }
 
@@ -1880,7 +1880,7 @@ global Unit* FindGoldDeposit(const Unit* source,int x,int y)
 	    best=unit;
 	}
     }
-    DebugLevel3Fn("%Zd %d,%d\n",UnitNumber(best),best->X,best->Y);
+    DebugLevel3Fn("%d %d,%d\n",UnitNumber(best),best->X,best->Y);
     return best;
 }
 
@@ -1922,7 +1922,7 @@ global Unit* FindWoodDeposit(const Player* player,int x,int y)
 	}
     }
 
-    DebugLevel3Fn("%Zd %d,%d\n",UnitNumber(best),best->X,best->Y);
+    DebugLevel3Fn("%d %d,%d\n",UnitNumber(best),best->X,best->Y);
     return best;
 }
 
@@ -1945,7 +1945,7 @@ global int FindWoodInSight(Unit* unit,int* px,int* py)
     int bestd;
     Unit* destu;
 
-    DebugLevel3Fn("%Zd %d,%d\n",UnitNumber(unit),unit->X,unit->Y);
+    DebugLevel3Fn("%d %d,%d\n",UnitNumber(unit),unit->X,unit->Y);
 
     x=unit->X;
     y=unit->Y;
@@ -2071,7 +2071,7 @@ global Unit* FindOilPlatform(const Player* player,int x,int y)
 	}
     }
 
-    DebugLevel3Fn("%Zd %d,%d\n",UnitNumber(best),best->X,best->Y);
+    DebugLevel3Fn("%d %d,%d\n",UnitNumber(best),best->X,best->Y);
     return best;
 }
 
@@ -2118,7 +2118,7 @@ global Unit* FindOilDeposit(const Player* player,int x,int y)
 	}
     }
 
-    DebugLevel3Fn("%Zd %d,%d\n",UnitNumber(best),best->X,best->Y);
+    DebugLevel3Fn("%d %d,%d\n",UnitNumber(best),best->X,best->Y);
     return best;
 }
 
diff --git a/src/unit/unit_cache.cpp b/src/unit/unit_cache.cpp
index 5413d9ff5..3f33f2d62 100644
--- a/src/unit/unit_cache.cpp
+++ b/src/unit/unit_cache.cpp
@@ -874,7 +874,7 @@ global int UnitCacheSelect(int x1,int y1,int x2,int y2,Unit** table)
 	    for( unit=mf->Here.Units; unit; unit=unit->Next ) {
 		IfDebug(
 		    if( !unit->Type ) {
-			DebugLevel0Fn("%d,%d: %Zd, %d,%d\n"
+			DebugLevel0Fn("%d,%d: %d, %d,%d\n"
 			    ,i,y,UnitNumber(unit),unit->X,unit->Y);
 			fflush(stdout);
 		    }
diff --git a/src/unit/unit_draw.cpp b/src/unit/unit_draw.cpp
index b8f125bc0..6d88790e5 100644
--- a/src/unit/unit_draw.cpp
+++ b/src/unit/unit_draw.cpp
@@ -1022,7 +1022,7 @@ local void DrawUnit(const Unit* unit)
     const UnitStats* stats;
 
     if ( unit->Revealer ) {		// Revealers are not drawn
-	DebugLevel3Fn("Drawing revealer %Zd\n",UnitNumber(unit));
+	DebugLevel3Fn("Drawing revealer %d\n",UnitNumber(unit));
 	return;
     }
 
diff --git a/src/unit/unittype.cpp b/src/unit/unittype.cpp
index de0b1b8ba..8d700a23c 100644
--- a/src/unit/unittype.cpp
+++ b/src/unit/unittype.cpp
@@ -778,7 +778,7 @@ global void ParsePudUDTA(const char* udta,int length)
     // FIXME: peon applies also to peon-with-gold and peon-with-wood
     // FIXME: oil-tanker applies also to oil-tanker-full
 
-    DebugLevel0("\tUDTA used %Zd bytes\n",udta-start);
+    DebugLevel0("\tUDTA used %d bytes\n",udta-start);
 
     UpdateStats();
 }