Skip to content

Commit

Permalink
Merge pull request xbmc#8140 from mkortstiege/fix-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins4kodi committed Oct 2, 2015
2 parents f4f5929 + 41b5dde commit 58142ec
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 88 deletions.
34 changes: 17 additions & 17 deletions xbmc/Application.h
Expand Up @@ -135,13 +135,13 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs

CApplication(void);
virtual ~CApplication(void);
virtual bool Initialize();
virtual void FrameMove(bool processEvents, bool processGUI = true);
virtual void Render();
virtual bool Initialize() override;
virtual void FrameMove(bool processEvents, bool processGUI = true) override;
virtual void Render() override;
virtual bool RenderNoPresent();
virtual void Preflight();
virtual bool Create();
virtual bool Cleanup();
virtual bool Create() override;
virtual bool Cleanup() override;

bool CreateGUI();
bool InitWindow();
Expand All @@ -162,17 +162,17 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
const std::string& CurrentFile();
CFileItem& CurrentFileItem();
CFileItem& CurrentUnstackedItem();
virtual bool OnMessage(CGUIMessage& message);
virtual bool OnMessage(CGUIMessage& message) override;
PLAYERCOREID GetCurrentPlayer();
virtual void OnPlayBackEnded();
virtual void OnPlayBackStarted();
virtual void OnPlayBackPaused();
virtual void OnPlayBackResumed();
virtual void OnPlayBackStopped();
virtual void OnQueueNextItem();
virtual void OnPlayBackSeek(int iTime, int seekOffset);
virtual void OnPlayBackSeekChapter(int iChapter);
virtual void OnPlayBackSpeedChanged(int iSpeed);
virtual void OnPlayBackEnded() override;
virtual void OnPlayBackStarted() override;
virtual void OnPlayBackPaused() override;
virtual void OnPlayBackResumed() override;
virtual void OnPlayBackStopped() override;
virtual void OnQueueNextItem() override;
virtual void OnPlayBackSeek(int iTime, int seekOffset) override;
virtual void OnPlayBackSeekChapter(int iChapter) override;
virtual void OnPlayBackSpeedChanged(int iSpeed) override;

virtual int GetMessageMask() override;
virtual void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg) override;
Expand Down Expand Up @@ -204,7 +204,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
void CloseNetworkShares();

void ShowAppMigrationMessage();
virtual void Process();
virtual void Process() override;
void ProcessSlow();
void ResetScreenSaver();
float GetVolume(bool percentage = true) const;
Expand Down Expand Up @@ -371,7 +371,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs

bool SwitchToFullScreen(bool force = false);

void SetRenderGUI(bool renderGUI);
void SetRenderGUI(bool renderGUI) override;
bool GetRenderGUI() const { return m_renderGUI; };

bool SetLanguage(const std::string &strLanguage);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/GUIInfoManager.h
Expand Up @@ -107,7 +107,7 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable,
virtual ~CGUIInfoManager(void);

void Clear();
virtual bool OnMessage(CGUIMessage &message);
virtual bool OnMessage(CGUIMessage &message) override;

virtual int GetMessageMask() override;
virtual void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg) override;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/PlayListPlayer.h
Expand Up @@ -51,7 +51,7 @@ class CPlayListPlayer : public IMsgTargetCallback,
public:
CPlayListPlayer(void);
virtual ~CPlayListPlayer(void);
virtual bool OnMessage(CGUIMessage &message);
virtual bool OnMessage(CGUIMessage &message) override;

virtual int GetMessageMask() override;
virtual void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg) override;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/addons/AddonCallbacksAudioEngine.cpp
Expand Up @@ -104,7 +104,7 @@ bool CAddonCallbacksAudioEngine::AudioEngine_GetCurrentSinkFormat(void *AddonDat
}

SinkFormat->m_channelCount = AESinkFormat.m_channelLayout.Count();
for (int ch = 0; ch < SinkFormat->m_channelCount; ch++)
for (unsigned int ch = 0; ch < SinkFormat->m_channelCount; ch++)
{
SinkFormat->m_channels[ch] = AESinkFormat.m_channelLayout[ch];
}
Expand Down
1 change: 0 additions & 1 deletion xbmc/addons/GUIDialogAddonInfo.cpp
Expand Up @@ -175,7 +175,6 @@ void CGUIDialogAddonInfo::UpdateControls()
{
bool isInstalled = NULL != m_localAddon.get();
bool isEnabled = isInstalled && m_item->GetProperty("Addon.Enabled").asBoolean();
bool isExecutable = isInstalled && (m_localAddon->Type() == ADDON_PLUGIN || m_localAddon->Type() == ADDON_SCRIPT);
if (isInstalled)
GrabRollbackVersions();

Expand Down
8 changes: 4 additions & 4 deletions xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h
Expand Up @@ -173,14 +173,14 @@ namespace ActiveAE
* @param bDataChanged True if the addon's data changed, false otherwise (unused).
* @return True if the audio dsp addon was found and restarted, false otherwise.
*/
virtual bool RequestRestart(ADDON::AddonPtr addon, bool bDataChanged);
virtual bool RequestRestart(ADDON::AddonPtr addon, bool bDataChanged) override;

/*!
* @brief Remove a single audio dsp add-on.
* @param addon The add-on to remove.
* @return True if it was found and removed, false otherwise.
*/
virtual bool RequestRemoval(ADDON::AddonPtr addon);
virtual bool RequestRemoval(ADDON::AddonPtr addon) override;

/*!
* @brief Checks whether an add-on is loaded
Expand All @@ -202,7 +202,7 @@ namespace ActiveAE
* @param obs
* @param msg The observed message type
*/
void Notify(const Observable &obs, const ObservableMessage msg);
void Notify(const Observable &obs, const ObservableMessage msg) override;

/*!
* @return The amount of enabled audio dsp addons.
Expand Down Expand Up @@ -404,7 +404,7 @@ namespace ActiveAE
/*!
* @brief Thread to which updates the backend information
*/
virtual void Process(void);
virtual void Process(void) override;

private:
/*!
Expand Down
4 changes: 2 additions & 2 deletions xbmc/epg/EpgContainer.h
Expand Up @@ -119,7 +119,7 @@ namespace EPG
* @param obs The observable that sent the update.
* @param msg The update message.
*/
virtual void Notify(const Observable &obs, const ObservableMessage msg);
virtual void Notify(const Observable &obs, const ObservableMessage msg) override;

virtual void OnSettingChanged(const CSetting *setting) override;

Expand Down Expand Up @@ -283,7 +283,7 @@ namespace EPG
/*!
* @brief EPG update thread
*/
virtual void Process(void);
virtual void Process(void) override;

/*!
* @brief Load all tables from the database
Expand Down
33 changes: 33 additions & 0 deletions xbmc/events/EventLog.cpp
Expand Up @@ -34,6 +34,39 @@
std::map<int, std::unique_ptr<CEventLog> > CEventLog::s_eventLogs;
CCriticalSection CEventLog::s_critical;

std::string CEventLog::EventLevelToString(EventLevel level)
{
switch (level)
{
case EventLevelBasic:
return "basic";

case EventLevelWarning:
return "warning";

case EventLevelError:
return "error";

case EventLevelInformation:
default:
break;
}

return "information";
}

EventLevel CEventLog::EventLevelFromString(const std::string& level)
{
if (level == "basic")
return EventLevelBasic;
if (level == "warning")
return EventLevelWarning;
if (level == "error")
return EventLevelError;

return EventLevelInformation;
}

CEventLog& CEventLog::GetInstance()
{
int currentProfileId = CProfilesManager::GetInstance().GetCurrentProfileId();
Expand Down
3 changes: 3 additions & 0 deletions xbmc/events/EventLog.h
Expand Up @@ -57,6 +57,9 @@ class CEventLog : public ISettingCallback

bool Execute(const std::string& eventIdentifier);

std::string EventLevelToString(EventLevel level);
EventLevel EventLevelFromString(const std::string& level);

void ShowFullEventLog(EventLevel level = EventLevelBasic, bool includeHigherLevels = true);

protected:
Expand Down
33 changes: 0 additions & 33 deletions xbmc/events/IEvent.h
Expand Up @@ -32,39 +32,6 @@ typedef enum EventLevel
EventLevelError
} EventLevel;

static std::string EventLevelToString(EventLevel level)
{
switch (level)
{
case EventLevelBasic:
return "basic";

case EventLevelWarning:
return "warning";

case EventLevelError:
return "error";

case EventLevelInformation:
default:
break;
}

return "information";
}

static EventLevel EventLevelFromString(const std::string& level)
{
if (level == "basic")
return EventLevelBasic;
if (level == "warning")
return EventLevelWarning;
if (level == "error")
return EventLevelError;

return EventLevelInformation;
}

class IEvent
{
public:
Expand Down
2 changes: 1 addition & 1 deletion xbmc/events/windows/GUIWindowEventLog.cpp
Expand Up @@ -238,7 +238,7 @@ bool CGUIWindowEventLog::GetDirectory(const std::string &strDirectory, CFileItem
if (!item->HasProperty(PROPERTY_EVENT_LEVEL))
continue;

EventLevel level = EventLevelFromString(item->GetProperty(PROPERTY_EVENT_LEVEL).asString());
EventLevel level = CEventLog::GetInstance().EventLevelFromString(item->GetProperty(PROPERTY_EVENT_LEVEL).asString());
if (level == currentLevel ||
(level > currentLevel && showHigherLevels))
filteredItems.Add(item);
Expand Down
4 changes: 2 additions & 2 deletions xbmc/filesystem/EventsDirectory.cpp
Expand Up @@ -50,7 +50,7 @@ bool CEventsDirectory::GetDirectory(const CURL& url, CFileItemList &items)
hostname = hostname.substr(0, hostname.size() - 1);
}

EventLevel level = EventLevelFromString(hostname);
EventLevel level = CEventLog::GetInstance().EventLevelFromString(hostname);

// get the events of the specified level(s)
events = log.Get(level, includeHigherLevels);
Expand All @@ -73,7 +73,7 @@ CFileItemPtr CEventsDirectory::EventToFileItem(const EventPtr& eventItem)
item->SetIconImage(eventItem->GetIcon());

item->SetProperty(PROPERTY_EVENT_IDENTIFIER, eventItem->GetIdentifier());
item->SetProperty(PROPERTY_EVENT_LEVEL, EventLevelToString(eventItem->GetLevel()));
item->SetProperty(PROPERTY_EVENT_LEVEL, CEventLog::GetInstance().EventLevelToString(eventItem->GetLevel()));
item->SetProperty(PROPERTY_EVENT_DESCRIPTION, eventItem->GetDescription());

return item;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/StereoscopicsManager.h
Expand Up @@ -80,7 +80,7 @@ class CStereoscopicsManager : public ISettingCallback,
CAction ConvertActionCommandToAction(const std::string &command, const std::string &parameter);
std::string NormalizeStereoMode(const std::string &mode);
virtual void OnSettingChanged(const CSetting *setting) override;
virtual bool OnMessage(CGUIMessage &message);
virtual bool OnMessage(CGUIMessage &message) override;
/*!
* @brief Handle 3D specific cActions
* @param action The action to process
Expand Down
2 changes: 1 addition & 1 deletion xbmc/network/WakeOnAccess.h
Expand Up @@ -35,7 +35,7 @@ class CWakeOnAccess : private IJobCallback, public ISettingCallback, public ISet

void QueueMACDiscoveryForAllRemotes();

virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job);
virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job) override;
virtual void OnSettingChanged(const CSetting *setting) override;
virtual void OnSettingsLoaded() override;

Expand Down
4 changes: 2 additions & 2 deletions xbmc/pvr/PVRManager.h
Expand Up @@ -112,7 +112,7 @@ namespace PVR
*/
virtual ~CPVRManager(void);

virtual void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data);
virtual void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) override;

/*!
* @brief Get the instance of the PVRManager.
Expand Down Expand Up @@ -584,7 +584,7 @@ namespace PVR
/*!
* @brief PVR update and control thread.
*/
virtual void Process(void);
virtual void Process(void) override;

private:
/*!
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/channels/PVRChannelGroup.h
Expand Up @@ -379,7 +379,7 @@ namespace PVR
*/
void ResetChannelNumberCache(void);

void OnJobComplete(unsigned int jobID, bool success, CJob* job) {}
void OnJobComplete(unsigned int jobID, bool success, CJob* job) override {}

/*!
* @brief Get all EPG tables and apply a filter.
Expand Down
12 changes: 6 additions & 6 deletions xbmc/settings/dialogs/GUIDialogSettingsBase.h
Expand Up @@ -71,19 +71,19 @@ class CGUIDialogSettingsBase
virtual ~CGUIDialogSettingsBase();

// specializations of CGUIControl
virtual bool OnMessage(CGUIMessage &message);
virtual bool OnAction(const CAction &action);
virtual bool OnBack(int actionID);
virtual void DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions);
virtual bool OnMessage(CGUIMessage &message) override;
virtual bool OnAction(const CAction &action) override;
virtual bool OnBack(int actionID) override;
virtual void DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;

virtual bool IsConfirmed() const { return m_confirmed; }

protected:
// specializations of CGUIWindow
virtual void OnInitWindow();
virtual void OnInitWindow() override;

// implementations of ITimerCallback
virtual void OnTimeout();
virtual void OnTimeout() override;

// implementations of ISettingCallback
virtual void OnSettingChanged(const CSetting *setting) override;
Expand Down
6 changes: 3 additions & 3 deletions xbmc/settings/dialogs/GUIDialogSettingsManagerBase.h
Expand Up @@ -31,10 +31,10 @@ class CGUIDialogSettingsManagerBase : public CGUIDialogSettingsBase

protected:
// implementation of CGUIDialogSettingsBase
virtual CSetting* GetSetting(const std::string &settingId);
virtual CSetting* GetSetting(const std::string &settingId) override;

virtual std::set<std::string> CreateSettings();
virtual void FreeSettingsControls();
virtual std::set<std::string> CreateSettings() override;
virtual void FreeSettingsControls() override;

// implementation of ISettingControlCreator
virtual ISettingControl* CreateControl(const std::string &controlType) const override;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/settings/lib/Setting.h
Expand Up @@ -111,7 +111,7 @@ class CSetting : public ISetting,
void SetCallback(ISettingCallback *callback) { m_callback = callback; }

// overrides of ISetting
virtual bool IsVisible() const;
virtual bool IsVisible() const override;

protected:
// implementation of ISettingCallback
Expand Down
2 changes: 1 addition & 1 deletion xbmc/settings/lib/SettingsManager.h
Expand Up @@ -100,7 +100,7 @@ class CSettingsManager : public ISettingCreator, public ISettingControlCreator,
returns to the uninitialized state. Any registered callbacks or
implementations stay registered.
*/
void Clear();
void Clear() override;

/*!
\brief Loads the setting being represented by the given XML node with the
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/SeekHandler.h
Expand Up @@ -43,7 +43,7 @@ class CSeekHandler : public ISettingCallback, public IActionListener
static void SettingOptionsSeekStepsFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int &current, void *data);

virtual void OnSettingChanged(const CSetting *setting) override;
virtual bool OnAction(const CAction &action);
virtual bool OnAction(const CAction &action) override;

void Seek(bool forward, float amount, float duration = 0, bool analogSeek = false, SeekType type = SEEK_TYPE_VIDEO);
void SeekSeconds(int seconds);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/SortUtils.cpp
Expand Up @@ -245,7 +245,7 @@ std::string ByRating(SortAttribute attributes, const SortItem &values)

std::string ByUserRating(SortAttribute attributes, const SortItem &values)
{
return StringUtils::Format("%d %s", values.at(FieldUserRating).asInteger(), ByLabel(attributes, values).c_str());
return StringUtils::Format("%d %s", static_cast<int>(values.at(FieldUserRating).asInteger()), ByLabel(attributes, values).c_str());
}

std::string ByVotes(SortAttribute attributes, const SortItem &values)
Expand Down

0 comments on commit 58142ec

Please sign in to comment.