Browse Source

Fixes for clang compatibility

Clemens-Alexander Brust 11 years ago
parent
commit
1b89dc3c6a

+ 5 - 0
core/basics/progs/testConfig.cpp

@@ -16,8 +16,13 @@ using namespace std;
 */
 */
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
+
 #ifndef WIN32
 #ifndef WIN32
+#ifndef __clang__
+#ifndef __llvm__ 
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 #endif
 #endif
 
 
     Config conf ( argc, argv );
     Config conf ( argc, argv );

+ 1 - 1
core/image/BlockImageAccessT.tcc

@@ -32,7 +32,7 @@ void BlockImageAccessT<P>::set(const P& value) {
   for(int y=0; y<this->height(); ++y) {
   for(int y=0; y<this->height(); ++y) {
     const P* end = this->getPixelPointerYEnd(y);
     const P* end = this->getPixelPointerYEnd(y);
     const int inc = this->columnStepsize();
     const int inc = this->columnStepsize();
-    for (P* p = this->getPixelPointerY(y); p != end; p = (void*)p + inc) {
+    for (P* p = this->getPixelPointerY(y); p != end; p = p + inc) {
       *p = value;
       *p = value;
     }
     }
   }
   }

+ 2 - 7
core/image/GrayColorImageCommonImplementationT.h

@@ -178,10 +178,7 @@ public:
    * @note   If you want to explicitly select a file format,
    * @note   If you want to explicitly select a file format,
    *         use read(ImageFile, const GrayColorImageCommonImplementation::MemoryLayout)
    *         use read(ImageFile, const GrayColorImageCommonImplementation::MemoryLayout)
    */
    */
-  inline void read(const std::string &filename /*,
-                   const GrayColorImageCommonImplementation::MemoryLayout _memoryLayout = ippAlignment*/) {
-    read(ImageFile(filename)/*, _memoryLayout*/);
-  }
+  void read(const std::string &filename); 
 
 
   /**
   /**
   * Write this image to a file. See also documentation of \c ImageFile.
   * Write this image to a file. See also documentation of \c ImageFile.
@@ -196,9 +193,7 @@ public:
    * @note If you want to explicitly select a file format,
    * @note If you want to explicitly select a file format,
    *       use write(ImageFile)
    *       use write(ImageFile)
    */
    */
-  inline void write(const std::string &filename) const {
-    write(ImageFile(filename));
-  }
+  inline void write(const std::string &filename) const; 
 
 
   /**
   /**
   * Read this image from a PPM or PGM file.
   * Read this image from a PPM or PGM file.

+ 10 - 0
core/image/GrayColorImageCommonImplementationT.tcc

@@ -195,4 +195,14 @@ void GrayColorImageCommonImplementationT<P>::writePXM(const char* pxmFileName) c
   }
   }
 }
 }
 
 
+template <class P>
+void GrayColorImageCommonImplementationT<P>::read(const std::string &filename) {
+    read(ImageFile(filename)/*, _memoryLayout*/);
+}
+
+template <class P>
+void GrayColorImageCommonImplementationT<P>::write(const std::string &filename) const {
+    write(ImageFile(filename));
+}
+
 } // namespace
 } // namespace

+ 10 - 2
core/imagedisplay/QtFramework.cpp

@@ -28,7 +28,11 @@ QtFramework::QtFramework()
 #endif
 #endif
 
 
 #ifndef WIN32
 #ifndef WIN32
-  std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#ifndef __clang__
+#ifndef __llvm__ 
+    std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 #endif
 #endif
 }
 }
 
 
@@ -40,7 +44,11 @@ QtFramework::QtFramework(int& argc, char** argv)
 #endif
 #endif
 
 
 #ifndef WIN32
 #ifndef WIN32
-  std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#ifndef __clang__
+#ifndef __llvm__ 
+    std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 #endif
 #endif
 }
 }
 
 

+ 6 - 1
core/imagedisplay/progs/showImage.cpp

@@ -18,8 +18,13 @@ using namespace std;
 */
 */
 int main ( int argc, char **argv )
 int main ( int argc, char **argv )
 {
 {
+
 #ifndef WIN32
 #ifndef WIN32
-  std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
+#ifndef __clang__
+#ifndef __llvm__ 
+    std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 #endif
 #endif
 
 
   for ( int i = 1 ; i < argc ; i++ )
   for ( int i = 1 ; i < argc ; i++ )

+ 1 - 0
core/vector/ippwrapper.tcc

@@ -4,6 +4,7 @@
 #include <numeric>
 #include <numeric>
 #include <cmath>
 #include <cmath>
 #include <functional>
 #include <functional>
+#include <cstdlib>
 
 
 template<class P>
 template<class P>
 inline IppStatus ippsCopy( const P* pSrc, P* pDst, int len ) {
 inline IppStatus ippsCopy( const P* pSrc, P* pDst, int len ) {

+ 4 - 0
core/vector/progs/testCholeskySpeed.cpp

@@ -38,7 +38,11 @@ double getInvError ( const Matrix & A, const Matrix & Ainv )
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {   
 {   
 #ifndef WIN32
 #ifndef WIN32
+#ifndef __clang__
+#ifndef __llvm__ 
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
+#endif
 #endif
 #endif
 
 
     int size = 500;
     int size = 500;