Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audiooutputbase.cpp
- index 9213adf..8c29899 100644
- --- a/mythtv/libs/libmyth/audiooutputbase.cpp
- +++ b/mythtv/libs/libmyth/audiooutputbase.cpp
- @@ -76,7 +76,7 @@ AudioOutputBase::AudioOutputBase(const AudioSettings &settings) :
- source_bytes_per_frame(0),
- needs_upmix(false), needs_downmix(false),
- surround_mode(QUALITY_LOW), old_stretchfactor(1.0f),
- - volume(80), volumeControl(NULL),
- + volume(80), volumeControl(),
- processing(false),
- diff --git a/mythtv/libs/libmyth/mythdeque.h b/mythtv/libs/libmyth/mythdeque.h
- index bcd3698..274f43a 100644
- --- a/mythtv/libs/libmyth/mythdeque.h
- +++ b/mythtv/libs/libmyth/mythdeque.h
- @@ -3,9 +3,15 @@
- #ifndef __MYTH_DEQUE_H__
- #define __MYTH_DEQUE_H__
- +#include <QString>
- #include <deque>
- using namespace std;
- +template<typename T>
- +inline T myth_deque_init(const T*) { return (T)(0); }
- +template<>
- +inline QString myth_deque_init(const QString*) { return QString(); }
- +
- /** \class MythDeque
- * \brief MythDeque is similar to QPtrQueue, while being based off
- * deque, this allows that items that are not at the head of
- @@ -18,8 +24,9 @@ class MythDeque : public deque<T>
- /// \brief Removes item from front of list and returns a copy. O(1).
- T dequeue()
- {
- + T *dummy = NULL;
- if (deque<T>::empty())
- - return (T)(0);
- + return myth_deque_init(dummy);
- T item = deque<T>::front();
- deque<T>::pop_front();
- return item;
- @@ -65,16 +72,22 @@ class MythDeque : public deque<T>
- size_type count() const { return deque<T>::size(); }
- /// \brief Returns item at head of list. O(1).
- - T head() { return (deque<T>::size()) ? deque<T>::front() : (T)(NULL); }
- + T head()
- + { if (!deque<T>::empty()) return deque<T>::front();
- + T *dummy = NULL; return myth_deque_init(dummy); }
- /// \brief Returns item at head of list. O(1).
- const T head() const
- - { return (deque<T>::size()) ? deque<T>::front() : (T)(NULL); }
- + { if (!deque<T>::empty()) return deque<T>::front();
- + T *dummy = NULL; return myth_deque_init(dummy); }
- /// \brief Returns item at tail of list. O(1).
- - T tail() { return (deque<T>::size()) ? deque<T>::back() : (T)(NULL); }
- + T tail()
- + { if (!deque<T>::empty()) return deque<T>::back();
- + T *dummy = NULL; return myth_deque_init(dummy); }
- /// \brief Returns item at tail of list. O(1).
- const T tail() const
- - { return (deque<T>::size()) ? deque<T>::back() : (T)(NULL); }
- + { if (!deque<T>::empty()) return deque<T>::back();
- + T *dummy = NULL; return myth_deque_init(dummy); }
- };
- #endif // __MYTH_DEQUE_H__
- diff --git a/mythtv/libs/libmythtv/recordingprofile.h b/mythtv/libs/libmythtv/recordingprofile.h
- index 6765601..5ebc220 100644
- --- a/mythtv/libs/libmythtv/recordingprofile.h
- +++ b/mythtv/libs/libmythtv/recordingprofile.h
- @@ -84,7 +84,7 @@ class MPUBLIC RecordingProfile : public QObject, public ConfigurationWizard
- public:
- // initializers
- - RecordingProfile(QString profName = NULL);
- + RecordingProfile(QString profName = QString());
- virtual void loadByID(int id);
- virtual bool loadByType(const QString &name, const QString &cardtype);
- virtual bool loadByGroup(const QString &name, const QString &group);
- diff --git a/mythtv/libs/libmythupnp/eventing.h b/mythtv/libs/libmythupnp/eventing.h
- index cadadcf..656784b 100644
- --- a/mythtv/libs/libmythupnp/eventing.h
- +++ b/mythtv/libs/libmythupnp/eventing.h
- @@ -233,7 +233,7 @@ class UPNP_PUBLIC StateVariables
- {
- SVMap::iterator it = m_map.find(sName);
- if (it == m_map.end())
- - return T(0);
- + return T();
- StateVariable< T > *pVariable =
- dynamic_cast< StateVariable< T > *>( *it );
- @@ -241,7 +241,7 @@ class UPNP_PUBLIC StateVariables
- if (pVariable != NULL)
- return pVariable->GetValue();
- - return T(0);
- + return T();
- }
- uint BuildNotifyBody(QTextStream &ts, TaskTime ttLastNotified) const;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement