* Make some functions const correct

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3151 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-12-24 11:59:47 +00:00
parent 97991eab77
commit e8be7978e6
4 changed files with 60 additions and 53 deletions

View File

@ -496,7 +496,7 @@ BOOL recvAlliance(BOOL allowAudio)
// ////////////////////////////////////////////////////////////////////////////
// add an artifact on destruction if required.
void technologyGiveAway(STRUCTURE *pS)
void technologyGiveAway(const STRUCTURE *pS)
{
int i;
uint8_t count = 1;
@ -528,12 +528,19 @@ void technologyGiveAway(STRUCTURE *pS)
}
NETbeginEncode(NET_ARTIFACTS, NET_ALL_PLAYERS);
{
/* Make sure that we don't have to violate the constness of pS.
* Since the nettype functions aren't const correct when sending
*/
uint8_t player = pS->player;
NETuint8_t(&count);
NETenum(&type);
NETuint32_t(&x);
NETuint32_t(&y);
NETuint32_t(&pF->id);
NETuint8_t(&pS->player);
NETuint8_t(&player);
}
NETend();
}

View File

@ -33,7 +33,7 @@ extern void createTeamAlliances (void);
extern BOOL sendGift (uint8_t type, uint8_t to);
extern BOOL recvGift ();
extern void technologyGiveAway (STRUCTURE *pS);
extern void technologyGiveAway (const STRUCTURE* pS);
extern void recvMultiPlayerRandomArtifacts ();
extern void addMultiPlayerRandomArtifacts (uint8_t quantity, FEATURE_TYPE type);
extern void processMultiPlayerArtifacts (void);

View File

@ -234,10 +234,10 @@ extern BOOL multiplayerWinSequence(BOOL firstCall);
// definitions of functions in multiplay's other c files.
// Buildings . multistruct
extern BOOL sendBuildStarted (STRUCTURE *psStruct,DROID *psDroid);
extern BOOL SendDestroyStructure(STRUCTURE *s);
extern BOOL SendBuildFinished (STRUCTURE *psStruct);
extern BOOL sendLasSat (UBYTE player,STRUCTURE *psStruct, BASE_OBJECT *psObj);
extern BOOL sendBuildStarted (const STRUCTURE* psStruct, const DROID* psDroid);
extern BOOL SendDestroyStructure(const STRUCTURE* s);
extern BOOL SendBuildFinished (const STRUCTURE* psStruct);
extern BOOL sendLasSat (UBYTE player, const STRUCTURE* psStruct, const BASE_OBJECT* psObj);
// droids . multibot

View File

@ -52,7 +52,7 @@
// ////////////////////////////////////////////////////////////////////////////
// INFORM others that a building has been started, and base plate should be put down.
BOOL sendBuildStarted(STRUCTURE *psStruct,DROID *psDroid)
BOOL sendBuildStarted(const STRUCTURE* psStruct, const DROID* psDroid)
{
NETMSG msg;
UDWORD zero=0;
@ -153,7 +153,7 @@ BOOL recvBuildStarted(NETMSG *pMsg)
// ////////////////////////////////////////////////////////////////////////////
// INFORM others that a building has been completed.
BOOL SendBuildFinished(STRUCTURE *psStruct)
BOOL SendBuildFinished(const STRUCTURE* psStruct)
{
NETMSG m;
@ -286,7 +286,7 @@ BOOL recvDemolishFinished(NETMSG *m)
// ////////////////////////////////////////////////////////////////////////////
// Inform others that a structure has been destroyed
BOOL SendDestroyStructure(STRUCTURE *s)
BOOL SendDestroyStructure(const STRUCTURE* s)
{
NETMSG m;
@ -325,7 +325,7 @@ BOOL recvDestroyStructure(NETMSG * m)
// ////////////////////////////////////////////////////////////////////////////
//lassat is firing
BOOL sendLasSat(UBYTE player,STRUCTURE *psStruct, BASE_OBJECT *psObj)
BOOL sendLasSat(UBYTE player, const STRUCTURE* psStruct, const BASE_OBJECT* psObj)
{
NETMSG msg;
UBYTE p;