Skip to content

Commit

Permalink
Remove NETnull() function, which was potentially confusing.
Browse files Browse the repository at this point in the history
NETnull() was equivalent to uint32_t zero = 0; NETuint32_t(&zero);, which no longer adds/removes 4 bytes of padding as advertised.
  • Loading branch information
Cyp committed Oct 23, 2010
1 parent db58c7c commit e8ebb11
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
10 changes: 0 additions & 10 deletions lib/netplay/nettypes.cpp
Expand Up @@ -638,16 +638,6 @@ void NETbool(BOOL *bp)
*bp = !!i;
}

/*
* NETnull should be used to either add 4 bytes of padding to a message, or to
* discard 4 bytes of data from a message.
*/
void NETnull()
{
uint32_t zero = 0;
NETuint32_t(&zero);
}

/** Sends or receives a string to or from the current network package.
* \param str When encoding a packet this is the (NUL-terminated string to
* be sent in the current network package. When decoding this
Expand Down
1 change: 0 additions & 1 deletion lib/netplay/nettypes.h
Expand Up @@ -93,7 +93,6 @@ void NETint64_t(int64_t *ip);
void NETuint64_t(uint64_t *ip);
void NETfloat(float* fp);
void NETbool(BOOL *bp);
void NETnull(void);
void NETstring(char *str, uint16_t maxlen);
void NETbin(uint8_t *str, uint32_t maxlen);

Expand Down
3 changes: 2 additions & 1 deletion src/multistruct.c
Expand Up @@ -84,7 +84,8 @@ BOOL sendBuildStarted(STRUCTURE *psStruct, DROID *psDroid)
}
else
{
NETnull();
uint32_t zero = 0;
NETuint32_t(&zero);
}

return NETend();
Expand Down

0 comments on commit e8ebb11

Please sign in to comment.