diff --git a/Nef_2/demo/Nef_2/CMakeLists.txt b/Nef_2/demo/Nef_2/CMakeLists.txt index 327c7282afa..7226237a65a 100644 --- a/Nef_2/demo/Nef_2/CMakeLists.txt +++ b/Nef_2/demo/Nef_2/CMakeLists.txt @@ -20,6 +20,7 @@ find_package(Qt3-patched) if ( CGAL_FOUND AND CGAL_Qt3_FOUND AND QT3_FOUND ) + include_directories(BEFORE ../../include) # use the Qt MOC preprocessor on classes that derives from QObject include( Qt3Macros-patched ) qt3_generate_moc( "${CMAKE_CURRENT_SOURCE_DIR}/nef_2.cpp" nef_2.moc ) diff --git a/Nef_2/include/CGAL/Nef_2/Polynomial.h b/Nef_2/include/CGAL/Nef_2/Polynomial.h index c9854a8640a..4195888f9d7 100644 --- a/Nef_2/include/CGAL/Nef_2/Polynomial.h +++ b/Nef_2/include/CGAL/Nef_2/Polynomial.h @@ -352,6 +352,7 @@ template class Polynomial : /*{\Mop returns the sign of the limit process for $x \rightarrow \infty$ (the sign of the leading coefficient).}*/ { const NT& leading_coeff = this->ptr()->coeff.back(); + if (degree() < 0) return CGAL::ZERO; if (leading_coeff < NT(0)) return (CGAL::NEGATIVE); if (leading_coeff > NT(0)) return (CGAL::POSITIVE); return CGAL::ZERO; @@ -1232,6 +1233,7 @@ Polynomial operator * (const Polynomial& p1, const Polynomial& p2) { typedef typename Polynomial::size_type size_type; + if (p1.degree()<0 || p2.degree()<0) return p1; CGAL_assertion(p1.degree()>=0 && p2.degree()>=0); Polynomial p( size_type(p1.degree()+p2.degree()+1) ); // initialized with zeros diff --git a/Nef_2/include/CGAL/Nef_2/geninfo.h b/Nef_2/include/CGAL/Nef_2/geninfo.h index af720eec1c0..232def6eb3f 100644 --- a/Nef_2/include/CGAL/Nef_2/geninfo.h +++ b/Nef_2/include/CGAL/Nef_2/geninfo.h @@ -41,6 +41,7 @@ misuse memory problems occur.}*/ /*{\Moperations 2 1}*/ + #ifdef CGAL_USE_FORMER_GENINFO static void create(GenPtr& p) /*{\Mstatic create a slot for an object of type |T| referenced via |p|.}*/ @@ -71,6 +72,16 @@ misuse memory problems occur.}*/ if (sizeof(T) > sizeof(GenPtr)) delete (T*) p; p=0; } + #else //CGAL_USE_FORMER_GENINFO + static void create(GenPtr& p) { p = (GenPtr) new T; } + static T& access(GenPtr& p) { return *(T*)p; } + static const T& const_access(const GenPtr& p) + { return *(const T*)p; } + static void clear(GenPtr& p){ + delete (T*) p; + p=0; + } + #endif //CGAL_USE_FORMER_GENINFO };