Some general code cleanup.

This commit is contained in:
Leon Styhre 2021-01-25 18:07:11 +01:00
parent 2c316e25c7
commit 8f32be00b4
10 changed files with 31 additions and 31 deletions

View file

@ -256,7 +256,7 @@ void updateGamelist(SystemData* system)
std::vector<FileData*> files = rootFolder->getFilesRecursive(GAME | FOLDER);
// Iterate through all files, checking if they're already in the XML file.
for (std::vector<FileData*>::const_iterator fit = files.cbegin();
fit != files.cend(); ++fit) {
fit != files.cend(); fit++) {
const std::string tag = ((*fit)->getType() == GAME) ? "game" : "folder";
// Do not touch if it wasn't changed and is not flagged for deletion.
@ -282,7 +282,7 @@ void updateGamelist(SystemData* system)
// Found it
root.remove_child(fileNode);
if ((*fit)->getDeletionFlag())
++numUpdated;
numUpdated++;
break;
}
}
@ -291,7 +291,7 @@ void updateGamelist(SystemData* system)
if (!(*fit)->getDeletionFlag()) {
addFileDataNode(root, *fit, tag, system);
(*fit)->metadata.resetChangedFlag();
++numUpdated;
numUpdated++;
}
}

View file

@ -135,7 +135,7 @@ CECInput::CECInput() : mlibCEC(nullptr)
return;
}
for (int i = 0; i < numAdapters; ++i)
for (int i = 0; i < numAdapters; i++)
LOG(LogDebug) << "CEC adapter: " << i << " path: " << adapters[i].strComPath <<
" name: " << adapters[i].strComName;

View file

@ -38,10 +38,10 @@ namespace Scripting
scriptDirList.push_back(scriptDir);
for (std::list<std::string>::const_iterator dirIt = scriptDirList.cbegin();
dirIt != scriptDirList.cend(); ++dirIt) {
dirIt != scriptDirList.cend(); dirIt++) {
std::list<std::string> scripts = Utils::FileSystem::getDirContent(*dirIt);
for (std::list<std::string>::const_iterator it = scripts.cbegin();
it != scripts.cend(); ++it) {
it != scripts.cend(); it++) {
std::string arg1Quotation;
std::string arg2Quotation;
// Add quotation marks around the arguments as long as these are not already

View file

@ -356,7 +356,7 @@ void ThemeData::parseVariables(const pugi::xml_node& root)
if (!variables)
return;
for (pugi::xml_node_iterator it = variables.begin(); it != variables.end(); ++it) {
for (pugi::xml_node_iterator it = variables.begin(); it != variables.end(); it++) {
std::string key = it->name();
std::string val = it->text().as_string();
@ -632,7 +632,7 @@ std::map<std::string, ThemeSet> ThemeData::getThemeSets()
Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(paths[i]);
for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin();
it != dirContent.cend(); ++it) {
it != dirContent.cend(); it++) {
if (Utils::FileSystem::isDirectory(*it)) {
ThemeSet set = {*it};
sets[set.getName()] = set;

View file

@ -321,16 +321,16 @@ void ImageComponent::updateVertices()
updateColors();
// Round vertices.
for (int i = 0; i < 4; ++i)
for (int i = 0; i < 4; i++)
mVertices[i].pos.round();
if (mFlipX) {
for (int i = 0; i < 4; ++i)
for (int i = 0; i < 4; i++)
mVertices[i].tex[0] = px - mVertices[i].tex[0];
}
if (mFlipY) {
for (int i = 0; i < 4; ++i)
for (int i = 0; i < 4; i++)
mVertices[i].tex[1] = py - mVertices[i].tex[1];
}
}

View file

@ -136,7 +136,7 @@ void RatingComponent::updateVertices()
// Disabled this code as it caused subtle but strange rendering errors
// where the icons changed size slightly when changing rating scores.
// // Round vertices.
// for (int i = 0; i < 8; ++i)
// for (int i = 0; i < 8; i++)
// mVertices[i].pos.round();
}
@ -144,7 +144,7 @@ void RatingComponent::updateColors()
{
const unsigned int color = Renderer::convertRGBAToABGR(mColorShift);
for (int i = 0; i < 8; ++i)
for (int i = 0; i < 8; i++)
mVertices[i].col = color;
}
@ -166,7 +166,7 @@ void RatingComponent::render(const Transform4x4f& parentTrans)
if (mUnfilledTexture->bind()) {
if (mUnfilledColor != mColorShift) {
const unsigned int color = Renderer::convertRGBAToABGR(mUnfilledColor);
for (int i = 0; i < 8; ++i)
for (int i = 0; i < 8; i++)
mVertices[i].col = color;
}

View file

@ -194,7 +194,7 @@ void VideoVlcComponent::render(const Transform4x4f& parentTrans)
vertices[3] = { { mSize.x(), mSize.y() }, { 1.0f, 1.0f }, color };
// Round vertices.
for (int i = 0; i < 4; ++i)
for (int i = 0; i < 4; i++)
vertices[i].pos.round();
// Build a texture for the video frame.
@ -316,7 +316,7 @@ void VideoVlcComponent::startVideo()
libvlc_media_track_t** tracks;
track_count = libvlc_media_tracks_get(mMedia, &tracks);
for (unsigned track = 0; track < track_count; ++track) {
for (unsigned track = 0; track < track_count; track++) {
if (tracks[track]->i_type == libvlc_track_video) {
mVideoWidth = tracks[track]->video->i_width;
mVideoHeight = tracks[track]->video->i_height;

View file

@ -308,10 +308,10 @@ namespace Utils
if ((offset == 0) || (path[offset - 1] != '\\')) {
path.insert(offset, 1, '\\');
++start;
start++;
}
}
++invalidChar;
invalidChar++;
}
return path;
#endif
@ -334,7 +334,7 @@ namespace Utils
scan = false;
for (stringList::const_iterator it = pathList.cbegin();
it != pathList.cend(); ++it) {
it != pathList.cend(); it++) {
// Ignore empty.
if ((*it).empty())
continue;
@ -369,7 +369,7 @@ namespace Utils
else
path = getParent(path) + "/" + resolved;
for (++it; it != pathList.cend(); ++it)
for (++it; it != pathList.cend(); it++)
path += (path.size() == 0) ? (*it) : ("/" + (*it));
scan = true;

View file

@ -113,7 +113,7 @@ namespace Utils
size_t result = _cursor;
while (result < _string.length()) {
++result;
result++;
// Break if current character is not 10xxxxxx
if ((_string[result] & 0xC0) != 0x80)
@ -143,11 +143,11 @@ namespace Utils
size_t result = _cursor;
if (_amount > 0) {
for (int i = 0; i < _amount; ++i)
for (int i = 0; i < _amount; i++)
result = nextCursor(_string, result);
}
else if (_amount < 0) {
for (int i = _amount; i < 0; ++i)
for (int i = _amount; i < 0; i++)
result = prevCursor(_string, result);
}
@ -158,7 +158,7 @@ namespace Utils
{
std::string string;
for (size_t i = 0; i < _string.length(); ++i)
for (size_t i = 0; i < _string.length(); i++)
string += static_cast<char>(tolower(_string[i]));
return string;
@ -168,7 +168,7 @@ namespace Utils
{
std::string string;
for (size_t i = 0; i < _string.length(); ++i)
for (size_t i = 0; i < _string.length(); i++)
string += static_cast<char>(toupper(_string[i]));
return string;
@ -292,7 +292,7 @@ namespace Utils
std::sort(_vector.begin(), _vector.end());
for (std::vector<std::string>::const_iterator it = _vector.cbegin();
it != _vector.cend(); ++it)
it != _vector.cend(); it++)
string += (string.length() ? "," : "") + (*it);
return string;
@ -326,7 +326,7 @@ namespace Utils
{
std::string buffer = _input;
for (size_t i = 0; i < _input.size(); ++i)
for (size_t i = 0; i < _input.size(); i++)
buffer[i] = _input[i] ^ _key[i];
return buffer;

View file

@ -94,7 +94,7 @@ namespace Utils
while (*f && (parsedChars < _string.length())) {
if (*f == '%') {
++f;
f++;
switch (*f++) {
// The year [1970,xxxx]
@ -165,8 +165,8 @@ namespace Utils
}
}
else {
++s;
++f;
s++;
f++;
}
}
return mktime(&timeStruct);
@ -186,7 +186,7 @@ namespace Utils
while (*f) {
if (*f == '%') {
++f;
f++;
switch (*f++) {
// The year, including the century (1900)