diff --git a/CMake/Packages/FindVLC.cmake b/CMake/Packages/FindVLC.cmake index 91aea71525..eec5c57092 100644 --- a/CMake/Packages/FindVLC.cmake +++ b/CMake/Packages/FindVLC.cmake @@ -23,14 +23,14 @@ endif(VLC_INCLUDE_DIR AND VLC_LIBRARIES) # in the FIND_PATH() and FIND_LIBRARY() calls if(NOT WIN32) find_package(PkgConfig) - pkg_check_modules(VLC libvlc>=3.0.0) + pkg_check_modules(VLC libvlc>=1.0.0) set(VLC_DEFINITIONS ${VLC_CFLAGS}) set(VLC_LIBRARIES ${VLC_LDFLAGS}) endif(NOT WIN32) # TODO add argument support to pass version on find_package include(MacroEnsureVersion) -macro_ensure_version(3.0.0 ${VLC_VERSION} VLC_VERSION_OK) +macro_ensure_version(1.0.0 ${VLC_VERSION} VLC_VERSION_OK) if(VLC_VERSION_OK) set(VLC_FOUND TRUE) message(STATUS "VLC library found") diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index 868a61cb79..52dca51007 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -737,10 +737,6 @@ void CollectionSystemManager::populateAutoCollection(CollectionSystemData* sysDa // we may still want to add files we don't want in auto collections in "favorites" include = (*gameIt)->metadata.get("favorite") == "true"; break; - default: - // No-op to prevent compiler warnings - // Getting here means that the file is not part of a pre-defined collection. - break; } if (include) { diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index ff65dce59f..4ddf6b8302 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -171,9 +171,6 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, FilterIndexType typ key = Utils::String::toUpper(game->metadata.get("kidgame")); break; } - default: - LOG(LogWarning) << "Unknown Filter type:" << type; - break; } key = Utils::String::trim(key); if (key.empty() || (type == RATINGS_FILTER && key == "0 STARS")) { @@ -537,4 +534,4 @@ void FileFilterIndex::manageIndexEntry(std::map* index, std::s void FileFilterIndex::clearIndex(std::map indexMap) { indexMap.clear(); -} +} \ No newline at end of file diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 564989eb5d..d222f08bde 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -148,9 +148,6 @@ void SystemData::indexAllGameFilters(const FileData* folder) { case GAME: { mFilterIndex->addToIndex(*it); } break; case FOLDER: { indexAllGameFilters(*it); } break; - default: - LOG(LogInfo) << "Unknown type: " << (*it)->getType(); - break; } } } @@ -213,9 +210,7 @@ SystemData* SystemData::loadSystem(pugi::xml_node system) // if there appears to be an actual platform ID supplied but it didn't match the list, warn if (str != NULL && str[0] != '\0' && platformId == PlatformIds::PLATFORM_UNKNOWN) - { LOG(LogWarning) << " Unknown platform for system \"" << name << "\" (platform \"" << str << "\" from list \"" << platformList << "\")"; - } else if (platformId != PlatformIds::PLATFORM_UNKNOWN) platformIds.push_back(platformId); } diff --git a/es-app/src/SystemScreenSaver.cpp b/es-app/src/SystemScreenSaver.cpp index cc688d7672..9c422c1fd1 100644 --- a/es-app/src/SystemScreenSaver.cpp +++ b/es-app/src/SystemScreenSaver.cpp @@ -314,7 +314,7 @@ void SystemScreenSaver::backgroundIndexing() std::vector files = all->getRootFolder()->getFilesRecursive(GAME); const auto startTs = std::chrono::system_clock::now(); - for ( ; lastIndex < files.size(); lastIndex++) + for (lastIndex; lastIndex < files.size(); lastIndex++) { if(mExit) break; diff --git a/es-app/src/components/RatingComponent.h b/es-app/src/components/RatingComponent.h index 3d429e6420..ae2c3ae7e2 100644 --- a/es-app/src/components/RatingComponent.h +++ b/es-app/src/components/RatingComponent.h @@ -23,7 +23,7 @@ class RatingComponent : public GuiComponent void setValue(const std::string& value) override; // Should be a normalized float (in the range [0..1]) - if it's not, it will be clamped. bool input(InputConfig* config, Input input) override; - void render(const Transform4x4f& parentTrans) override; + void render(const Transform4x4f& parentTrans); void onSizeChanged() override; diff --git a/es-app/src/components/TextListComponent.h b/es-app/src/components/TextListComponent.h index 54e6d2e59f..aac751624d 100644 --- a/es-app/src/components/TextListComponent.h +++ b/es-app/src/components/TextListComponent.h @@ -30,7 +30,7 @@ class TextListComponent : public IList using IList::getTransform; using IList::mSize; using IList::mCursor; - using IList::mEntry; + using IList::Entry; public: using IList::size; @@ -81,8 +81,8 @@ class TextListComponent : public IList inline void setLineSpacing(float lineSpacing) { mLineSpacing = lineSpacing; } protected: - virtual void onScroll(int /*amt*/) override { if(!mScrollSound.empty()) Sound::get(mScrollSound)->play(); } - virtual void onCursorChanged(const CursorState& state) override; + virtual void onScroll(int /*amt*/) { if(!mScrollSound.empty()) Sound::get(mScrollSound)->play(); } + virtual void onCursorChanged(const CursorState& state); private: int mMarqueeOffset; diff --git a/es-app/src/guis/GuiGameScraper.h b/es-app/src/guis/GuiGameScraper.h index 7ddc6bff48..2f3da8b47b 100644 --- a/es-app/src/guis/GuiGameScraper.h +++ b/es-app/src/guis/GuiGameScraper.h @@ -14,7 +14,7 @@ class GuiGameScraper : public GuiComponent void onSizeChanged() override; bool input(InputConfig* config, Input input) override; - void update(int deltaTime) override; + void update(int deltaTime); virtual std::vector getHelpPrompts() override; private: diff --git a/es-app/src/guis/GuiInfoPopup.h b/es-app/src/guis/GuiInfoPopup.h index d4bf5a6408..1bbe005e21 100644 --- a/es-app/src/guis/GuiInfoPopup.h +++ b/es-app/src/guis/GuiInfoPopup.h @@ -14,7 +14,7 @@ class GuiInfoPopup : public GuiComponent, public Window::InfoPopup GuiInfoPopup(Window* window, std::string message, int duration, int fadein = 500, int fadeout = 500); ~GuiInfoPopup(); void render(const Transform4x4f& parentTrans) override; - inline void stop() override { running = false; }; + inline void stop() { running = false; }; private: std::string mMessage; int mDuration; diff --git a/es-app/src/views/gamelist/BasicGameListView.h b/es-app/src/views/gamelist/BasicGameListView.h index 7d704aa48b..c2387d83db 100644 --- a/es-app/src/views/gamelist/BasicGameListView.h +++ b/es-app/src/views/gamelist/BasicGameListView.h @@ -11,9 +11,9 @@ class BasicGameListView : public ISimpleGameListView BasicGameListView(Window* window, FileData* root); // Called when a FileData* is added, has its metadata changed, or is removed - virtual void onFileChanged(FileData* file, FileChangeType change) override; + virtual void onFileChanged(FileData* file, FileChangeType change); - virtual void onThemeChanged(const std::shared_ptr& theme) override; + virtual void onThemeChanged(const std::shared_ptr& theme); virtual FileData* getCursor() override; virtual void setCursor(FileData* file) override; diff --git a/es-app/src/views/gamelist/ISimpleGameListView.h b/es-app/src/views/gamelist/ISimpleGameListView.h index 326e997364..776ac7e27c 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.h +++ b/es-app/src/views/gamelist/ISimpleGameListView.h @@ -17,16 +17,16 @@ class ISimpleGameListView : public IGameListView // Called when a new file is added, a file is removed, a file's metadata changes, or a file's children are sorted. // NOTE: FILE_SORTED is only reported for the topmost FileData, where the sort started. // Since sorts are recursive, that FileData's children probably changed too. - virtual void onFileChanged(FileData* file, FileChangeType change) override; + virtual void onFileChanged(FileData* file, FileChangeType change); // Called whenever the theme changes. - virtual void onThemeChanged(const std::shared_ptr& theme) override; + virtual void onThemeChanged(const std::shared_ptr& theme); - virtual FileData* getCursor() override = 0; - virtual void setCursor(FileData*) override = 0; + virtual FileData* getCursor() = 0; + virtual void setCursor(FileData*) = 0; virtual bool input(InputConfig* config, Input input) override; - virtual void launch(FileData* game) override = 0; + virtual void launch(FileData* game) = 0; static const int DOUBLE_PRESS_DETECTION_DURATION = 1500; // millis diff --git a/es-core/src/Log.h b/es-core/src/Log.h index 047d0c5de9..0b69a74feb 100644 --- a/es-core/src/Log.h +++ b/es-core/src/Log.h @@ -5,8 +5,8 @@ #include #define LOG(level) \ -if(level <= Log::getReportingLevel()) \ - Log().get(level) +if(level > Log::getReportingLevel()) ; \ +else Log().get(level) enum LogLevel { LogError, LogWarning, LogInfo, LogDebug }; diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 78575e834a..d38bf951f2 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -13,27 +13,27 @@ Settings* Settings::sInstance = NULL; // these values are NOT saved to es_settings.xml // since they're set through command-line arguments, and not the in-program settings menu std::vector settings_dont_save { - "Debug" , - "DebugGrid" , - "DebugText" , - "DebugImage" , - "ForceKid" , - "ForceKiosk" , - "IgnoreGamelist" , - "HideConsole" , - "ShowExit" , - "ConfirmQuit" , - "SplashScreen" , - "VSync" , - "FullscreenBorderless" , - "Windowed" , - "WindowWidth" , - "WindowHeight" , - "ScreenWidth" , - "ScreenHeight" , - "ScreenOffsetX" , - "ScreenOffsetY" , - "ScreenRotate" + { "Debug" }, + { "DebugGrid" }, + { "DebugText" }, + { "DebugImage" }, + { "ForceKid" }, + { "ForceKiosk" }, + { "IgnoreGamelist" }, + { "HideConsole" }, + { "ShowExit" }, + { "ConfirmQuit" }, + { "SplashScreen" }, + { "VSync" }, + { "FullscreenBorderless" }, + { "Windowed" }, + { "WindowWidth" }, + { "WindowHeight" }, + { "ScreenWidth" }, + { "ScreenHeight" }, + { "ScreenOffsetX" }, + { "ScreenOffsetY" }, + { "ScreenRotate" } }; Settings::Settings() diff --git a/es-core/src/animations/Animation.h b/es-core/src/animations/Animation.h index 8903199959..ee2471d157 100644 --- a/es-core/src/animations/Animation.h +++ b/es-core/src/animations/Animation.h @@ -7,7 +7,6 @@ class Animation public: virtual int getDuration() const = 0; virtual void apply(float t) = 0; - virtual ~Animation() = default; }; #endif // ES_CORE_ANIMATIONS_ANIMATION_H diff --git a/es-core/src/components/GridTileComponent.h b/es-core/src/components/GridTileComponent.h index 4fa11216d7..69ea962f85 100644 --- a/es-core/src/components/GridTileComponent.h +++ b/es-core/src/components/GridTileComponent.h @@ -22,7 +22,7 @@ class GridTileComponent : public GuiComponent GridTileComponent(Window* window); void render(const Transform4x4f& parentTrans) override; - virtual void applyTheme(const std::shared_ptr& theme, const std::string& view, const std::string& element, unsigned int properties) override; + virtual void applyTheme(const std::shared_ptr& theme, const std::string& view, const std::string& element, unsigned int properties); // Made this a static function because the ImageGridComponent need to know the default tile max size // to calculate the grid dimension before it instantiate the GridTileComponents @@ -41,7 +41,7 @@ class GridTileComponent : public GuiComponent Vector3f getBackgroundPosition(); - virtual void update(int deltaTime) override; + virtual void update(int deltaTime); std::shared_ptr getTexture(); diff --git a/es-core/src/components/IList.h b/es-core/src/components/IList.h index bc8fc2b79b..2a8669534c 100644 --- a/es-core/src/components/IList.h +++ b/es-core/src/components/IList.h @@ -58,8 +58,6 @@ class IList : public GuiComponent }; protected: - struct Entry mEntry; - int mCursor; int mScrollTier; diff --git a/es-core/src/components/ImageGridComponent.h b/es-core/src/components/ImageGridComponent.h index c182346684..fbee05520b 100644 --- a/es-core/src/components/ImageGridComponent.h +++ b/es-core/src/components/ImageGridComponent.h @@ -40,7 +40,7 @@ class ImageGridComponent : public IList using IList::getTransform; using IList::mSize; using IList::mCursor; - using IList::mEntry; + using IList::Entry; using IList::mWindow; public: @@ -305,9 +305,7 @@ void ImageGridComponent::applyTheme(const std::shared_ptr& theme, std::string path = elem->get("gameImage"); if (!ResourceManager::getInstance()->fileExists(path)) - { LOG(LogWarning) << "Could not replace default game image, check path: " << path; - } else { std::string oldDefaultGameTexture = mDefaultGameTexture; @@ -328,9 +326,7 @@ void ImageGridComponent::applyTheme(const std::shared_ptr& theme, std::string path = elem->get("folderImage"); if (!ResourceManager::getInstance()->fileExists(path)) - { LOG(LogWarning) << "Could not replace default folder image, check path: " << path; - } else { std::string oldDefaultFolderTexture = mDefaultFolderTexture; diff --git a/es-core/src/components/SwitchComponent.h b/es-core/src/components/SwitchComponent.h index 4f81f6ae60..2e2d83f6b4 100644 --- a/es-core/src/components/SwitchComponent.h +++ b/es-core/src/components/SwitchComponent.h @@ -18,7 +18,7 @@ class SwitchComponent : public GuiComponent bool getState() const; void setState(bool state); - std::string getValue() const override; + std::string getValue() const; void setValue(const std::string& statestring) override; virtual std::vector getHelpPrompts() override; diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 6b3ac19372..bd8b7cdc0d 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -120,9 +120,6 @@ void TextComponent::render(const Transform4x4f& parentTrans) case ALIGN_CENTER: yOff = (getSize().y() - textSize.y()) / 2.0f; break; - default: - LOG(LogError) << "Unknown vertical alignment: " << mVerticalAlignment; - break; } Vector3f off(0, yOff, 0); @@ -150,9 +147,6 @@ void TextComponent::render(const Transform4x4f& parentTrans) case ALIGN_RIGHT: Renderer::drawRect(mSize.x() - mTextCache->metrics.size.x(), 0.0f, mTextCache->metrics.size.x(), mTextCache->metrics.size.y(), 0x00000033, 0x00000033); break; - default: - LOG(LogError) << "Unknown horizontal alignment: " << mHorizontalAlignment; - break; } } mFont->renderTextCache(mTextCache.get()); diff --git a/es-core/src/components/VideoComponent.h b/es-core/src/components/VideoComponent.h index 1c574a1fae..8513129f95 100644 --- a/es-core/src/components/VideoComponent.h +++ b/es-core/src/components/VideoComponent.h @@ -56,7 +56,7 @@ class VideoComponent : public GuiComponent virtual std::vector getHelpPrompts() override; - virtual void update(int deltaTime) override; + virtual void update(int deltaTime); // Resize the video to fit this size. If one axis is zero, scale that axis to maintain aspect ratio. // If both are non-zero, potentially break the aspect ratio. If both are zero, no resizing. diff --git a/es-core/src/components/VideoVlcComponent.cpp b/es-core/src/components/VideoVlcComponent.cpp index fe79629362..ce90d0456b 100644 --- a/es-core/src/components/VideoVlcComponent.cpp +++ b/es-core/src/components/VideoVlcComponent.cpp @@ -7,7 +7,6 @@ #include "Settings.h" #include #include -#include #ifdef WIN32 #include @@ -256,9 +255,7 @@ void VideoVlcComponent::startVideo() { unsigned track_count; // Get the media metadata so we can find the aspect ratio - libvlc_media_parse_with_options(mMedia, libvlc_media_fetch_local, -1); - while (libvlc_media_get_parsed_status(mMedia) == 0) - ; + libvlc_media_parse(mMedia); libvlc_media_track_t** tracks; track_count = libvlc_media_tracks_get(mMedia, &tracks); for (unsigned track = 0; track < track_count; ++track) diff --git a/es-core/src/components/VideoVlcComponent.h b/es-core/src/components/VideoVlcComponent.h index 56341efcc0..c350b8cb3c 100644 --- a/es-core/src/components/VideoVlcComponent.h +++ b/es-core/src/components/VideoVlcComponent.h @@ -40,23 +40,23 @@ class VideoVlcComponent : public VideoComponent // If both are non-zero, potentially break the aspect ratio. If both are zero, no resizing. // Can be set before or after a video is loaded. // setMaxSize() and setResize() are mutually exclusive. - void setResize(float width, float height) override; + void setResize(float width, float height); // Resize the video to be as large as possible but fit within a box of this size. // Can be set before or after a video is loaded. // Never breaks the aspect ratio. setMaxSize() and setResize() are mutually exclusive. - void setMaxSize(float width, float height) override; + void setMaxSize(float width, float height); private: // Calculates the correct mSize from our resizing information (set by setResize/setMaxSize). // Used internally whenever the resizing parameters or texture change. void resize(); // Start the video Immediately - virtual void startVideo() override; + virtual void startVideo(); // Stop the video - virtual void stopVideo() override; + virtual void stopVideo(); // Handle looping the video. Must be called periodically - virtual void handleLooping() override; + virtual void handleLooping(); void setupContext(); void freeContext(); diff --git a/es-core/src/guis/GuiTextEditPopup.h b/es-core/src/guis/GuiTextEditPopup.h index 59a95b9516..4658fca4ab 100644 --- a/es-core/src/guis/GuiTextEditPopup.h +++ b/es-core/src/guis/GuiTextEditPopup.h @@ -15,8 +15,8 @@ class GuiTextEditPopup : public GuiComponent GuiTextEditPopup(Window* window, const std::string& title, const std::string& initValue, const std::function& okCallback, bool multiLine, const char* acceptBtnText = "OK"); - bool input(InputConfig* config, Input input) override; - void onSizeChanged() override; + bool input(InputConfig* config, Input input); + void onSizeChanged(); std::vector getHelpPrompts() override; private: diff --git a/es-core/src/platform.cpp b/es-core/src/platform.cpp index dc904c49ed..81262310b7 100644 --- a/es-core/src/platform.cpp +++ b/es-core/src/platform.cpp @@ -85,10 +85,5 @@ void processQuitMode() touch("/tmp/es-shutdown"); runShutdownCommand(); break; - default: - // No-op to prevent compiler warnings - // If we reach here, it is not a RESTART, REBOOT, - // or SHUTDOWN. Basically a normal exit. - break; } } diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 3c3f927632..f3d074404a 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -600,12 +600,12 @@ float Font::getNewlineStartOffset(const std::string& text, const unsigned int& c return 0; case ALIGN_CENTER: { - size_t endChar = text.find('\n', charStart); + unsigned int endChar = (unsigned int)text.find('\n', charStart); return (xLen - sizeText(text.substr(charStart, endChar != std::string::npos ? endChar - charStart : endChar)).x()) / 2.0f; } case ALIGN_RIGHT: { - size_t endChar = text.find('\n', charStart); + unsigned int endChar = (unsigned int)text.find('\n', charStart); return xLen - (sizeText(text.substr(charStart, endChar != std::string::npos ? endChar - charStart : endChar)).x()); } default: diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index 766cbccb03..9308edd6ba 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -22,23 +22,23 @@ namespace Utils else if((c & 0xE0) == 0xC0) // 110xxxxx, two byte character { // 110xxxxx 10xxxxxx - result = (_string[_cursor++] & 0x1F) << 6; - result |= (_string[_cursor++] & 0x3F); + result = ((_string[_cursor++] & 0x1F) << 6) | + ((_string[_cursor++] & 0x3F) ); } else if((c & 0xF0) == 0xE0) // 1110xxxx, three byte character { // 1110xxxx 10xxxxxx 10xxxxxx - result = (_string[_cursor++] & 0x0F) << 12; - result |= (_string[_cursor++] & 0x3F) << 6; - result |= (_string[_cursor++] & 0x3F); + result = ((_string[_cursor++] & 0x0F) << 12) | + ((_string[_cursor++] & 0x3F) << 6) | + ((_string[_cursor++] & 0x3F) ); } else if((c & 0xF8) == 0xF0) // 11110xxx, four byte character { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - result = (_string[_cursor++] & 0x07) << 18; - result |= (_string[_cursor++] & 0x3F) << 12; - result |= (_string[_cursor++] & 0x3F) << 6; - result |= (_string[_cursor++] & 0x3F); + result = ((_string[_cursor++] & 0x07) << 18) | + ((_string[_cursor++] & 0x3F) << 12) | + ((_string[_cursor++] & 0x3F) << 6) | + ((_string[_cursor++] & 0x3F) ); } else {