Fixed Debug macros to use _C_ instead of commas
This commit is contained in:
parent
b2561577ef
commit
d122996560
12 changed files with 48 additions and 48 deletions
src
|
@ -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();
|
||||
} );
|
||||
|
||||
|
|
|
@ -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();
|
||||
} );
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -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.
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue