From 5cc6bafd7db7ccd8e3f5e82cb11940cfffab2b4d Mon Sep 17 00:00:00 2001 From: Tomas Jakobsson Date: Sat, 9 Mar 2019 00:23:13 +0100 Subject: [PATCH] Silence warnings --- es-app/src/CollectionSystemManager.cpp | 2 +- es-app/src/scrapers/GamesDBJSONScraper.cpp | 10 +++++----- es-app/src/scrapers/ScreenScraper.cpp | 4 ++-- es-app/src/views/UIModeController.cpp | 2 +- es-app/src/views/ViewController.cpp | 2 +- es-app/src/views/gamelist/GridGameListView.cpp | 2 +- es-core/src/components/GridTileComponent.cpp | 2 +- es-core/src/components/ImageGridComponent.h | 10 +++++----- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index e40a894b5..cb5e2481d 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -292,7 +292,7 @@ void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionS void CollectionSystemManager::trimCollectionCount(FileData* rootFolder, int limit) { SystemData* curSys = rootFolder->getSystem(); - while (rootFolder->getChildren().size() > limit) + while ((int)rootFolder->getChildren().size() > limit) { CollectionFileData* gameToRemove = (CollectionFileData*)rootFolder->getChildrenListToDisplay().back(); ViewController::get()->getGameListView(curSys).get()->remove(gameToRemove, false); diff --git a/es-app/src/scrapers/GamesDBJSONScraper.cpp b/es-app/src/scrapers/GamesDBJSONScraper.cpp index 8935c3833..ad4ddbf60 100644 --- a/es-app/src/scrapers/GamesDBJSONScraper.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraper.cpp @@ -199,7 +199,7 @@ std::string getBoxartImage(const Value& v) { return ""; } - for (int i = 0; i < v.Size(); ++i) + for (int i = 0; i < (int)v.Size(); ++i) { auto& im = v[i]; std::string type = getStringOrThrow(im, "type"); @@ -220,7 +220,7 @@ std::string getDeveloperString(const Value& v) } std::string out = ""; bool first = true; - for (int i = 0; i < v.Size(); ++i) + for (int i = 0; i < (int)v.Size(); ++i) { auto mapIt = resources.gamesdb_new_developers_map.find(getIntOrThrow(v[i])); if (mapIt == resources.gamesdb_new_developers_map.cend()) @@ -245,7 +245,7 @@ std::string getPublisherString(const Value& v) } std::string out = ""; bool first = true; - for (int i = 0; i < v.Size(); ++i) + for (int i = 0; i < (int)v.Size(); ++i) { auto mapIt = resources.gamesdb_new_publishers_map.find(getIntOrThrow(v[i])); if (mapIt == resources.gamesdb_new_publishers_map.cend()) @@ -270,7 +270,7 @@ std::string getGenreString(const Value& v) } std::string out = ""; bool first = true; - for (int i = 0; i < v.Size(); ++i) + for (int i = 0; i < (int)v.Size(); ++i) { auto mapIt = resources.gamesdb_new_genres_map.find(getIntOrThrow(v[i])); if (mapIt == resources.gamesdb_new_genres_map.cend()) @@ -381,7 +381,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, std::ve resources.ensureResources(); - for (int i = 0; i < games.Size(); ++i) + for (int i = 0; i < (int)games.Size(); ++i) { auto& v = games[i]; try diff --git a/es-app/src/scrapers/ScreenScraper.cpp b/es-app/src/scrapers/ScreenScraper.cpp index b84cabc70..e9eb53378 100644 --- a/es-app/src/scrapers/ScreenScraper.cpp +++ b/es-app/src/scrapers/ScreenScraper.cpp @@ -169,7 +169,7 @@ void ScreenScraperRequest::process(const std::unique_ptr& req, std::vec } -void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc, std::vector& results) +void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc, std::vector& out_results) { pugi::xml_node data = xmldoc.child("Data"); pugi::xml_node game = data.child("jeu"); @@ -285,7 +285,7 @@ void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc, std::ve } - results.push_back(result); + out_results.push_back(result); } // game } diff --git a/es-app/src/views/UIModeController.cpp b/es-app/src/views/UIModeController.cpp index 6d1709ce1..2efa944c9 100644 --- a/es-app/src/views/UIModeController.cpp +++ b/es-app/src/views/UIModeController.cpp @@ -52,7 +52,7 @@ bool UIModeController::listen(InputConfig * config, Input input) mPassKeyCounter = 0; // current input is incorrect, reset counter } - if (mPassKeyCounter == (mPassKeySequence.length())) + if (mPassKeyCounter == (int)mPassKeySequence.length()) { unlockUIMode(); return true; diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 8e543802f..ada681e26 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -438,7 +438,7 @@ void ViewController::preload() i++; char buffer[100]; sprintf (buffer, "Loading '%s' (%d/%d)", - (*it)->getFullName().c_str(), i, SystemData::sSystemVector.size()); + (*it)->getFullName().c_str(), i, (int)SystemData::sSystemVector.size()); mWindow->renderLoadingScreen(std::string(buffer)); } diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index efaaab6d8..91f9c08b0 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -314,7 +314,7 @@ void GridGameListView::remove(FileData *game, bool deleteFile) int gamePos = (int)std::distance(siblings.cbegin(), gameIter); if (gameIter != siblings.cend()) { - if ((gamePos + 1) < siblings.size()) + if ((gamePos + 1) < (int)siblings.size()) { setCursor(siblings.at(gamePos + 1)); } else if ((gamePos - 1) > 0) { diff --git a/es-core/src/components/GridTileComponent.cpp b/es-core/src/components/GridTileComponent.cpp index 7dbe2c028..745fede1a 100644 --- a/es-core/src/components/GridTileComponent.cpp +++ b/es-core/src/components/GridTileComponent.cpp @@ -56,7 +56,7 @@ void GridTileComponent::update() resize(); } -void GridTileComponent::applyTheme(const std::shared_ptr& theme, const std::string& view, const std::string& element, unsigned int properties) +void GridTileComponent::applyTheme(const std::shared_ptr& theme, const std::string& view, const std::string& /*element*/, unsigned int /*properties*/) { Vector2f screen = Vector2f((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight()); diff --git a/es-core/src/components/ImageGridComponent.h b/es-core/src/components/ImageGridComponent.h index 21a2558a7..65b329adc 100644 --- a/es-core/src/components/ImageGridComponent.h +++ b/es-core/src/components/ImageGridComponent.h @@ -338,7 +338,7 @@ void ImageGridComponent::updateTiles() // Stop updating the tiles at highest scroll speed if (mScrollTier == 3) { - for (int ti = 0; ti < mTiles.size(); ti++) + for (int ti = 0; ti < (int)mTiles.size(); ti++) { std::shared_ptr tile = mTiles.at(ti); @@ -354,12 +354,12 @@ void ImageGridComponent::updateTiles() // If going down, update from top to bottom // If going up, update from bottom to top - int ti = scrollDirection == 1 ? 0 : mTiles.size() - 1; - int end = scrollDirection == 1 ? mTiles.size() : -1; + int ti = scrollDirection == 1 ? 0 : (int)mTiles.size() - 1; + int end = scrollDirection == 1 ? (int)mTiles.size() : -1; int img = getStartPosition(); if (scrollDirection == -1) - img += mTiles.size() - 1; + img += (int)mTiles.size() - 1; // Calculate buffer size depending on scroll speed and direction int bufferBehind = (texBuffersForward[3] - texBuffersBehind[mScrollTier]) * mGridDimension.x(); @@ -387,7 +387,7 @@ void ImageGridComponent::updateTileAtPos(int tilePos, int imgPos, int bufferT // If we have more tiles than we have to display images on screen, hide them if(imgPos < 0 || imgPos >= size() - || tilePos < bufferTop || tilePos >= mTiles.size() - bufferBot) // Same for tiles out of the buffer + || tilePos < bufferTop || tilePos >= (int)mTiles.size() - bufferBot) // Same for tiles out of the buffer { tile->setSelected(false); tile->setImage("");