Advertisement
Guest User

Untitled

a guest
Mar 7th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audiooutputbase.cpp
  2. index 9213adf..8c29899 100644
  3. --- a/mythtv/libs/libmyth/audiooutputbase.cpp
  4. +++ b/mythtv/libs/libmyth/audiooutputbase.cpp
  5. @@ -76,7 +76,7 @@ AudioOutputBase::AudioOutputBase(const AudioSettings &settings) :
  6. source_bytes_per_frame(0),
  7. needs_upmix(false), needs_downmix(false),
  8. surround_mode(QUALITY_LOW), old_stretchfactor(1.0f),
  9. - volume(80), volumeControl(NULL),
  10. + volume(80), volumeControl(),
  11.  
  12. processing(false),
  13.  
  14. diff --git a/mythtv/libs/libmyth/mythdeque.h b/mythtv/libs/libmyth/mythdeque.h
  15. index bcd3698..274f43a 100644
  16. --- a/mythtv/libs/libmyth/mythdeque.h
  17. +++ b/mythtv/libs/libmyth/mythdeque.h
  18. @@ -3,9 +3,15 @@
  19. #ifndef __MYTH_DEQUE_H__
  20. #define __MYTH_DEQUE_H__
  21.  
  22. +#include <QString>
  23. #include <deque>
  24. using namespace std;
  25.  
  26. +template<typename T>
  27. +inline T myth_deque_init(const T*) { return (T)(0); }
  28. +template<>
  29. +inline QString myth_deque_init(const QString*) { return QString(); }
  30. +
  31. /** \class MythDeque
  32. * \brief MythDeque is similar to QPtrQueue, while being based off
  33. * deque, this allows that items that are not at the head of
  34. @@ -18,8 +24,9 @@ class MythDeque : public deque<T>
  35. /// \brief Removes item from front of list and returns a copy. O(1).
  36. T dequeue()
  37. {
  38. + T *dummy = NULL;
  39. if (deque<T>::empty())
  40. - return (T)(0);
  41. + return myth_deque_init(dummy);
  42. T item = deque<T>::front();
  43. deque<T>::pop_front();
  44. return item;
  45. @@ -65,16 +72,22 @@ class MythDeque : public deque<T>
  46. size_type count() const { return deque<T>::size(); }
  47.  
  48. /// \brief Returns item at head of list. O(1).
  49. - T head() { return (deque<T>::size()) ? deque<T>::front() : (T)(NULL); }
  50. + T head()
  51. + { if (!deque<T>::empty()) return deque<T>::front();
  52. + T *dummy = NULL; return myth_deque_init(dummy); }
  53. /// \brief Returns item at head of list. O(1).
  54. const T head() const
  55. - { return (deque<T>::size()) ? deque<T>::front() : (T)(NULL); }
  56. + { if (!deque<T>::empty()) return deque<T>::front();
  57. + T *dummy = NULL; return myth_deque_init(dummy); }
  58.  
  59. /// \brief Returns item at tail of list. O(1).
  60. - T tail() { return (deque<T>::size()) ? deque<T>::back() : (T)(NULL); }
  61. + T tail()
  62. + { if (!deque<T>::empty()) return deque<T>::back();
  63. + T *dummy = NULL; return myth_deque_init(dummy); }
  64. /// \brief Returns item at tail of list. O(1).
  65. const T tail() const
  66. - { return (deque<T>::size()) ? deque<T>::back() : (T)(NULL); }
  67. + { if (!deque<T>::empty()) return deque<T>::back();
  68. + T *dummy = NULL; return myth_deque_init(dummy); }
  69. };
  70.  
  71. #endif // __MYTH_DEQUE_H__
  72. diff --git a/mythtv/libs/libmythtv/recordingprofile.h b/mythtv/libs/libmythtv/recordingprofile.h
  73. index 6765601..5ebc220 100644
  74. --- a/mythtv/libs/libmythtv/recordingprofile.h
  75. +++ b/mythtv/libs/libmythtv/recordingprofile.h
  76. @@ -84,7 +84,7 @@ class MPUBLIC RecordingProfile : public QObject, public ConfigurationWizard
  77.  
  78. public:
  79. // initializers
  80. - RecordingProfile(QString profName = NULL);
  81. + RecordingProfile(QString profName = QString());
  82. virtual void loadByID(int id);
  83. virtual bool loadByType(const QString &name, const QString &cardtype);
  84. virtual bool loadByGroup(const QString &name, const QString &group);
  85. diff --git a/mythtv/libs/libmythupnp/eventing.h b/mythtv/libs/libmythupnp/eventing.h
  86. index cadadcf..656784b 100644
  87. --- a/mythtv/libs/libmythupnp/eventing.h
  88. +++ b/mythtv/libs/libmythupnp/eventing.h
  89. @@ -233,7 +233,7 @@ class UPNP_PUBLIC StateVariables
  90. {
  91. SVMap::iterator it = m_map.find(sName);
  92. if (it == m_map.end())
  93. - return T(0);
  94. + return T();
  95.  
  96. StateVariable< T > *pVariable =
  97. dynamic_cast< StateVariable< T > *>( *it );
  98. @@ -241,7 +241,7 @@ class UPNP_PUBLIC StateVariables
  99. if (pVariable != NULL)
  100. return pVariable->GetValue();
  101.  
  102. - return T(0);
  103. + return T();
  104. }
  105.  
  106. uint BuildNotifyBody(QTextStream &ts, TaskTime ttLastNotified) const;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement