summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-10 00:31:47 +0000
committerrubidium <rubidium@openttd.org>2009-01-10 00:31:47 +0000
commit28ea38ae5572d99598aa400fb62eb38f5f7ffd7b (patch)
tree29e703244d28f29c8634b2d30f42b34852fe74bc /src/network
parent86d50b6415635d1f1fb87bd62f1e08aa7b8f0033 (diff)
downloadopenttd-28ea38ae5572d99598aa400fb62eb38f5f7ffd7b.tar.xz
(svn r14949) -Cleanup: pointer coding style
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/host.cpp2
-rw-r--r--src/network/core/packet.cpp2
-rw-r--r--src/network/core/packet.h4
-rw-r--r--src/network/network.cpp4
-rw-r--r--src/network/network_client.cpp2
-rw-r--r--src/network/network_func.h2
-rw-r--r--src/network/network_gui.cpp12
-rw-r--r--src/network/network_internal.h2
-rw-r--r--src/network/network_server.cpp12
-rw-r--r--src/network/network_udp.cpp2
-rw-r--r--src/network/network_udp.h2
11 files changed, 23 insertions, 23 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
index beddb6d7e..c88c96f55 100644
--- a/src/network/core/host.cpp
+++ b/src/network/core/host.cpp
@@ -160,7 +160,7 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // !GET
const char *buf_end = buf + ifconf.ifc_len;
int index = 0;
for (const char *p = buf; p < buf_end && index != limit;) {
- const struct ifreq* req = (const struct ifreq*)p;
+ const struct ifreq *req = (const struct ifreq*)p;
if (req->ifr_addr.sa_family == AF_INET) {
struct ifreq r;
diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp
index 62ab4c61a..21d8cf5df 100644
--- a/src/network/core/packet.cpp
+++ b/src/network/core/packet.cpp
@@ -124,7 +124,7 @@ void Packet::Send_uint64(uint64 data)
* the string + '\0'. No size-byte or something.
* @param data the string to send
*/
-void Packet::Send_string(const char* data)
+void Packet::Send_string(const char *data)
{
assert(data != NULL);
/* The <= *is* valid due to the fact that we are comparing sizes and not the index. */
diff --git a/src/network/core/packet.h b/src/network/core/packet.h
index 295c4e8c2..1dd35a70d 100644
--- a/src/network/core/packet.h
+++ b/src/network/core/packet.h
@@ -50,7 +50,7 @@ public:
void Send_uint16(uint16 data);
void Send_uint32(uint32 data);
void Send_uint64(uint64 data);
- void Send_string(const char* data);
+ void Send_string(const char *data);
/* Reading/receiving of packets */
void ReadRawPacketSize();
@@ -62,7 +62,7 @@ public:
uint16 Recv_uint16();
uint32 Recv_uint32();
uint64 Recv_uint64();
- void Recv_string(char* buffer, size_t size);
+ void Recv_string(char *buffer, size_t size);
};
Packet *NetworkSend_Init(PacketType type);
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 04a6e4518..ffda6a1f9 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -251,7 +251,7 @@ static void ServerStartError(const char *error)
NetworkError(STR_NETWORK_ERR_SERVER_START);
}
-static void NetworkClientError(NetworkRecvStatus res, NetworkClientSocket* cs)
+static void NetworkClientError(NetworkRecvStatus res, NetworkClientSocket *cs)
{
// First, send a CLIENT_ERROR to the server, so he knows we are
// disconnection (and why!)
@@ -644,7 +644,7 @@ static void NetworkInitialize()
// Query a server to fetch his game-info
// If game_info is true, only the gameinfo is fetched,
// else only the client_info is fetched
-void NetworkTCPQueryServer(const char* host, unsigned short port)
+void NetworkTCPQueryServer(const char *host, unsigned short port)
{
if (!_network_available) return;
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 23d112ce1..7e44757a7 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -820,7 +820,7 @@ typedef NetworkRecvStatus NetworkClientPacket(Packet *p);
// packet it is matches against this array
// and that way the right function to handle that
// packet is found.
-static NetworkClientPacket* const _network_client_packet[] = {
+static NetworkClientPacket * const _network_client_packet[] = {
RECEIVE_COMMAND(PACKET_SERVER_FULL),
RECEIVE_COMMAND(PACKET_SERVER_BANNED),
NULL, /*PACKET_CLIENT_JOIN,*/
diff --git a/src/network/network_func.h b/src/network/network_func.h
index 51249f8da..237afe851 100644
--- a/src/network/network_func.h
+++ b/src/network/network_func.h
@@ -53,7 +53,7 @@ bool NetworkServerStart();
NetworkClientInfo *NetworkFindClientInfoFromIndex(ClientIndex index);
NetworkClientInfo *NetworkFindClientInfoFromClientID(ClientID client_id);
NetworkClientInfo *NetworkFindClientInfoFromIP(const char *ip);
-const char* GetClientIP(const NetworkClientInfo *ci);
+const char *GetClientIP(const NetworkClientInfo *ci);
void NetworkServerSendRcon(ClientID client_id, ConsoleColour colour_code, const char *string);
void NetworkServerSendError(ClientID client_id, NetworkErrorCode error);
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 7e3483501..f9a4f6bfd 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -150,7 +150,7 @@ protected:
}
/** Sort servers by name. */
- static int CDECL NGameNameSorter(NetworkGameList* const *a, NetworkGameList* const *b)
+ static int CDECL NGameNameSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
return strcasecmp((*a)->info.server_name, (*b)->info.server_name);
}
@@ -158,7 +158,7 @@ protected:
/** Sort servers by the amount of clients online on a
* server. If the two servers have the same amount, the one with the
* higher maximum is preferred. */
- static int CDECL NGameClientSorter(NetworkGameList* const *a, NetworkGameList* const *b)
+ static int CDECL NGameClientSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
/* Reverse as per default we are interested in most-clients first */
int r = (*a)->info.clients_on - (*b)->info.clients_on;
@@ -170,7 +170,7 @@ protected:
}
/** Sort servers by map size */
- static int CDECL NGameMapSizeSorter(NetworkGameList* const *a, NetworkGameList* const *b)
+ static int CDECL NGameMapSizeSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
/* Sort by the area of the map. */
int r = ((*a)->info.map_height) * ((*a)->info.map_width) - ((*b)->info.map_height) * ((*b)->info.map_width);
@@ -180,14 +180,14 @@ protected:
}
/** Sort servers by current date */
- static int CDECL NGameDateSorter(NetworkGameList* const *a, NetworkGameList* const *b)
+ static int CDECL NGameDateSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
int r = (*a)->info.game_date - (*b)->info.game_date;
return (r != 0) ? r : NGameClientSorter(a, b);
}
/** Sort servers by the number of days the game is running */
- static int CDECL NGameYearsSorter(NetworkGameList* const *a, NetworkGameList* const *b)
+ static int CDECL NGameYearsSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
int r = (*a)->info.game_date - (*a)->info.start_date - (*b)->info.game_date + (*b)->info.start_date;
return (r != 0) ? r : NGameDateSorter(a, b);
@@ -195,7 +195,7 @@ protected:
/** Sort servers by joinability. If both servers are the
* same, prefer the non-passworded server first. */
- static int CDECL NGameAllowedSorter(NetworkGameList* const *a, NetworkGameList* const *b)
+ static int CDECL NGameAllowedSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
/* The servers we do not know anything about (the ones that did not reply) should be at the bottom) */
int r = StrEmpty((*a)->info.server_revision) - StrEmpty((*b)->info.server_revision);
diff --git a/src/network/network_internal.h b/src/network/network_internal.h
index d3bb63584..05e373959 100644
--- a/src/network/network_internal.h
+++ b/src/network/network_internal.h
@@ -122,7 +122,7 @@ extern uint16 _network_udp_broadcast;
extern uint8 _network_advertise_retries;
-void NetworkTCPQueryServer(const char* host, unsigned short port);
+void NetworkTCPQueryServer(const char *host, unsigned short port);
void NetworkAddServer(const char *b);
void NetworkRebuildHostList();
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 051c97148..332364385 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -33,7 +33,7 @@
// This file handles all the server-commands
-static void NetworkHandleCommandQueue(NetworkClientSocket* cs);
+static void NetworkHandleCommandQueue(NetworkClientSocket *cs);
// **********
// Sending functions
@@ -1205,7 +1205,7 @@ typedef void NetworkServerPacket(NetworkClientSocket *cs, Packet *p);
// packet it is matches against this array
// and that way the right function to handle that
// packet is found.
-static NetworkServerPacket* const _network_server_packet[] = {
+static NetworkServerPacket * const _network_server_packet[] = {
NULL, /*PACKET_SERVER_FULL,*/
NULL, /*PACKET_SERVER_BANNED,*/
RECEIVE_COMMAND(PACKET_CLIENT_JOIN),
@@ -1420,7 +1420,7 @@ bool NetworkServer_ReadPackets(NetworkClientSocket *cs)
}
// Handle the local command-queue
-static void NetworkHandleCommandQueue(NetworkClientSocket* cs)
+static void NetworkHandleCommandQueue(NetworkClientSocket *cs)
{
CommandPacket *cp;
@@ -1534,7 +1534,7 @@ void NetworkServerChangeOwner(Owner current_owner, Owner new_owner)
}
}
-const char* GetClientIP(const NetworkClientInfo* ci)
+const char *GetClientIP(const NetworkClientInfo *ci)
{
struct in_addr addr;
@@ -1544,7 +1544,7 @@ const char* GetClientIP(const NetworkClientInfo* ci)
void NetworkServerShowStatusToConsole()
{
- static const char* const stat_str[] = {
+ static const char * const stat_str[] = {
"inactive",
"authorizing",
"authorized",
@@ -1559,7 +1559,7 @@ void NetworkServerShowStatusToConsole()
FOR_ALL_CLIENT_SOCKETS(cs) {
int lag = NetworkCalculateLag(cs);
const NetworkClientInfo *ci = cs->GetInfo();
- const char* status;
+ const char *status;
status = (cs->status < (ptrdiff_t)lengthof(stat_str) ? stat_str[cs->status] : "unknown");
IConsolePrintF(CC_INFO, "Client #%1d name: '%s' status: '%s' frame-lag: %3d company: %1d IP: %s unique-id: '%s'",
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 493242bdf..822347b41 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -425,7 +425,7 @@ void NetworkUDPSearchGame()
_network_udp_broadcast = 300; // Stay searching for 300 ticks
}
-void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually)
+void NetworkUDPQueryServer(const char *host, unsigned short port, bool manually)
{
struct sockaddr_in out_addr;
NetworkGameList *item;
diff --git a/src/network/network_udp.h b/src/network/network_udp.h
index 4071ddc0f..48fa4e1e6 100644
--- a/src/network/network_udp.h
+++ b/src/network/network_udp.h
@@ -10,7 +10,7 @@
void NetworkUDPInitialize();
void NetworkUDPSearchGame();
void NetworkUDPQueryMasterServer();
-void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually = false);
+void NetworkUDPQueryServer(const char *host, unsigned short port, bool manually = false);
void NetworkUDPAdvertise();
void NetworkUDPRemoveAdvertise();
void NetworkUDPShutdown();