mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java. Also update clang-format settings to always add a line break (even if no braces are used).
This commit is contained in:
@@ -271,7 +271,9 @@ class Texture {
|
||||
|
||||
Texture& operator=(const Texture&) = delete;
|
||||
Texture& operator=(Texture&& oth) {
|
||||
if (m_texture) DeleteTexture(m_texture);
|
||||
if (m_texture) {
|
||||
DeleteTexture(m_texture);
|
||||
}
|
||||
m_texture = oth.m_texture;
|
||||
oth.m_texture = 0;
|
||||
m_format = oth.m_format;
|
||||
@@ -281,7 +283,9 @@ class Texture {
|
||||
}
|
||||
|
||||
~Texture() {
|
||||
if (m_texture) DeleteTexture(m_texture);
|
||||
if (m_texture) {
|
||||
DeleteTexture(m_texture);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -351,8 +355,9 @@ class Texture {
|
||||
static Texture CreateFromFile(const char* filename) {
|
||||
Texture texture;
|
||||
if (!CreateTextureFromFile(filename, &texture.m_texture, &texture.m_width,
|
||||
&texture.m_height))
|
||||
&texture.m_height)) {
|
||||
return {};
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
|
||||
@@ -367,8 +372,9 @@ class Texture {
|
||||
static Texture CreateFromImage(const unsigned char* data, int len) {
|
||||
Texture texture;
|
||||
if (!CreateTextureFromImage(data, len, &texture.m_texture, &texture.m_width,
|
||||
&texture.m_height))
|
||||
&texture.m_height)) {
|
||||
return {};
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user