diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-12-15 16:05:42 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-12-15 17:14:17 +0100 |
commit | 92067b4714eaf0d2a9be6b4fc50cc9e156c74cad (patch) | |
tree | 7b50d25b88ba333ecd9d39d97400d27285c6edce /platform | |
parent | 72d5ae84b30c805692e132e2103e14e6cc304e34 (diff) |
Remove "const" from PacketPeer get_packet/get_var
They are NOT constant methods, as state by the comment message,
they fetch the last packet and then forget about it, actively
changing the state of the object.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/windows/packet_peer_udp_winsock.cpp | 2 | ||||
-rw-r--r-- | platform/windows/packet_peer_udp_winsock.h | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index d414ec891e..68ea9e8408 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -43,7 +43,7 @@ int PacketPeerUDPWinsock::get_available_packet_count() const { return queue_count; } -Error PacketPeerUDPWinsock::get_packet(const uint8_t **r_buffer, int &r_buffer_size) const { +Error PacketPeerUDPWinsock::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { Error err = const_cast<PacketPeerUDPWinsock *>(this)->_poll(false); if (err != OK) diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h index 8a6951fd6e..eccf9442d4 100644 --- a/platform/windows/packet_peer_udp_winsock.h +++ b/platform/windows/packet_peer_udp_winsock.h @@ -39,12 +39,12 @@ class PacketPeerUDPWinsock : public PacketPeerUDP { PACKET_BUFFER_SIZE = 65536 }; - mutable RingBuffer<uint8_t> rb; + RingBuffer<uint8_t> rb; uint8_t recv_buffer[PACKET_BUFFER_SIZE]; - mutable uint8_t packet_buffer[PACKET_BUFFER_SIZE]; - mutable IP_Address packet_ip; - mutable int packet_port; - mutable int queue_count; + uint8_t packet_buffer[PACKET_BUFFER_SIZE]; + IP_Address packet_ip; + int packet_port; + int queue_count; int sockfd; bool sock_blocking; IP::Type sock_type; @@ -62,7 +62,7 @@ class PacketPeerUDPWinsock : public PacketPeerUDP { public: virtual int get_available_packet_count() const; - virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) const; + virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size); virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size); virtual int get_max_packet_size() const; |