ports/152759: multimedia/mythtv and multimedia/mythtv-frontend: fix build with upcoming Qt-4.7

Max Brazhnikov makc at FreeBSD.org
Wed Dec 1 23:30:10 UTC 2010


>Number:         152759
>Category:       ports
>Synopsis:       multimedia/mythtv and multimedia/mythtv-frontend: fix build with upcoming Qt-4.7
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 01 23:30:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Max Brazhnikov
>Release:        FreeBSD 8.2-PRERELEASE amd64
>Organization:
>Environment:
FreeBSD luna.dio.ru 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Tue Nov 30 22:58:45 MSK 2010     root at luna.dio.ru:/usr/obj/usr/freebsd/8/src/sys/LUNA  amd64
>Description:
Add patches from upstream to fix build with Qt-4.7.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: mythtv/files/patch-26391
===================================================================
RCS file: mythtv/files/patch-26391
diff -N mythtv/files/patch-26391
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mythtv/files/patch-26391	1 Dec 2010 20:01:28 -0000
@@ -0,0 +1,11 @@
+--- ./libs/libmythtv/recordingprofile.h.orig	2009-10-22 03:30:12.000000000 +0400
++++ ./libs/libmythtv/recordingprofile.h	2010-12-01 23:01:20.247699483 +0300
+@@ -84,7 +84,7 @@
+ 
+   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);
Index: mythtv/files/patch-26434
===================================================================
RCS file: mythtv/files/patch-26434
diff -N mythtv/files/patch-26434
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mythtv/files/patch-26434	1 Dec 2010 20:07:18 -0000
@@ -0,0 +1,82 @@
+Index: ./libs/libmyth/mythdeque.h
+===================================================================
+--- ./libs/libmyth/mythdeque.h	(revision 20349)
++++ ./libs/libmyth/mythdeque.h	(revision 26434)
+@@ -4,6 +4,12 @@
+ #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
+@@ -19,6 +25,7 @@
+     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();
+@@ -66,14 +73,20 @@
+ 
+     /// \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); }
+ };
+ 
+Index: ./libs/libmythupnp/eventing.h
+===================================================================
+--- ./libs/libmythupnp/eventing.h	(revision 23038)
++++ ./libs/libmythupnp/eventing.h	(revision 26434)
+@@ -174,4 +174,9 @@
+ //////////////////////////////////////////////////////////////////////////////
+ 
++template<typename T>
++inline T state_var_init(const T*) { return (T)(0); }
++template<>
++inline QString state_var_init(const QString*) { return QString(); }
++
+ class UPNP_PUBLIC StateVariables
+ {   
+@@ -232,7 +237,8 @@
+         T GetValue( const QString &sName )
+         {
++            T *dummy = NULL;
+             SVMap::iterator it = m_map.find(sName);
+             if (it == m_map.end())
+-                return T(0);
++                return state_var_init(dummy);
+ 
+             StateVariable< T > *pVariable =
+@@ -242,5 +248,5 @@
+                 return pVariable->GetValue();
+ 
+-            return T(0);
++            return state_var_init(dummy);
+         }
+ 
Index: mythtv-frontend/files/patch-26391
===================================================================
RCS file: mythtv-frontend/files/patch-26391
diff -N mythtv-frontend/files/patch-26391
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mythtv-frontend/files/patch-26391	1 Dec 2010 20:01:28 -0000
@@ -0,0 +1,11 @@
+--- ./libs/libmythtv/recordingprofile.h.orig	2009-10-22 03:30:12.000000000 +0400
++++ ./libs/libmythtv/recordingprofile.h	2010-12-01 23:01:20.247699483 +0300
+@@ -84,7 +84,7 @@
+ 
+   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);
Index: mythtv-frontend/files/patch-26434
===================================================================
RCS file: mythtv-frontend/files/patch-26434
diff -N mythtv-frontend/files/patch-26434
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mythtv-frontend/files/patch-26434	1 Dec 2010 20:07:18 -0000
@@ -0,0 +1,82 @@
+Index: ./libs/libmyth/mythdeque.h
+===================================================================
+--- ./libs/libmyth/mythdeque.h	(revision 20349)
++++ ./libs/libmyth/mythdeque.h	(revision 26434)
+@@ -4,6 +4,12 @@
+ #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
+@@ -19,6 +25,7 @@
+     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();
+@@ -66,14 +73,20 @@
+ 
+     /// \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); }
+ };
+ 
+Index: ./libs/libmythupnp/eventing.h
+===================================================================
+--- ./libs/libmythupnp/eventing.h	(revision 23038)
++++ ./libs/libmythupnp/eventing.h	(revision 26434)
+@@ -174,4 +174,9 @@
+ //////////////////////////////////////////////////////////////////////////////
+ 
++template<typename T>
++inline T state_var_init(const T*) { return (T)(0); }
++template<>
++inline QString state_var_init(const QString*) { return QString(); }
++
+ class UPNP_PUBLIC StateVariables
+ {   
+@@ -232,7 +237,8 @@
+         T GetValue( const QString &sName )
+         {
++            T *dummy = NULL;
+             SVMap::iterator it = m_map.find(sName);
+             if (it == m_map.end())
+-                return T(0);
++                return state_var_init(dummy);
+ 
+             StateVariable< T > *pVariable =
+@@ -242,5 +248,5 @@
+                 return pVariable->GetValue();
+ 
+-            return T(0);
++            return state_var_init(dummy);
+         }
+ 


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list