impr: Code style improvements

This commit is contained in:
WerWolv
2023-12-27 16:33:49 +01:00
parent ec45d1f564
commit 74b5c93caf
64 changed files with 267 additions and 277 deletions

View File

@@ -85,8 +85,8 @@ namespace hex {
s_proxyUrl = std::move(proxy);
}
void HttpRequest::setProxyState(bool state) {
s_proxyState = state;
void HttpRequest::setProxyState(bool enabled) {
s_proxyState = enabled;
}
void HttpRequest::checkProxyErrors() {

View File

@@ -635,13 +635,13 @@ namespace hex::gl {
}
}
void LightSourceVectors::moveTo(const Vector<float, 3> &positionVector) {
void LightSourceVectors::moveTo(const Vector<float, 3> &position) {
auto vertexCount = m_vertices.size();
for (unsigned k = 0; k < vertexCount; k += 3) {
m_vertices[k ] = m_radius * m_normals[k ] + positionVector[0];
m_vertices[k + 1] = m_radius * m_normals[k + 1] + positionVector[1];
m_vertices[k + 2] = m_radius * m_normals[k + 2] + positionVector[2];
m_vertices[k ] = m_radius * m_normals[k ] + position[0];
m_vertices[k + 1] = m_radius * m_normals[k + 1] + position[1];
m_vertices[k + 2] = m_radius * m_normals[k + 2] + position[2];
}
}

View File

@@ -67,8 +67,9 @@ namespace hex {
if (value < 0) {
data[index] = '-';
return { data + index };
} else
} else {
return { data + index + 1 };
}
}
std::string toLower(std::string string) {
@@ -376,9 +377,9 @@ namespace hex {
std::string result;
for (u8 byte : bytes) {
if (std::isprint(byte) && byte != '\\')
if (std::isprint(byte) && byte != '\\') {
result += char(byte);
else {
} else {
switch (byte) {
case '\\':
result += "\\";
@@ -538,9 +539,9 @@ namespace hex {
std::wstring utf16;
for (auto unicode : unicodes) {
if (unicode <= 0xFFFF)
if (unicode <= 0xFFFF) {
utf16 += static_cast<wchar_t>(unicode);
else {
} else {
unicode -= 0x10000;
utf16 += static_cast<wchar_t>(((unicode >> 10) + 0xD800));
utf16 += static_cast<wchar_t>(((unicode & 0x3FF) + 0xDC00));