mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
@@ -34,8 +34,9 @@
|
||||
|
||||
Error StreamPeer::_put_data(const Vector<uint8_t> &p_data) {
|
||||
int len = p_data.size();
|
||||
if (len == 0)
|
||||
if (len == 0) {
|
||||
return OK;
|
||||
}
|
||||
const uint8_t *r = p_data.ptr();
|
||||
return put_data(&r[0], len);
|
||||
}
|
||||
@@ -318,8 +319,9 @@ double StreamPeer::get_double() {
|
||||
}
|
||||
|
||||
String StreamPeer::get_string(int p_bytes) {
|
||||
if (p_bytes < 0)
|
||||
if (p_bytes < 0) {
|
||||
p_bytes = get_u32();
|
||||
}
|
||||
ERR_FAIL_COND_V(p_bytes < 0, String());
|
||||
|
||||
Vector<char> buf;
|
||||
@@ -332,8 +334,9 @@ String StreamPeer::get_string(int p_bytes) {
|
||||
}
|
||||
|
||||
String StreamPeer::get_utf8_string(int p_bytes) {
|
||||
if (p_bytes < 0)
|
||||
if (p_bytes < 0) {
|
||||
p_bytes = get_u32();
|
||||
}
|
||||
ERR_FAIL_COND_V(p_bytes < 0, String());
|
||||
|
||||
Vector<uint8_t> buf;
|
||||
@@ -421,8 +424,9 @@ void StreamPeerBuffer::_bind_methods() {
|
||||
}
|
||||
|
||||
Error StreamPeerBuffer::put_data(const uint8_t *p_data, int p_bytes) {
|
||||
if (p_bytes <= 0)
|
||||
if (p_bytes <= 0) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (pointer + p_bytes > data.size()) {
|
||||
data.resize(pointer + p_bytes);
|
||||
@@ -443,8 +447,9 @@ Error StreamPeerBuffer::put_partial_data(const uint8_t *p_data, int p_bytes, int
|
||||
Error StreamPeerBuffer::get_data(uint8_t *p_buffer, int p_bytes) {
|
||||
int recv;
|
||||
get_partial_data(p_buffer, p_bytes, recv);
|
||||
if (recv != p_bytes)
|
||||
if (recv != p_bytes) {
|
||||
return ERR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user