diff options
Diffstat (limited to 'src/network/core')
-rw-r--r-- | src/network/core/core.c | 2 | ||||
-rw-r--r-- | src/network/core/os_abstraction.h | 4 | ||||
-rw-r--r-- | src/network/core/packet.c | 4 | ||||
-rw-r--r-- | src/network/core/packet.h | 4 | ||||
-rw-r--r-- | src/network/core/tcp.c | 2 | ||||
-rw-r--r-- | src/network/core/udp.c | 6 | ||||
-rw-r--r-- | src/network/core/udp.h | 8 |
7 files changed, 15 insertions, 15 deletions
diff --git a/src/network/core/core.c b/src/network/core/core.c index a4131bdf2..ca953e5f0 100644 --- a/src/network/core/core.c +++ b/src/network/core/core.c @@ -68,7 +68,7 @@ bool NetworkCoreInitialize(void) void NetworkCoreShutdown(void) { #if defined(__MORPHOS__) || defined(__AMIGA__) - /* free allocated ressources */ + /* free allocated resources */ #if defined(__AMIGA__) if (TimerBase != NULL) CloseDevice((struct IORequest*)TimerRequest); // XXX This smells wrong if (TimerRequest != NULL) DeleteIORequest(TimerRequest); diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h index 792c42658..df3cf65b3 100644 --- a/src/network/core/os_abstraction.h +++ b/src/network/core/os_abstraction.h @@ -150,7 +150,7 @@ typedef unsigned long in_addr_t; # endif #endif // __MORPHOS__ || __AMIGA__ -static inline bool SetNonBlocking(int d) +static inline bool SetNonBlocking(const int d) { #ifdef WIN32 u_long nonblocking = 1; @@ -164,7 +164,7 @@ static inline bool SetNonBlocking(int d) #endif } -static inline bool SetNoDelay(int d) +static inline bool SetNoDelay(const int d) { /* XXX should this be done at all? */ #if !defined(BEOS_NET_SERVER) // not implemented on BeOS net_server diff --git a/src/network/core/packet.c b/src/network/core/packet.c index aed0b6299..d75d78c7e 100644 --- a/src/network/core/packet.c +++ b/src/network/core/packet.c @@ -22,7 +22,7 @@ extern void NORETURN CDECL error(const char *str, ...); * @param type the of packet * @return the newly created packet */ -Packet *NetworkSend_Init(PacketType type) +Packet *NetworkSend_Init(const PacketType type) { Packet *packet = malloc(sizeof(Packet)); /* An error is inplace here, because it simply means we ran out of memory. */ @@ -112,7 +112,7 @@ void NetworkSend_string(Packet *packet, const char* data) extern uint CloseConnection(NetworkClientState *cs); /** Is it safe to read from the packet, i.e. didn't we run over the buffer ? */ -static inline bool CanReadFromPacket(NetworkClientState *cs, Packet *packet, uint bytes_to_read) +static inline bool CanReadFromPacket(NetworkClientState *cs, const Packet *packet, const uint bytes_to_read) { /* Don't allow reading from a closed socket */ if (HasClientQuit(cs)) return false; diff --git a/src/network/core/packet.h b/src/network/core/packet.h index a44c6b50e..e42c65d5c 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -21,7 +21,7 @@ typedef struct NetworkClientState NetworkClientState; * @param cs the state to query * @param true if the connection should be considered dropped */ -bool HasClientQuit(NetworkClientState *cs); +bool HasClientQuit(const NetworkClientState *cs); typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint8 PacketType; ///< Identifier for the packet @@ -49,7 +49,7 @@ typedef struct Packet { } Packet; -Packet *NetworkSend_Init(PacketType type); +Packet *NetworkSend_Init(const PacketType type); void NetworkSend_FillPacketSize(Packet *packet); void NetworkSend_uint8 (Packet *packet, uint8 data); void NetworkSend_uint16(Packet *packet, uint16 data); diff --git a/src/network/core/tcp.c b/src/network/core/tcp.c index 807288a86..9261ea049 100644 --- a/src/network/core/tcp.c +++ b/src/network/core/tcp.c @@ -46,7 +46,7 @@ NetworkRecvStatus CloseConnection(NetworkClientState *cs) * @param cs the client to check * @return true if the client has quit */ -bool HasClientQuit(NetworkClientState *cs) +bool HasClientQuit(const NetworkClientState *cs) { return cs->has_quit; } diff --git a/src/network/core/udp.c b/src/network/core/udp.c index 93c24a156..72d600157 100644 --- a/src/network/core/udp.c +++ b/src/network/core/udp.c @@ -20,7 +20,7 @@ * @param broadcast whether to allow broadcast sending/receiving * @return true if the listening succeeded */ -bool NetworkUDPListen(SOCKET *udp, uint32 host, uint16 port, bool broadcast) +bool NetworkUDPListen(SOCKET *udp, const uint32 host, const uint16 port, const bool broadcast) { struct sockaddr_in sin; @@ -85,7 +85,7 @@ void NetworkUDPClose(SOCKET *udp) * @param p the packet to send * @param recv the receiver (target) of the packet */ -void NetworkSendUDP_Packet(SOCKET udp, Packet *p, struct sockaddr_in *recv) +void NetworkSendUDP_Packet(const SOCKET udp, Packet *p, const struct sockaddr_in *recv) { int res; @@ -102,7 +102,7 @@ void NetworkSendUDP_Packet(SOCKET udp, Packet *p, struct sockaddr_in *recv) * Receive a packet at UDP level * @param udp the socket to receive the packet on */ -void NetworkUDPReceive(SOCKET udp) +void NetworkUDPReceive(const SOCKET udp) { struct sockaddr_in client_addr; socklen_t client_len; diff --git a/src/network/core/udp.h b/src/network/core/udp.h index ce8b0e88f..f0d4ed983 100644 --- a/src/network/core/udp.h +++ b/src/network/core/udp.h @@ -16,11 +16,11 @@ ///** Sending/receiving of UDP packets **//// -bool NetworkUDPListen(SOCKET *udp, uint32 host, uint16 port, bool broadcast); +bool NetworkUDPListen(SOCKET *udp, const uint32 host, const uint16 port, const bool broadcast); void NetworkUDPClose(SOCKET *udp); -void NetworkSendUDP_Packet(SOCKET udp, Packet *p, struct sockaddr_in *recv); -void NetworkUDPReceive(SOCKET udp); +void NetworkSendUDP_Packet(const SOCKET udp, Packet *p, const struct sockaddr_in *recv); +void NetworkUDPReceive(const SOCKET udp); /** * Function that is called for every received UDP packet. @@ -28,7 +28,7 @@ void NetworkUDPReceive(SOCKET udp); * @param packet the received packet * @param client_addr the address of the sender of the packet */ -void NetworkHandleUDPPacket(SOCKET udp, Packet *p, struct sockaddr_in *client_addr); +void NetworkHandleUDPPacket(const SOCKET udp, Packet *p, const struct sockaddr_in *client_addr); ///** Sending/receiving of (large) chuncks of UDP packets **//// |