You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Style: Replaces uses of 0/NULL by nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
@@ -41,7 +41,7 @@ WebSocketMultiplayerPeer::WebSocketMultiplayerPeer() {
|
||||
_current_packet.source = 0;
|
||||
_current_packet.destination = 0;
|
||||
_current_packet.size = 0;
|
||||
_current_packet.data = NULL;
|
||||
_current_packet.data = nullptr;
|
||||
}
|
||||
|
||||
WebSocketMultiplayerPeer::~WebSocketMultiplayerPeer() {
|
||||
@@ -69,12 +69,12 @@ int WebSocketMultiplayerPeer::_gen_unique_id() const {
|
||||
}
|
||||
void WebSocketMultiplayerPeer::_clear() {
|
||||
_peer_map.clear();
|
||||
if (_current_packet.data != NULL)
|
||||
if (_current_packet.data != nullptr)
|
||||
memfree(_current_packet.data);
|
||||
|
||||
for (List<Packet>::Element *E = _incoming_packets.front(); E; E = E->next()) {
|
||||
memfree(E->get().data);
|
||||
E->get().data = NULL;
|
||||
E->get().data = nullptr;
|
||||
}
|
||||
|
||||
_incoming_packets.clear();
|
||||
@@ -101,9 +101,9 @@ Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buff
|
||||
|
||||
r_buffer_size = 0;
|
||||
|
||||
if (_current_packet.data != NULL) {
|
||||
if (_current_packet.data != nullptr) {
|
||||
memfree(_current_packet.data);
|
||||
_current_packet.data = NULL;
|
||||
_current_packet.data = nullptr;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_V(_incoming_packets.size() == 0, ERR_UNAVAILABLE);
|
||||
|
||||
Reference in New Issue
Block a user