diff options
author | Garrett Brown <themagnificentmrb@gmail.com> | 2018-08-21 10:26:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-21 10:26:13 -0700 |
commit | 453e257c9e10f42df3850779cede98f5194b9aa5 (patch) | |
tree | 514c118e66684d3552c10066abc5737f69f4cf0e | |
parent | 033b897cf7a9dc4e58323b4e2c0f8edc97e3b27f (diff) | |
parent | ebca8746a65b19efedd364778f75717b078ab282 (diff) |
Merge pull request #14309 from garbear/warnings
Fix compiler warnings
-rw-r--r-- | tools/EventClients/Clients/OSXRemote/XBMCHelper.m | 5 | ||||
-rw-r--r-- | xbmc/LangInfo.cpp | 2 | ||||
-rw-r--r-- | xbmc/XBDateTime.h | 2 | ||||
-rw-r--r-- | xbmc/addons/interfaces/General.cpp | 6 | ||||
-rw-r--r-- | xbmc/cdrip/CDDARipJob.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleTagMicroDVD.cpp | 8 | ||||
-rw-r--r-- | xbmc/games/controllers/Controller.cpp | 3 | ||||
-rw-r--r-- | xbmc/games/controllers/types/ControllerGrid.cpp | 12 | ||||
-rw-r--r-- | xbmc/games/controllers/types/ControllerGrid.h | 2 | ||||
-rw-r--r-- | xbmc/guilib/DDSImage.cpp | 2 | ||||
-rw-r--r-- | xbmc/peripherals/addons/PeripheralAddon.cpp | 5 | ||||
-rw-r--r-- | xbmc/pictures/Picture.cpp | 4 | ||||
-rw-r--r-- | xbmc/platform/android/peripherals/AndroidJoystickState.h | 6 | ||||
-rw-r--r-- | xbmc/powermanagement/DPMSSupport.cpp | 2 | ||||
-rw-r--r-- | xbmc/utils/EmbeddedArt.h | 1 | ||||
-rw-r--r-- | xbmc/utils/Mime.cpp | 2 |
17 files changed, 39 insertions, 27 deletions
diff --git a/tools/EventClients/Clients/OSXRemote/XBMCHelper.m b/tools/EventClients/Clients/OSXRemote/XBMCHelper.m index 018426a96c..5e73ebed80 100644 --- a/tools/EventClients/Clients/OSXRemote/XBMCHelper.m +++ b/tools/EventClients/Clients/OSXRemote/XBMCHelper.m @@ -254,6 +254,11 @@ case kHIDRemoteButtonCodeMenuHold: return (@"Menu (hold)"); break; + case kHIDRemoteButtonCodePlay: + return (@"Play"); + break; + default: + break; } return ([NSString stringWithFormat:@"Button %x", (int)buttonCode]); } diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp index db09d9f747..b36cccffe9 100644 --- a/xbmc/LangInfo.cpp +++ b/xbmc/LangInfo.cpp @@ -179,7 +179,7 @@ static CSpeed::Unit StringToSpeedUnit(const std::string& speedUnit) struct SortLanguage { - bool operator()(const std::pair<std::string, std::string> &left, const std::pair<std::string, std::string> &right) + bool operator()(const std::pair<std::string, std::string> &left, const std::pair<std::string, std::string> &right) const { std::string strLeft = left.first; std::string strRight = right.first; diff --git a/xbmc/XBDateTime.h b/xbmc/XBDateTime.h index 8c5846631f..510f99dd32 100644 --- a/xbmc/XBDateTime.h +++ b/xbmc/XBDateTime.h @@ -79,7 +79,7 @@ private: }; /// \brief DateTime class, which uses FILETIME as it's base. -class CDateTime : public IArchivable +class CDateTime final : public IArchivable { public: CDateTime(); diff --git a/xbmc/addons/interfaces/General.cpp b/xbmc/addons/interfaces/General.cpp index 122bd77de0..00780b5cad 100644 --- a/xbmc/addons/interfaces/General.cpp +++ b/xbmc/addons/interfaces/General.cpp @@ -251,17 +251,17 @@ bool Interface_General::queue_notification(void* kodiBase, int type, const char* CGUIDialogKaiToast::eMessageType usedType; switch (qtype) { - case QUEUE_WARNING: + case QueueMsg::QUEUE_WARNING: usedType = CGUIDialogKaiToast::Warning; withSound = true; CLog::Log(LOGDEBUG, "Interface_General::%s - %s - Warning Message: '%s'", __FUNCTION__, addon->Name().c_str(), message); break; - case QUEUE_ERROR: + case QueueMsg::QUEUE_ERROR: usedType = CGUIDialogKaiToast::Error; withSound = true; CLog::Log(LOGDEBUG, "Interface_General::%s - %s - Error Message : '%s'", __FUNCTION__, addon->Name().c_str(), message); break; - case QUEUE_INFO: + case QueueMsg::QUEUE_INFO: default: usedType = CGUIDialogKaiToast::Info; withSound = false; diff --git a/xbmc/cdrip/CDDARipJob.cpp b/xbmc/cdrip/CDDARipJob.cpp index 9b406cea5b..33af6a1d57 100644 --- a/xbmc/cdrip/CDDARipJob.cpp +++ b/xbmc/cdrip/CDDARipJob.cpp @@ -68,7 +68,7 @@ bool CCDDARipJob::DoWork() // init ripper CFile reader; - CEncoder* encoder; + CEncoder* encoder = nullptr; if (!reader.Open(m_input,READ_CACHED) || !(encoder=SetupEncoder(reader))) { CLog::Log(LOGERROR, "Error: CCDDARipper::Init failed"); diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp index 360d4810d4..5792fa87d7 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp @@ -230,7 +230,7 @@ int CAESinkAUDIOTRACK::AudioTrackWrite(char* audioData, int offsetInBytes, int s } else { - if (m_charbuf.size() != (sizeInBytes - offsetInBytes)) + if (static_cast<int>(m_charbuf.size()) != (sizeInBytes - offsetInBytes)) m_charbuf.resize(sizeInBytes - offsetInBytes); memcpy(m_charbuf.data(), audioData + offsetInBytes, sizeInBytes - offsetInBytes); if (CJNIBase::GetSDKVersion() >= 23) diff --git a/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleTagMicroDVD.cpp b/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleTagMicroDVD.cpp index 0128dab8ec..488d87212b 100644 --- a/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleTagMicroDVD.cpp +++ b/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleTagMicroDVD.cpp @@ -28,9 +28,11 @@ void CDVDSubtitleTagMicroDVD::ConvertLine(CDVDOverlayText* pOverlay, const char* { if (strUTF8[pos] == '{') { - size_t pos2, pos3; - if (((pos2 = strUTF8.find(':', pos)) != std::string::npos) && - ((pos3 = strUTF8.find('}', pos2)) != std::string::npos)) + size_t pos2 = strUTF8.find(':', pos); + size_t pos3 = strUTF8.find('}', pos2); + + if ((pos2 != std::string::npos) && + (pos3 != std::string::npos)) { std::string tagName = strUTF8.substr(pos + 1, pos2 - pos - 1); std::string tagValue = strUTF8.substr(pos2 + 1, pos3 - pos2 - 1); diff --git a/xbmc/games/controllers/Controller.cpp b/xbmc/games/controllers/Controller.cpp index 780ebce7d7..fc7562911b 100644 --- a/xbmc/games/controllers/Controller.cpp +++ b/xbmc/games/controllers/Controller.cpp @@ -86,7 +86,8 @@ const CControllerFeature& CController::GetFeature(const std::string &name) const unsigned int CController::FeatureCount(FEATURE_TYPE type /* = FEATURE_TYPE::UNKNOWN */, JOYSTICK::INPUT_TYPE inputType /* = JOYSTICK::INPUT_TYPE::UNKNOWN */) const { - return std::count_if(m_features.begin(), m_features.end(), FeatureTypeEqual(type, inputType)); + auto featureCount = std::count_if(m_features.begin(), m_features.end(), FeatureTypeEqual(type, inputType)); + return static_cast<unsigned int>(featureCount); } void CController::GetFeatures(std::vector<std::string>& features, diff --git a/xbmc/games/controllers/types/ControllerGrid.cpp b/xbmc/games/controllers/types/ControllerGrid.cpp index 48f0c9cccc..244ea5c335 100644 --- a/xbmc/games/controllers/types/ControllerGrid.cpp +++ b/xbmc/games/controllers/types/ControllerGrid.cpp @@ -100,7 +100,7 @@ unsigned int CControllerGrid::AddPorts(const ControllerPortVec &ports, Controlle if (port.PortType() == PORT_TYPE::CONTROLLER) { // Add controller - height = std::max(height, AddController(port, column.vertices.size(), column.vertices, grid)); + height = std::max(height, AddController(port, static_cast<unsigned int>(column.vertices.size()), column.vertices, grid)); if (bFirstPlayer == true) { @@ -108,9 +108,9 @@ unsigned int CControllerGrid::AddPorts(const ControllerPortVec &ports, Controlle // Keyboard and mouse are added below the first controller if (itKeyboard != ports.end()) - height = std::max(height, AddController(*itKeyboard, column.vertices.size(), column.vertices, grid)); + height = std::max(height, AddController(*itKeyboard, static_cast<unsigned int>(column.vertices.size()), column.vertices, grid)); if (itMouse != ports.end()) - height = std::max(height, AddController(*itMouse, column.vertices.size(), column.vertices, grid)); + height = std::max(height, AddController(*itMouse, static_cast<unsigned int>(column.vertices.size()), column.vertices, grid)); } } @@ -124,9 +124,9 @@ unsigned int CControllerGrid::AddPorts(const ControllerPortVec &ports, Controlle ControllerColumn column; if (itKeyboard != ports.end()) - height = std::max(height, AddController(*itKeyboard, column.vertices.size(), column.vertices, grid)); + height = std::max(height, AddController(*itKeyboard, static_cast<unsigned int>(column.vertices.size()), column.vertices, grid)); if (itMouse != ports.end()) - height = std::max(height, AddController(*itMouse, column.vertices.size(), column.vertices, grid)); + height = std::max(height, AddController(*itMouse, static_cast<unsigned int>(column.vertices.size()), column.vertices, grid)); if (!column.vertices.empty()) grid.emplace_back(std::move(column)); @@ -222,7 +222,7 @@ void CControllerGrid::SetHeight(unsigned int height, ControllerGrid &grid) { for (auto &column : grid) { - while (column.vertices.size() < height) + while (static_cast<unsigned int>(column.vertices.size()) < height) AddInvisible(column.vertices); } } diff --git a/xbmc/games/controllers/types/ControllerGrid.h b/xbmc/games/controllers/types/ControllerGrid.h index b9a1ab3395..72dfd47f39 100644 --- a/xbmc/games/controllers/types/ControllerGrid.h +++ b/xbmc/games/controllers/types/ControllerGrid.h @@ -62,7 +62,7 @@ namespace GAME /*! * \brief Get the width of the controller grid */ - unsigned int Width() const { return m_grid.size(); } + unsigned int Width() const { return static_cast<unsigned int>(m_grid.size()); } /*! * \brief Get the height (deepest controller) of the controller grid diff --git a/xbmc/guilib/DDSImage.cpp b/xbmc/guilib/DDSImage.cpp index 255ad0f2fb..14c807b87a 100644 --- a/xbmc/guilib/DDSImage.cpp +++ b/xbmc/guilib/DDSImage.cpp @@ -96,7 +96,7 @@ bool CDDSImage::ReadFile(const std::string &inputFile) return false; // and read it in - if (file.Read(m_data, m_desc.linearSize) != m_desc.linearSize) + if (file.Read(m_data, m_desc.linearSize) != static_cast<ssize_t>(m_desc.linearSize)) return false; file.Close(); diff --git a/xbmc/peripherals/addons/PeripheralAddon.cpp b/xbmc/peripherals/addons/PeripheralAddon.cpp index f96d2a1d62..dea4657f89 100644 --- a/xbmc/peripherals/addons/PeripheralAddon.cpp +++ b/xbmc/peripherals/addons/PeripheralAddon.cpp @@ -630,12 +630,13 @@ bool CPeripheralAddon::SetIgnoredPrimitives(const CPeripheral* device, const Pri JOYSTICK_DRIVER_PRIMITIVE* addonPrimitives = nullptr; kodi::addon::DriverPrimitives::ToStructs(primitives, &addonPrimitives); + const unsigned int primitiveCount = static_cast<unsigned int>(primitives.size()); LogError(retVal = m_struct.toAddon.set_ignored_primitives(&m_struct, &joystickStruct, - primitives.size(), addonPrimitives), "SetIgnoredPrimitives()"); + primitiveCount, addonPrimitives), "SetIgnoredPrimitives()"); kodi::addon::Joystick::FreeStruct(joystickStruct); - kodi::addon::DriverPrimitives::FreeStructs(primitives.size(), addonPrimitives); + kodi::addon::DriverPrimitives::FreeStructs(primitiveCount, addonPrimitives); return retVal == PERIPHERAL_NO_ERROR; } diff --git a/xbmc/pictures/Picture.cpp b/xbmc/pictures/Picture.cpp index 4b754db2ca..426ec06f1e 100644 --- a/xbmc/pictures/Picture.cpp +++ b/xbmc/pictures/Picture.cpp @@ -76,7 +76,9 @@ bool CPicture::CreateThumbnailFromSurface(const unsigned char *buffer, int width } XFILE::CFile file; - const bool ret = file.OpenForWrite(thumbFile, true) && file.Write(thumb, thumbsize) == thumbsize; + const bool ret = file.OpenForWrite(thumbFile, true) && + file.Write(thumb, thumbsize) == static_cast<ssize_t>(thumbsize); + pImage->ReleaseThumbnailBuffer(); delete pImage; diff --git a/xbmc/platform/android/peripherals/AndroidJoystickState.h b/xbmc/platform/android/peripherals/AndroidJoystickState.h index cd5f097c62..efe3d3e622 100644 --- a/xbmc/platform/android/peripherals/AndroidJoystickState.h +++ b/xbmc/platform/android/peripherals/AndroidJoystickState.h @@ -27,9 +27,9 @@ namespace PERIPHERALS int GetDeviceId() const { return m_deviceId; } - unsigned int GetButtonCount() const { return m_buttons.size(); } - unsigned int GetHatCount() const { return m_hats.size(); } - unsigned int GetAxisCount() const { return m_axes.size(); } + unsigned int GetButtonCount() const { return static_cast<unsigned int>(m_buttons.size()); } + unsigned int GetHatCount() const { return static_cast<unsigned int>(m_hats.size()); } + unsigned int GetAxisCount() const { return static_cast<unsigned int>(m_axes.size()); } /*! * Initialize the joystick object. Joystick will be initialized before the diff --git a/xbmc/powermanagement/DPMSSupport.cpp b/xbmc/powermanagement/DPMSSupport.cpp index eb52bb2d19..b3c311a362 100644 --- a/xbmc/powermanagement/DPMSSupport.cpp +++ b/xbmc/powermanagement/DPMSSupport.cpp @@ -22,7 +22,7 @@ static const char* const MODE_NAMES[DPMSSupport::NUM_MODES] = bool DPMSSupport::CheckValidMode(PowerSavingMode mode) { - if (mode < 0 || mode > NUM_MODES) + if (mode > NUM_MODES) { CLog::Log(LOGERROR, "Invalid power-saving mode %d", mode); return false; diff --git a/xbmc/utils/EmbeddedArt.h b/xbmc/utils/EmbeddedArt.h index 0e950751d1..784373f911 100644 --- a/xbmc/utils/EmbeddedArt.h +++ b/xbmc/utils/EmbeddedArt.h @@ -19,6 +19,7 @@ class EmbeddedArtInfo : public IArchivable public: EmbeddedArtInfo() = default; EmbeddedArtInfo(size_t size, const std::string &mime, const std::string& type = ""); + virtual ~EmbeddedArtInfo() = default; // implementation of IArchivable void Archive(CArchive& ar) override; diff --git a/xbmc/utils/Mime.cpp b/xbmc/utils/Mime.cpp index 5e41a58ada..5229ed658e 100644 --- a/xbmc/utils/Mime.cpp +++ b/xbmc/utils/Mime.cpp @@ -17,7 +17,7 @@ #include "utils/StringUtils.h" #include "filesystem/CurlFile.h" -std::map<std::string, std::string> fillMimeTypes() +static std::map<std::string, std::string> fillMimeTypes() { std::map<std::string, std::string> mimeTypes; |