[PATCH v4l-utils v1 06/11] qv4l2: fix Qt6 compile (ambiguous overload for operator!=)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes:

  ../qv4l2/general-tab.cpp:1113:57: error: ambiguous overload for ‘operator!=’ (operand types are ‘QString’ and ‘long int’)
   1113 |         m_audioOutDevice->setEnabled(getAudioInDevice() != NULL ? getAudioInDevice().compare("None") : false);
        |                                                         ^

  ../qv4l2/qv4l2.cpp:1261:19: error: ambiguous overload for ‘operator!=’ (operand types are ‘QString’ and ‘long int’)
   1261 |         if (audIn != NULL && audOut != NULL && audIn.compare("None") && audIn.compare(audOut) != 0) {
        |                   ^

  ../qv4l2/qv4l2.cpp:1912:26: error: ambiguous overload for ‘operator!=’ (operand types are ‘QString’ and ‘long int’)
   1912 |         if (video_device != NULL)
        |                          ^

  ../qv4l2/qv4l2.cpp:1914:29: error: ambiguous overload for ‘operator!=’ (operand types are ‘QString’ and ‘long int’)
   1914 |         else if (vbi_device != NULL)
        |                             ^

  ../qv4l2/qv4l2.cpp:1916:31: error: ambiguous overload for ‘operator!=’ (operand types are ‘QString’ and ‘long int’)
   1916 |         else if (radio_device != NULL)
        |                               ^

  ../qv4l2/qv4l2.cpp:1918:29: error: ambiguous overload for ‘operator!=’ (operand types are ‘QString’ and ‘long int’)
   1918 |         else if (sdr_device != NULL)
        |                             ^

Signed-off-by: Peter Seiderer <ps.report@xxxxxxx>
---
 utils/qv4l2/general-tab.cpp |  2 +-
 utils/qv4l2/qv4l2.cpp       | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 105c5cde..8bb03b59 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -1110,7 +1110,7 @@ bool GeneralTab::createAudioDeviceList()
 
 void GeneralTab::changeAudioDevice()
 {
-	m_audioOutDevice->setEnabled(getAudioInDevice() != NULL ? getAudioInDevice().compare("None") : false);
+	m_audioOutDevice->setEnabled(getAudioInDevice() != nullptr ? getAudioInDevice().compare("None") : false);
 	emit audioDeviceChanged();
 }
 
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index ea1ac201..e24bef13 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -1258,7 +1258,7 @@ void ApplicationWindow::startAudio()
 	QString audIn = m_genTab->getAudioInDevice();
 	QString audOut = m_genTab->getAudioOutDevice();
 
-	if (audIn != NULL && audOut != NULL && audIn.compare("None") && audIn.compare(audOut) != 0) {
+	if (audIn != nullptr && audOut != nullptr && audIn.compare("None") && audIn.compare(audOut) != 0) {
 		alsa_thread_startup(audOut.toLatin1().data(), audIn.toLatin1().data(),
 				    m_genTab->getAudioDeviceBufferSize(), NULL, 0);
 
@@ -1909,13 +1909,13 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (video_device != NULL)
+	if (video_device != nullptr)
 		device = getDeviceName("/dev/video", video_device);
-	else if (vbi_device != NULL)
+	else if (vbi_device != nullptr)
 		device = getDeviceName("/dev/vbi", vbi_device);
-	else if (radio_device != NULL)
+	else if (radio_device != nullptr)
 		device = getDeviceName("/dev/radio", radio_device);
-	else if (sdr_device != NULL)
+	else if (sdr_device != nullptr)
 		device = getDeviceName("/dev/swradio", sdr_device);
 	else
 		device = "/dev/video0";
-- 
2.40.0





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux