You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
#include "core/io/ip.h"
|
||||
|
||||
void EMWSPeer::set_sock(int p_sock, unsigned int p_in_buf_size, unsigned int p_in_pkt_size) {
|
||||
|
||||
peer_sock = p_sock;
|
||||
_in_buffer.resize(p_in_pkt_size, p_in_buf_size);
|
||||
_packet_buffer.resize((1 << p_in_buf_size));
|
||||
@@ -49,13 +48,11 @@ EMWSPeer::WriteMode EMWSPeer::get_write_mode() const {
|
||||
}
|
||||
|
||||
Error EMWSPeer::read_msg(uint8_t *p_data, uint32_t p_size, bool p_is_string) {
|
||||
|
||||
uint8_t is_string = p_is_string ? 1 : 0;
|
||||
return _in_buffer.write_packet(p_data, p_size, &is_string);
|
||||
}
|
||||
|
||||
Error EMWSPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
|
||||
|
||||
int is_bin = write_mode == WebSocketPeer::WRITE_MODE_BINARY ? 1 : 0;
|
||||
|
||||
/* clang-format off */
|
||||
@@ -86,7 +83,6 @@ Error EMWSPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
|
||||
};
|
||||
|
||||
Error EMWSPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
|
||||
|
||||
if (_in_buffer.packets_left() == 0)
|
||||
return ERR_UNAVAILABLE;
|
||||
|
||||
@@ -101,22 +97,18 @@ Error EMWSPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
|
||||
};
|
||||
|
||||
int EMWSPeer::get_available_packet_count() const {
|
||||
|
||||
return _in_buffer.packets_left();
|
||||
};
|
||||
|
||||
bool EMWSPeer::was_string_packet() const {
|
||||
|
||||
return _is_string;
|
||||
};
|
||||
|
||||
bool EMWSPeer::is_connected_to_host() const {
|
||||
|
||||
return peer_sock != -1;
|
||||
};
|
||||
|
||||
void EMWSPeer::close(int p_code, String p_reason) {
|
||||
|
||||
if (peer_sock != -1) {
|
||||
/* clang-format off */
|
||||
EM_ASM({
|
||||
@@ -134,17 +126,14 @@ void EMWSPeer::close(int p_code, String p_reason) {
|
||||
};
|
||||
|
||||
IP_Address EMWSPeer::get_connected_host() const {
|
||||
|
||||
ERR_FAIL_V_MSG(IP_Address(), "Not supported in HTML5 export.");
|
||||
};
|
||||
|
||||
uint16_t EMWSPeer::get_connected_port() const {
|
||||
|
||||
ERR_FAIL_V_MSG(0, "Not supported in HTML5 export.");
|
||||
};
|
||||
|
||||
void EMWSPeer::set_no_delay(bool p_enabled) {
|
||||
|
||||
ERR_FAIL_MSG("'set_no_delay' is not supported in HTML5 export.");
|
||||
}
|
||||
|
||||
@@ -155,7 +144,6 @@ EMWSPeer::EMWSPeer() {
|
||||
};
|
||||
|
||||
EMWSPeer::~EMWSPeer() {
|
||||
|
||||
close();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user