Package: smb4k
Severity: important
Tags: patch

Smb4k failed to build on the armel and armhf autobuilders with the following 
error.

cd /build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/obj-arm-linux-gnueabi/core 
&& /usr/bin/c++   -DMAKE_SMB4KCORE_LIB -D_BSD_SOURCE -D_XOPEN_SOURCE=500 
-D_BSD_SOURCE -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS 
-DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=40 -g -O2 -fstack-protector --param=ssp-buffer-size=4 
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  -Wnon-virtual-dtor -Wno-long-long 
-ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security 
-fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual 
-fno-threadsafe-statics -fvisibility=hidden -Werror=return-type 
-fvisibility-inlines-hidden -DNDEBUG -DQT_NO_DEBUG -fPIC 
-I/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/obj-arm-linux-gnueabi/core 
-I/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core 
-I/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1 
-I/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/obj-arm-linux-gnueabi 
-I/usr/include/KDE -I/usr/include/qt4/phonon -I/usr/include/qt4/QtXmlPatterns 
-I/usr/include/qt4/QtXml -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtTest 
-I/usr/include/qt4/QtSvg -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtScriptTools 
-I/usr/include/qt4/QtScript -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtHelp 
-I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtDeclarative 
-I/usr/include/qt4/QtDBus -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtGui 
-I/usr/include/qt4/QtCore -I/usr/include/qt4/Qt -I/usr/share/qt4/mkspecs/default 
-I/usr/include/qt4    -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o 
CMakeFiles/smb4kcore.dir/smb4kshare.o -c 
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp: In 
member function 'QString Smb4KShare::totalDiskSpaceString() const':
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp:482:50:
 error: cannot convert 'qreal* {aka float*}' to 'double*' for argument '2' to 
'double modf(double, double*)'
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp: In 
member function 'QString Smb4KShare::freeDiskSpaceString() const':
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp:539:50:
 error: cannot convert 'qreal* {aka float*}' to 'double*' for argument '2' to 
'double modf(double, double*)'
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp: In 
member function 'QString Smb4KShare::usedDiskSpaceString() const':
/build/buildd-smb4k_1.0.1-1-armel-kH7YB_/smb4k-1.0.1/core/smb4kshare.cpp:596:50:
 error: cannot convert 'qreal* {aka float*}' to 'double*' for argument '2' to 
'double modf(double, double*)'
make[3]: *** [core/CMakeFiles/smb4kcore.dir/smb4kshare.o] Error 1

On most architectures qreal is defined as double but on arm architectures it is
defined as float. Assignments between qreal and double are ok because 
assignments
between float and double are ok. But assignments between pointers to qreal and
pointers to double are not ok. There can also be issues with templates and overloaded functions.

The fix is pretty trivial, just a matter of tweaking some variable definitions.
Patch is attatched.

Description: Fix qreal vs double issues.
 The code in smb4kshare.cpp tries to pass pointers to qreal to functions
 expecting pointers to double. This breaks on arm architectures where
 qreal is defined as float.

 The patch fixes the issue by changing variable declarations.
Author: Fathi Boudra <f...@debian.org>
Bug-Debian: http://bugs.debian.org/638162

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- smb4k-1.0.1.orig/core/smb4kshare.cpp
+++ smb4k-1.0.1/core/smb4kshare.cpp
@@ -475,7 +475,7 @@ QString Smb4KShare::totalDiskSpaceString
   QString total, total_dim = QString();
 
   int exponent = 0;
-  qreal tmp_factor = 0;
+  double tmp_factor = 0;
   qulonglong factor = 0;
 
   (void) frexp( m_total * 1024, &exponent );
@@ -532,7 +532,7 @@ QString Smb4KShare::freeDiskSpaceString(
   QString free, free_dim = QString();
 
   int exponent = 0;
-  qreal tmp_factor = 0;
+  double tmp_factor = 0;
   qulonglong factor = 0;
 
   (void) frexp( m_free * 1024, &exponent );
@@ -589,7 +589,7 @@ QString Smb4KShare::usedDiskSpaceString(
   QString used, used_dim = QString();
 
   int exponent = 0;
-  qreal tmp_factor = 0;
+  double tmp_factor = 0;
   qulonglong factor = 0;
 
   (void) frexp( m_used * 1024, &exponent );
_______________________________________________
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-kde-extras

Reply via email to