Core: Drop custom copymem/zeromem defines

We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.

Backport of #48239.
This commit is contained in:
Rémi Verschelde 2021-04-29 12:34:11 +02:00
parent 1db31d0afa
commit 70ae90e0e8
No known key found for this signature in database
GPG key ID: C3336907360768E1
66 changed files with 173 additions and 242 deletions

View file

@ -193,10 +193,10 @@ PoolVector<uint8_t> WebSocketMultiplayerPeer::_make_pkt(uint8_t p_type, int32_t
out.resize(PROTO_SIZE + p_data_size);
PoolVector<uint8_t>::Write w = out.write();
copymem(&w[0], &p_type, 1);
copymem(&w[1], &p_from, 4);
copymem(&w[5], &p_to, 4);
copymem(&w[PROTO_SIZE], p_data, p_data_size);
memcpy(&w[0], &p_type, 1);
memcpy(&w[1], &p_from, 4);
memcpy(&w[5], &p_to, 4);
memcpy(&w[PROTO_SIZE], p_data, p_data_size);
return out;
}
@ -235,7 +235,7 @@ void WebSocketMultiplayerPeer::_store_pkt(int32_t p_source, int32_t p_dest, cons
packet.size = p_data_size;
packet.source = p_source;
packet.destination = p_dest;
copymem(packet.data, &p_data[PROTO_SIZE], p_data_size);
memcpy(packet.data, &p_data[PROTO_SIZE], p_data_size);
_incoming_packets.push_back(packet);
emit_signal("peer_packet", p_source);
}
@ -290,9 +290,9 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u
uint8_t type = 0;
uint32_t from = 0;
int32_t to = 0;
copymem(&type, in_buffer, 1);
copymem(&from, &in_buffer[1], 4);
copymem(&to, &in_buffer[5], 4);
memcpy(&type, in_buffer, 1);
memcpy(&from, &in_buffer[1], 4);
memcpy(&to, &in_buffer[5], 4);
if (is_server()) { // Server can resend
@ -328,7 +328,7 @@ void WebSocketMultiplayerPeer::_process_multiplayer(Ref<WebSocketPeer> p_peer, u
// System message
ERR_FAIL_COND(data_size < 4);
int id = 0;
copymem(&id, &in_buffer[PROTO_SIZE], 4);
memcpy(&id, &in_buffer[PROTO_SIZE], 4);
switch (type) {