From cb282c6ef0bb91957f8a6f422705813bd47c788c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 17 Mar 2020 07:33:00 +0100 Subject: Style: Set clang-format Standard to Cpp11 For us, it practically only changes the fact that `A>` is now used instead of the C++03 compatible `A >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`. --- modules/webrtc/webrtc_multiplayer.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'modules/webrtc/webrtc_multiplayer.cpp') diff --git a/modules/webrtc/webrtc_multiplayer.cpp b/modules/webrtc/webrtc_multiplayer.cpp index 9df2420bbc..c24ae3468f 100644 --- a/modules/webrtc/webrtc_multiplayer.cpp +++ b/modules/webrtc/webrtc_multiplayer.cpp @@ -70,7 +70,7 @@ void WebRTCMultiplayer::poll() { List remove; List add; - for (Map >::Element *E = peer_map.front(); E; E = E->next()) { + for (Map>::Element *E = peer_map.front(); E; E = E->next()) { Ref peer = E->get(); peer->connection->poll(); // Check peer state @@ -89,7 +89,7 @@ void WebRTCMultiplayer::poll() { } // Check channels state int ready = 0; - for (List >::Element *C = peer->channels.front(); C && C->get().is_valid(); C = C->next()) { + for (List>::Element *C = peer->channels.front(); C && C->get().is_valid(); C = C->next()) { Ref ch = C->get(); switch (ch->get_ready_state()) { case WebRTCDataChannel::STATE_CONNECTING: @@ -130,7 +130,7 @@ void WebRTCMultiplayer::poll() { emit_signal("peer_connected", TARGET_PEER_SERVER); emit_signal("connection_succeeded"); // Notify of all previously connected peers - for (Map >::Element *F = peer_map.front(); F; F = F->next()) { + for (Map>::Element *F = peer_map.front(); F; F = F->next()) { if (F->key() != 1 && F->get()->connected) emit_signal("peer_connected", F->key()); } @@ -143,11 +143,11 @@ void WebRTCMultiplayer::poll() { } void WebRTCMultiplayer::_find_next_peer() { - Map >::Element *E = peer_map.find(next_packet_peer); + Map>::Element *E = peer_map.find(next_packet_peer); if (E) E = E->next(); // After last. while (E) { - for (List >::Element *F = E->get()->channels.front(); F; F = F->next()) { + for (List>::Element *F = E->get()->channels.front(); F; F = F->next()) { if (F->get()->get_available_packet_count()) { next_packet_peer = E->key(); return; @@ -158,7 +158,7 @@ void WebRTCMultiplayer::_find_next_peer() { E = peer_map.front(); // Before last while (E) { - for (List >::Element *F = E->get()->channels.front(); F; F = F->next()) { + for (List>::Element *F = E->get()->channels.front(); F; F = F->next()) { if (F->get()->get_available_packet_count()) { next_packet_peer = E->key(); return; @@ -204,7 +204,7 @@ int WebRTCMultiplayer::get_unique_id() const { void WebRTCMultiplayer::_peer_to_dict(Ref p_connected_peer, Dictionary &r_dict) { Array channels; - for (List >::Element *F = p_connected_peer->channels.front(); F; F = F->next()) { + for (List>::Element *F = p_connected_peer->channels.front(); F; F = F->next()) { channels.push_back(F->get()); } r_dict["connection"] = p_connected_peer->connection; @@ -225,7 +225,7 @@ Dictionary WebRTCMultiplayer::get_peer(int p_peer_id) { Dictionary WebRTCMultiplayer::get_peers() { Dictionary out; - for (Map >::Element *E = peer_map.front(); E; E = E->next()) { + for (Map>::Element *E = peer_map.front(); E; E = E->next()) { Dictionary d; _peer_to_dict(E->get(), d); out[E->key()] = d; @@ -288,7 +288,7 @@ Error WebRTCMultiplayer::get_packet(const uint8_t **r_buffer, int &r_buffer_size _find_next_peer(); ERR_FAIL_V(ERR_UNAVAILABLE); } - for (List >::Element *E = peer_map[next_packet_peer]->channels.front(); E; E = E->next()) { + for (List>::Element *E = peer_map[next_packet_peer]->channels.front(); E; E = E->next()) { if (E->get()->get_available_packet_count()) { Error err = E->get()->get_packet(r_buffer, r_buffer_size); _find_next_peer(); @@ -316,7 +316,7 @@ Error WebRTCMultiplayer::put_packet(const uint8_t *p_buffer, int p_buffer_size) break; } - Map >::Element *E = NULL; + Map>::Element *E = NULL; if (target_peer > 0) { @@ -330,7 +330,7 @@ Error WebRTCMultiplayer::put_packet(const uint8_t *p_buffer, int p_buffer_size) } else { int exclude = -target_peer; - for (Map >::Element *F = peer_map.front(); F; F = F->next()) { + for (Map>::Element *F = peer_map.front(); F; F = F->next()) { // Exclude packet. If target_peer == 0 then don't exclude any packets if (target_peer != 0 && F->key() == exclude) @@ -347,8 +347,8 @@ int WebRTCMultiplayer::get_available_packet_count() const { if (next_packet_peer == 0) return 0; // To be sure next call to get_packet works if size > 0 . int size = 0; - for (Map >::Element *E = peer_map.front(); E; E = E->next()) { - for (List >::Element *F = E->get()->channels.front(); F; F = F->next()) { + for (Map>::Element *E = peer_map.front(); E; E = E->next()) { + for (List>::Element *F = E->get()->channels.front(); F; F = F->next()) { size += F->get()->get_available_packet_count(); } } -- cgit v1.2.3