diff --git a/src/action/action_minegold.cpp b/src/action/action_minegold.cpp index 59c175808..1a616d364 100644 --- a/src/action/action_minegold.cpp +++ b/src/action/action_minegold.cpp @@ -182,9 +182,9 @@ local int MineInGoldmine(Unit* unit) // mine=GoldMineOnMap(unit->X,unit->Y); IfDebug( - DebugLevel3Fn("Found %d,%d=%d\n",unit->X,unit->Y,UnitNumber(mine)); + DebugLevel3Fn("Found %d,%d=%d\n" _C_ unit->X _C_ unit->Y _C_ UnitNumber(mine)); if( !mine ) { - DebugLevel0Fn("No unit? (%d,%d)\n",unit->X,unit->Y); + DebugLevel0Fn("No unit? (%d,%d)\n" _C_ unit->X _C_ unit->Y); abort(); } ); diff --git a/src/action/action_resource.cpp b/src/action/action_resource.cpp index 45cd796bd..69bae3eaf 100644 --- a/src/action/action_resource.cpp +++ b/src/action/action_resource.cpp @@ -219,10 +219,10 @@ local int WaitInResource(Unit* unit,const Resource* resource) // source=resource->ResourceOnMap(unit->X,unit->Y); IfDebug( - DebugLevel3Fn("Found %d,%d=%d\n",unit->X,unit->Y - ,UnitNumber(source)); + DebugLevel3Fn("Found %d,%d=%d\n" _C_ unit->X _C_ unit->Y + _C_ UnitNumber(source)); if( !source ) { - DebugLevel0Fn("No unit? (%d,%d)\n",unit->X,unit->Y); + DebugLevel0Fn("No unit? (%d,%d)\n" _C_ unit->X _C_ unit->Y); abort(); } ); diff --git a/src/ai/script_ai.cpp b/src/ai/script_ai.cpp index 4d1248a93..50c508986 100644 --- a/src/ai/script_ai.cpp +++ b/src/ai/script_ai.cpp @@ -324,7 +324,7 @@ local SCM CclDefineAi(SCM list) #ifdef DEBUG for( ait=AiTypes->Next; ait; ait=ait->Next ) { if( !strcmp(aitype->Name,ait->Name) ) { - DebugLevel0Fn("Warning two or more AI's with the same name '%s'\n", + DebugLevel0Fn("Warning two or more AI's with the same name '%s'\n" _C_ ait->Name); } } diff --git a/src/game/game.cpp b/src/game/game.cpp index 8e4c935b5..1ec553078 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -273,13 +273,13 @@ global void CreateGame(char* filename, WorldMap* map) IfDebug( DebugLevel0("Graphics uses %d bytes (%d KB, %d MB)\n" - ,AllocatedGraphicMemory - ,AllocatedGraphicMemory/1024 - ,AllocatedGraphicMemory/1024/1024); + _C_ AllocatedGraphicMemory + _C_ AllocatedGraphicMemory/1024 + _C_ AllocatedGraphicMemory/1024/1024); DebugLevel0("Compressed graphics uses %d bytes (%d KB, %d MB)\n" - ,CompressedGraphicMemory - ,CompressedGraphicMemory/1024 - ,CompressedGraphicMemory/1024/1024); + _C_ CompressedGraphicMemory + _C_ CompressedGraphicMemory/1024 + _C_ CompressedGraphicMemory/1024/1024); ); CreateMinimap(); // create minimap for pud @@ -302,13 +302,13 @@ global void CreateGame(char* filename, WorldMap* map) #ifdef WITH_SOUND IfDebug( DebugLevel0("Sounds uses %d bytes (%d KB, %d MB)\n" - ,AllocatedSoundMemory - ,AllocatedSoundMemory/1024 - ,AllocatedSoundMemory/1024/1024); + _C_ AllocatedSoundMemory + _C_ AllocatedSoundMemory/1024 + _C_ AllocatedSoundMemory/1024/1024); DebugLevel0("Compressed sounds uses %d bytes (%d KB, %d MB)\n" - ,CompressedSoundMemory - ,CompressedSoundMemory/1024 - ,CompressedSoundMemory/1024/1024); + _C_ CompressedSoundMemory + _C_ CompressedSoundMemory/1024 + _C_ CompressedSoundMemory/1024/1024); ); #endif diff --git a/src/network/netconnect.cpp b/src/network/netconnect.cpp index c35ee724a..65760659c 100644 --- a/src/network/netconnect.cpp +++ b/src/network/netconnect.cpp @@ -698,10 +698,10 @@ local void NetworkSendRateLimitedClientMessage(InitMessage *msg, long msecs) } n = NetworkSendICMessage(NetworkServerIP, htons(NetworkServerPort), msg); #ifdef DEBUG - DebugLevel0Fn("Sending Init Message (%s:%d): %d:%d(%d) %d.%d.%d.%d:%d\n", - ncconstatenames[NetLocalState], NetStateMsgCnt, msg->Type, - msg->SubType, n, - NIPQUAD(ntohl(NetworkServerIP)), NetworkServerPort); + DebugLevel0Fn("Sending Init Message (%s:%d): %d:%d(%d) %d.%d.%d.%d:%d\n" _C_ + ncconstatenames[NetLocalState] _C_ NetStateMsgCnt _C_ msg->Type _C_ + msg->SubType _C_ n _C_ + NIPQUAD(ntohl(NetworkServerIP)) _C_ NetworkServerPort); #endif } } diff --git a/src/network/network.cpp b/src/network/network.cpp index 96f133d90..5b2c2d01d 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -445,11 +445,11 @@ global void InitNetwork1(void) char buf[128]; gethostname(buf, sizeof(buf)); - DebugLevel0Fn("%s\n", buf); + DebugLevel0Fn("%s\n" _C_ buf); MyHost = NetResolveHost(buf); MyPort = NetLastPort; - DebugLevel0Fn("My host:port %d.%d.%d.%d:%d\n", - NIPQUAD(ntohl(MyHost)), ntohs(MyPort)); + DebugLevel0Fn("My host:port %d.%d.%d.%d:%d\n" _C_ + NIPQUAD(ntohl(MyHost)) _C_ ntohs(MyPort)); }); dl_init(CommandsIn); @@ -465,11 +465,11 @@ global void ExitNetwork1(void) return; } #ifdef DEBUG - DebugLevel0("Received: %d packets, %d early, %d late, %d dups, %d lost.\n", - NetworkReceivedPackets, NetworkReceivedEarly, NetworkReceivedLate, - NetworkReceivedDups,NetworkReceivedLost); - DebugLevel0("Send: %d packets, %d resend\n", - NetworkSendPackets, NetworkSendResend); + DebugLevel0("Received: %d packets, %d early, %d late, %d dups, %d lost.\n" _C_ + NetworkReceivedPackets _C_ NetworkReceivedEarly _C_ NetworkReceivedLate _C_ + NetworkReceivedDups _C_ NetworkReceivedLost); + DebugLevel0("Send: %d packets, %d resend\n" _C_ + NetworkSendPackets _C_ NetworkSendResend); #endif NetCloseUDP(NetworkFildes); @@ -951,7 +951,7 @@ local void NetworkSendCommands(void) && ncq->Data.Type != MessageExtendedCommand) { // FIXME: we can send destoyed units over network :( if (UnitSlots[ntohs(ncq->Data.Unit)]->Destroyed) { - DebugLevel0Fn("Sending destroyed unit %d over network!!!!!!\n", + DebugLevel0Fn("Sending destroyed unit %d over network!!!!!!\n" _C_ ntohs(ncq->Data.Unit)); } } diff --git a/src/stratagus/missile.cpp b/src/stratagus/missile.cpp index ce942f6e5..56d192cb7 100644 --- a/src/stratagus/missile.cpp +++ b/src/stratagus/missile.cpp @@ -254,7 +254,7 @@ global MissileType* MissileTypeByIdent(const char* ident) IfDebug( if( !NoWarningMissileType ) { - DebugLevel0Fn("Missile %s not found\n",ident); + DebugLevel0Fn("Missile %s not found\n" _C_ ident); } ); return NULL; diff --git a/src/stratagus/player.cpp b/src/stratagus/player.cpp index 7c4545495..4000625fc 100644 --- a/src/stratagus/player.cpp +++ b/src/stratagus/player.cpp @@ -1007,10 +1007,10 @@ global void DebugPlayers(void) if( Players[i].Type==PlayerNobody ) { continue; } - DebugLevel0("%2d: %8.8s %c %-8.8s ",i,colors[i] - ,ThisPlayer==&Players[i] ? '*' + DebugLevel0("%2d: %8.8s %c %-8.8s " _C_ i _C_ colors[i] + _C_ ThisPlayer==&Players[i] ? '*' : Players[i].AiEnabled ? '+' : ' ' - ,Players[i].Name); + _C_ Players[i].Name); switch( Players[i].Type ) { case 0: DebugLevel0("Don't know 0 "); break; case 1: DebugLevel0("Don't know 1 "); break; @@ -1025,9 +1025,9 @@ global void DebugPlayers(void) case PlayerRaceHuman: DebugLevel0("human "); break; case PlayerRaceOrc: DebugLevel0("orc "); break; case PlayerRaceNeutral: DebugLevel0("neutral "); break; - default: DebugLevel0("what %d ",Players[i].Race); break; + default: DebugLevel0("what %d " _C_ Players[i].Race); break; } - DebugLevel0("%2d ",Players[i].AiNum); + DebugLevel0("%2d " _C_ Players[i].AiNum); switch( Players[i].AiNum ) { case PlayerAiLand: DebugLevel0("(land)"); break; case PlayerAiPassive: DebugLevel0("(passive)"); break; diff --git a/src/ui/menus.cpp b/src/ui/menus.cpp index 50b9197e8..6fff11391 100644 --- a/src/ui/menus.cpp +++ b/src/ui/menus.cpp @@ -2939,8 +2939,8 @@ local void CampaignGameMenu(void) DebugLevel0Fn("%d campaigns available\n" _C_ NumCampaigns); IfDebug( for( i=0; i<NumCampaigns; ++i ) { - DebugLevel0Fn("Campaign %d: %16.16s: %s\n",i, - Campaigns[i].Ident, + DebugLevel0Fn("Campaign %d: %16.16s: %s\n" _C_ i _C_ + Campaigns[i].Ident _C_ Campaigns[i].Name); } ); diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 66a9256fa..86e8ada58 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -199,8 +199,8 @@ global void ReleaseUnit(Unit* unit) ReleasedTail=&unit->Next; unit->Refs=GameCycle+NetworkMaxLag; // could be reuse after this. IfDebug( - DebugLevel2Fn("%lu:No more references %d\n", - GameCycle,UnitNumber(unit)); + DebugLevel2Fn("%lu:No more references %d\n" _C_ + GameCycle _C_ UnitNumber(unit)); unit->Type=NULL; // for debugging. ); } diff --git a/src/unit/unit_cache.cpp b/src/unit/unit_cache.cpp index 686df50a6..b4a825b9b 100644 --- a/src/unit/unit_cache.cpp +++ b/src/unit/unit_cache.cpp @@ -890,7 +890,7 @@ global int UnitCacheSelect(int x1,int y1,int x2,int y2,Unit** table) IfDebug( if( !unit->Type ) { DebugLevel0Fn("%d,%d: %d, %d,%d\n" - ,i,y,UnitNumber(unit),unit->X,unit->Y); + _C_ i _C_ y _C_ UnitNumber(unit) _C_ unit->X _C_ unit->Y); fflush(stdout); } ); diff --git a/src/unit/unittype.cpp b/src/unit/unittype.cpp index b46982987..b105e309b 100644 --- a/src/unit/unittype.cpp +++ b/src/unit/unittype.cpp @@ -156,7 +156,7 @@ global void ParsePudUDTA(const char* udta,int length __attribute__((unused))) // FIXME: not the fastest, remove UnitTypeByWcNum from loops! IfDebug( if( length!=5694 && length!=5948 ) { - DebugLevel0("\n"__FUNCTION__": ***\n"__FUNCTION__": %d\n",length); + DebugLevel0("\n"__FUNCTION__": ***\n"__FUNCTION__": %d\n" _C_ length); DebugLevel0Fn("***\n\n"); } ) @@ -346,10 +346,10 @@ global void ParsePudUDTA(const char* udta,int length __attribute__((unused))) unittype->Organic=BIT(27,v); #ifdef DEBUG - if( BIT(28,v) ) DebugLevel0("Unused bit 28 used in %d\n",i); - if( BIT(29,v) ) DebugLevel0("Unused bit 29 used in %d\n",i); - if( BIT(30,v) ) DebugLevel0("Unused bit 30 used in %d\n",i); - if( BIT(31,v) ) DebugLevel0("Unused bit 31 used in %d\n",i); + if( BIT(28,v) ) DebugLevel0("Unused bit 28 used in %d\n" _C_ i); + if( BIT(29,v) ) DebugLevel0("Unused bit 29 used in %d\n" _C_ i); + if( BIT(30,v) ) DebugLevel0("Unused bit 30 used in %d\n" _C_ i); + if( BIT(31,v) ) DebugLevel0("Unused bit 31 used in %d\n" _C_ i); #endif #undef BIT } @@ -1194,7 +1194,7 @@ global UnitType* UnitTypeByIdent(const char* ident) IfDebug( if( !NoWarningUnitType ) { - DebugLevel0Fn("Name `%s' not found\n",ident); + DebugLevel0Fn("Name `%s' not found\n" _C_ ident); } );