diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-04-20 00:12:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 00:12:52 +0200 |
commit | f98bbe193e0093aca8d8957cec82fdbd28639915 (patch) | |
tree | 19879fbca595d4e8cddfa8d7d069b7f78016a713 /src/network | |
parent | f3fe62a0bf9e775b3e6e838f104ab605a2238792 (diff) | |
download | minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.tar.gz minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.tar.bz2 minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.zip |
Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions
* Make some functions around const ref changes const
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/connection.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/connection.h b/src/network/connection.h index 5ee53b9d4..7ba0d086e 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -383,7 +383,7 @@ struct OutgoingPacket bool reliable; bool ack; - OutgoingPacket(u16 peer_id_, u8 channelnum_, SharedBuffer<u8> data_, + OutgoingPacket(u16 peer_id_, u8 channelnum_, const SharedBuffer<u8> &data_, bool reliable_,bool ack_=false): peer_id(peer_id_), channelnum(channelnum_), @@ -448,7 +448,7 @@ struct ConnectionCommand reliable = reliable_; } - void ack(u16 peer_id_, u8 channelnum_, SharedBuffer<u8> data_) + void ack(u16 peer_id_, u8 channelnum_, const SharedBuffer<u8> &data_) { type = CONCMD_ACK; peer_id = peer_id_; @@ -457,7 +457,7 @@ struct ConnectionCommand reliable = false; } - void createPeer(u16 peer_id_, SharedBuffer<u8> data_) + void createPeer(u16 peer_id_, const SharedBuffer<u8> &data_) { type = CONCMD_CREATE_PEER; peer_id = peer_id_; @@ -467,7 +467,7 @@ struct ConnectionCommand raw = true; } - void disableLegacy(u16 peer_id_, SharedBuffer<u8> data_) + void disableLegacy(u16 peer_id_, const SharedBuffer<u8> &data_) { type = CONCMD_DISABLE_LEGACY; peer_id = peer_id_; @@ -874,7 +874,7 @@ struct ConnectionEvent return "Invalid ConnectionEvent"; } - void dataReceived(u16 peer_id_, SharedBuffer<u8> data_) + void dataReceived(u16 peer_id_, const SharedBuffer<u8> &data_) { type = CONNEVENT_DATA_RECEIVED; peer_id = peer_id_; |