فهرست منبع

changed macro WARNING/ERROR to NICE_WARNING/NICE_ERRROR

Johannes R 12 سال پیش
والد
کامیت
e10b709dfc

+ 4 - 4
core/basics/CrossplatformDefines.h

@@ -9,14 +9,14 @@
 #define STRINGISE_IMPL(x) #x
 #define STRINGISE(x) STRINGISE_IMPL(x)
 
-// Use: #pragma message WARNING("My message")
+// Use: #pragma message NICE_WARNING("My message")
 #if _MSC_VER
 #   define FILE_LINE_LINK __FILE__ "(" STRINGISE(__LINE__) ") : "
-#   define WARNING(exp) (FILE_LINE_LINK "WARNING: " exp)
+#   define NICE_WARNING(exp) (FILE_LINE_LINK "WARNING: " exp)
 
 #   define __MESSAGE(text) __pragma( message(__FILE__ "(" STRINGISE(__LINE__) ")" text) ) 
-#   define ERROR(text) __MESSAGE( " : Error: " #text )
-#   define MESSAGE(text) __MESSAGE( ": " #text )
+#   define NICE_ERROR(text) __MESSAGE( " : Error: " #text )
+#   define NICE_MESSAGE(text) __MESSAGE( ": " #text )
 //#   define TODO(text) WARNING( TODO: text )
 //use as:
 //ERROR( This will be a compiler error );

+ 2 - 2
core/basics/FileMgt.cpp

@@ -66,7 +66,7 @@ void FileMgt::DirectoryRecursive ( std::vector<string> & files, const std::strin
 
 	std::sort ( files.begin(), files.end() );
 #else
-	#pragma message WARNING("FileMgt::DirectoryRecursive() : Function not yet ported for platform WIN")
+	#pragma message NICE_WARNING("FileMgt::DirectoryRecursive() : Function not yet ported for platform WIN")
 	fthrow ( Exception, "FileMgt::DirectoryRecursive() : Function not yet ported for platform WIN");
 #endif
 }
@@ -109,7 +109,7 @@ std::string FileMgt::createTempFile ( const std::string & templatefn )
 
     return string(fn);
 #else
-	#pragma message WARNING("FileMgt::createTempFile() : Function not yet ported for platform WIN")
+	#pragma message NICE_WARNING("FileMgt::createTempFile() : Function not yet ported for platform WIN")
 	fthrow ( Exception, "FileMgt::createTempFile() : Function not yet ported for platform WIN");
 #endif
 }

+ 1 - 1
core/basics/ResourceStatistics.cpp

@@ -139,7 +139,7 @@ void ResourceStatistics::getStatistics(long & memory, double & userCpuTime, doub
 /// WIN32 PORT following here
 #include "CrossplatformDefines.h"
 
-#pragma message WARNING("ResourceStatistics class : not yet ported to WIN32 plattform")
+#pragma message NICE_WARNING("ResourceStatistics class : not yet ported to WIN32 plattform")
 
 ResourceStatistics::ResourceStatistics(int _mode)
 {

+ 4 - 4
core/basics/Timer.cpp

@@ -41,7 +41,7 @@ double Timer::getCurrentAbsoluteTime() const {
 	return getNow();
  #else
 	return -1.0;
-	#pragma message WARNING("Timer::getCurrentAbsoluteTime() : not yet ported to WIN32 plattform, returning -1")
+	#pragma message NICE_WARNING("Timer::getCurrentAbsoluteTime() : not yet ported to WIN32 plattform, returning -1")
  #endif
 #else
 #ifdef LIMUN_AIBO_MODE
@@ -93,7 +93,7 @@ double Timer::getNow()
 	return  diff.total_seconds();
  #else
 	return -1.0;
-	#pragma message WARNING("Timer::getNow() : not yet ported to WIN32 plattform, returning -1")
+	#pragma message NICE_WARNING("Timer::getNow() : not yet ported to WIN32 plattform, returning -1")
  #endif
 #else
 #ifdef LIMUN_AIBO_MODE
@@ -125,7 +125,7 @@ long int Timer::getMicroseconds() {
 	return getNow();
  #else
 	return -1.0;
-	#pragma message WARNING("Timer::getMicroseconds() : not yet ported to WIN32 plattform, returning -1")
+	#pragma message NICE_WARNING("Timer::getMicroseconds() : not yet ported to WIN32 plattform, returning -1")
  #endif
 #else
 
@@ -174,7 +174,7 @@ void Timer::reset() {
       return double ( time.tv_sec ) + double ( time.tv_usec ) * 1e-6;
 #else
 		return -1.0;
-		#pragma message WARNING("Timer::convertTime() : not yet ported to WIN32 plattform, returning -1")
+		#pragma message NICE_WARNING("Timer::convertTime() : not yet ported to WIN32 plattform, returning -1")
 #endif
     }
 

+ 1 - 1
core/basics/binstream.h

@@ -327,7 +327,7 @@ inline obinstream& operator<<(obinstream &s, const LinAl::MatrixC<Tp> &A) {
 
 #else
 #ifndef LINAL_WARNING
-#pragma message WARNING("LinAl addons will not be compiled.")
+#pragma message NICE_WARNING("LinAl addons will not be compiled.")
 #define LINAL_WARNING
 #endif
 #endif

+ 1 - 1
core/basics/bzstream.cpp

@@ -163,7 +163,7 @@ void bzstreambase::close() {
 } // namespace
 
 #else
-#pragma message WARNING("bzstream will not be compiled.")
+#pragma message NICE_WARNING("bzstream will not be compiled.")
 #endif
 
 // ============================================================================

+ 1 - 1
core/basics/gzstream.cpp

@@ -162,7 +162,7 @@ void gzstreambase::close() {
 
 #else
 #include "CrossplatformDefines.h"
-#pragma message WARNING("gzstream will not be compiled.")
+#pragma message NICE_WARNING("gzstream will not be compiled.")
 #endif
 
 // ============================================================================

+ 1 - 1
core/basics/numerictools.h

@@ -246,7 +246,7 @@ inline bool isFinite(double x)
 	#ifdef NICE_BOOST_FOUND
 	    return boost::math::isfinite(x);
 	#else
-		ERROR("isFinite() not defined (and neither is boost found for compensation...)")
+		NICE_ERROR("isFinite() not defined (and neither is boost found for compensation...)")
 	#endif
 #else
 	return finite(x);

+ 2 - 2
core/image/DeprecatedConverter.cpp

@@ -844,7 +844,7 @@ Image* DeprecatedConverter::filterY(const Image& src, const VectorT<int> &kernel
     return result;
   #else // NICE_USELIB_IPP
   /*
-#warning untested
+#pragma message NICE_WARNING("untested")
     int yend=src.height()-anchor;
     int xend=src.width();
     Image &d=*result;
@@ -903,7 +903,7 @@ Image* DeprecatedConverter::filter(const Image& src, const ImageT<int> &kernel,
     }
   #else // NICE_USELIB_IPP
   /*
-#warning untested
+#pragma message NICE_WARNING("untested")
     int yend=src.height()-anchory;
     int xend=src.width()-anchorx;
     Image &d=*result;

+ 3 - 2
core/image/DeprecatedConverter.tcc

@@ -418,7 +418,7 @@ ImageT<P>* DeprecatedConverter::filterX(const ImageT<P>& src, const VectorT<floa
     return result;
   #else // NICE_USELIB_IPP
 	/*
-#warning untested
+#pragma message NICE_WARNING("untested")
     int yend=src.height();
     int xend=src.width()-kernel.size()+anchor;
     ImageT<P> &d=*result;
@@ -723,6 +723,7 @@ VectorT<int>* DeprecatedConverter::histogram(const ColorImageT<P>& src, int min,
 template <class P>
 VectorT<int>* DeprecatedConverter::histogram(const ColorImageT<P>& src, VectorT<int> *histo, int  min, int max)
 {
+#ifdef NICE_USELIB_IPP
 	int	nolevels=histo->size()/3;
 	int levels[(nolevels+1)*3];
 	int pnolevels[3];
@@ -735,7 +736,7 @@ VectorT<int>* DeprecatedConverter::histogram(const ColorImageT<P>& src, VectorT<
 		pmax[i]=max;
 		pnolevels[i]=nolevels+1;
 	}
-  #ifdef NICE_USELIB_IPP
+ 
 	ippiHistogramEven_C3R(src.getPixelPointer(), src.getStepsize(), makeROIFullImage(src), phisto, plevels, pnolevels, pmin, pmax);
   #else // NICE_USELIB_IPP
     fthrow(ImageException,"Not yet supported without IPP.");

+ 1 - 1
core/image/Filter.h

@@ -19,7 +19,7 @@
 #include <core/image/ColorImageT.h>
 #include <core/image/Buffer.h>
 
-#pragma message WARNING("Filter.h is obsolete. Please use FilterT.h instead and adapt your calls and implement the filter if necessary :)")
+#pragma message NICE_WARNING("Filter.h is obsolete. Please use FilterT.h instead and adapt your calls and implement the filter if necessary :)")
 
 namespace NICE {
 /**

+ 1 - 1
core/matlabAccess/MatFileIO.h

@@ -20,7 +20,7 @@
 
 #ifndef NICE_USELIB_MATIO
 
-#pragma message WARNING("We need the MATIO Library for accessing MATLAB structures. Otherwise this is not compiling.")
+#pragma message NICE_WARNING("We need the MATIO Library for accessing MATLAB structures. Otherwise this is not compiling.")
 
 #else //#ifdef NICE_USELIB_MATIO
 

+ 3 - 3
core/vector/Algorithms.cpp

@@ -61,7 +61,7 @@ void choleskyDecompLargeScale ( const Matrix & A, Matrix & G, bool resetUpperTri
 				G(i,j) = 0;
 #else
   #ifndef CHOLESKYLINAL_WARNING
-	#pragma message WARNING("LinAl is not installed: choleskyDecompLargeScale will not be optimized.")
+	#pragma message NICE_WARNING("LinAl is not installed: choleskyDecompLargeScale will not be optimized.")
   #define CHOLESKYLINAL_WARNING
   #endif
 	choleskyDecomp ( A, G, resetUpperTriangle );
@@ -102,7 +102,7 @@ void choleskySolveMatrixLargeScale ( const Matrix & G, Matrix & B )
 		B.getDataPointer(), &ldb, &info );
 #else
   #ifndef CHOLESKYLINAL_WARNING
-	#warning "LinAl is not installed: choleskyInvertLargeScale will not be optimized."
+	#pragma message NICE_WARNING("LinAl is not installed: choleskyInvertLargeScale will not be optimized.")
   #define CHOLESKYLINAL_WARNING
   #endif
 	choleskyInvert ( G, B );
@@ -209,7 +209,7 @@ void choleskySolveLargeScale ( const Matrix & G, const Vector & b, Vector & x )
 
 #else
   #ifndef CHOLESKYLINAL_WARNING
-	#warning "LinAl is not installed: choleskyInvertLargeScale will not be optimized."
+	#pragma message NICE_WARNING("LinAl is not installed: choleskyInvertLargeScale will not be optimized.")
   #define CHOLESKYLINAL_WARNING
   #endif
 	choleskySolve ( G, b, x );

+ 1 - 1
core/vector/SVD.h

@@ -119,7 +119,7 @@ inline void enforceRankDefect(MatrixT<T>& m, const uint defect) {
 
 #else // no LinAl
 #ifndef SVDLINAL_WARNING
-#pragma message WARNING("SVD requires LinAl.")
+#pragma message NICE_WARNING("SVD requires LinAl.")
 #define SVDLINAL_WARNING
 #endif
 #endif

+ 1 - 1
core/vector/SparseVector.h

@@ -1,2 +1,2 @@
 #include "core/vector/SparseVectorT.h"
-#warning "SparseVector.h is obsolete. Please use SparseVectorT.h instead"
+#pragma message NICE_WARNING("SparseVector.h is obsolete. Please use SparseVectorT.h instead")

+ 1 - 1
core/vector/ippwrapper.h

@@ -17,7 +17,7 @@
     #include <ipps.h>
     #include <ippm.h>
   #else
-    #warning "Not fully supported with IPP < 4"
+	#pragma message NICE_WARNING("Not fully supported with IPP < 4")
   #endif
 
 #else // NICE_USELIB_IPP