libs compile without warning

This commit is contained in:
Andreas Fabri 2018-01-17 15:02:32 +00:00
parent e2f89318e5
commit cbf3a16471
20 changed files with 97 additions and 34 deletions

View File

@ -36,6 +36,8 @@
#ifndef _CORE_BIGFLOAT_H_ #ifndef _CORE_BIGFLOAT_H_
#define _CORE_BIGFLOAT_H_ #define _CORE_BIGFLOAT_H_
#include <CGAL/disable_warnings.h>
#include <CGAL/CORE/BigFloatRep.h> #include <CGAL/CORE/BigFloatRep.h>
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
@ -633,4 +635,6 @@ inline BigRat::BigRat(const BigFloat& f) : RCBigRat(new BigRatRep()){
#include <CGAL/CORE/CoreIO_impl.h> #include <CGAL/CORE/CoreIO_impl.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY
#include <CGAL/enable_warnings.h>
#endif // _CORE_BIGFLOAT_H_ #endif // _CORE_BIGFLOAT_H_

View File

@ -41,7 +41,7 @@
#endif #endif
#include <CGAL/CORE/CoreAux.h> #include <CGAL/CORE/CoreAux.h>
#include <gmp.h> #include <CGAL/gmp.h>
namespace CORE { namespace CORE {

View File

@ -28,7 +28,7 @@
#ifdef _MSC_VER #ifdef _MSC_VER
// Suppress deprecated warning for fileno and strdup // Suppress deprecated warning for fileno and strdup
# pragma warning(disable:4996) # pragma warning(disable: 4127 4706 4996)
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -22,7 +22,8 @@
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Qt/DemosMainWindow.h> #include <CGAL/Qt/DemosMainWindow.h>
#include <CGAL/Qt/DemosMainWindow_impl.h> #include <CGAL/Qt/DemosMainWindow_impl.h>
#include <CGAL/enable_warnings.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY

View File

@ -22,7 +22,9 @@
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Qt/GraphicsViewNavigation.h> #include <CGAL/Qt/GraphicsViewNavigation.h>
#include <CGAL/Qt/GraphicsViewNavigation_impl.h> #include <CGAL/Qt/GraphicsViewNavigation_impl.h>
#include <CGAL/enable_warnings.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY

View File

@ -22,7 +22,9 @@
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Qt/GraphicsViewPolylineInput.h> #include <CGAL/Qt/GraphicsViewPolylineInput.h>
#include <CGAL/Qt/GraphicsViewPolylineInput_impl.h> #include <CGAL/Qt/GraphicsViewPolylineInput_impl.h>
#include <CGAL/enable_warnings.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY

View File

@ -21,7 +21,9 @@
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Qt/resources.h> #include <CGAL/Qt/resources.h>
#include <CGAL/Qt/resources_impl.h> #include <CGAL/Qt/resources_impl.h>
#include <CGAL/enable_warnings.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY

View File

@ -0,0 +1,26 @@
// Copyright (c) 2018 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0+
//
// Author: Andreas Fabri
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated
# pragma warning(disable: 4127) // conditional expression is constant
#endif

View File

@ -0,0 +1,24 @@
// Copyright (c) 2018 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0+
//
// Author: Andreas Fabri
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif

View File

@ -108,6 +108,7 @@ inline void compute_linear_roots_t(const NT *begin, const NT *,
NT lb, NT ub, NT lb, NT ub,
std::vector<NT> &roots) std::vector<NT> &roots)
{ {
CGAL_USE(lb);
if (CLEAN && begin[1]>0 ) return; if (CLEAN && begin[1]>0 ) return;
//NT max_error=0; //NT max_error=0;
//if (CLEAN) max_error=max_error_value; //if (CLEAN) max_error=max_error_value;

View File

@ -20,8 +20,8 @@
// Author(s) : Daniel Russel <drussel@alumni.princeton.edu> // Author(s) : Daniel Russel <drussel@alumni.princeton.edu>
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Polynomial/internal/numeric_solvers.h> #include <CGAL/Polynomial/internal/numeric_solvers.h>
#include <CGAL/Polynomial/internal/JAMA_numeric_solvers_impl.h> #include <CGAL/Polynomial/internal/JAMA_numeric_solvers_impl.h>
#include <CGAL/enable_warnings.h>
#endif #endif

View File

@ -20,8 +20,8 @@
// Author(s) : Daniel Russel <drussel@alumni.princeton.edu> // Author(s) : Daniel Russel <drussel@alumni.princeton.edu>
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Polynomial/internal/numeric_solvers.h> #include <CGAL/Polynomial/internal/numeric_solvers.h>
#include <CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h> #include <CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h>
#include <CGAL/enable_warnings.h>
#endif #endif

View File

@ -21,8 +21,8 @@
#ifndef CGAL_HEADER_ONLY #ifndef CGAL_HEADER_ONLY
#include <CGAL/disable_warnings.h>
#include <CGAL/Polynomial/internal/numeric_solvers_support.h> #include <CGAL/Polynomial/internal/numeric_solvers_support.h>
#include <CGAL/Polynomial/internal/numeric_solvers_support_impl.h> #include <CGAL/Polynomial/internal/numeric_solvers_support_impl.h>
#include <CGAL/enable_warnings.h>
#endif #endif

View File

@ -349,7 +349,10 @@ class Gmpfr:
// only avoid the binary incompatibility of a CGAL program compiled // only avoid the binary incompatibility of a CGAL program compiled
// with MSVC with the libmpfr-1.dll compiled with mingw. // with MSVC with the libmpfr-1.dll compiled with mingw.
#ifdef _MSC_VER #ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4244)
CGAL_GMPFR_CONSTRUCTOR_FROM_TYPE(long double,mpfr_set_d); CGAL_GMPFR_CONSTRUCTOR_FROM_TYPE(long double,mpfr_set_d);
# pragma warning(pop)
#else #else
CGAL_GMPFR_CONSTRUCTOR_FROM_TYPE(long double,mpfr_set_ld); CGAL_GMPFR_CONSTRUCTOR_FROM_TYPE(long double,mpfr_set_ld);
#endif #endif
@ -1283,17 +1286,17 @@ bool operator==(const Gmpfr &a,double b){
#ifdef _MSC_VER #ifdef _MSC_VER
inline inline
bool operator<(const Gmpfr &a,long double b){ bool operator<(const Gmpfr &a,long double b){
return(mpfr_cmp_d(a.fr(),b)<0); return(mpfr_cmp_d(a.fr(),static_cast<double>(b))<0);
} }
inline inline
bool operator>(const Gmpfr &a,long double b){ bool operator>(const Gmpfr &a,long double b){
return(mpfr_cmp_d(a.fr(),b)>0); return(mpfr_cmp_d(a.fr(),static_cast<double>(b))>0);
} }
inline inline
bool operator==(const Gmpfr &a,long double b){ bool operator==(const Gmpfr &a,long double b){
return !mpfr_cmp_d(a.fr(),b); return !mpfr_cmp_d(a.fr(),static_cast<double>(b));
} }
#else #else
inline inline

View File

@ -27,6 +27,8 @@
#ifndef CGAL_GMPQ_TYPE_H #ifndef CGAL_GMPQ_TYPE_H
#define CGAL_GMPQ_TYPE_H #define CGAL_GMPQ_TYPE_H
#include <CGAL/disable_warnings.h>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/IO/io.h> #include <CGAL/IO/io.h>
@ -513,4 +515,6 @@ inline Gmpq max BOOST_PREVENT_MACRO_SUBSTITUTION(const Gmpq& x,const Gmpq& y){
# pragma warning(pop) # pragma warning(pop)
#endif #endif
#include <CGAL/enable_warnings.h>
#endif // CGAL_GMPQ_TYPE_H #endif // CGAL_GMPQ_TYPE_H

View File

@ -464,7 +464,7 @@ std::ostream & operator<< (std::ostream &os, const Interval_nt<Protected> & I )
#define CGAL_SWALLOW(IS,CHAR) \ #define CGAL_SWALLOW(IS,CHAR) \
{ \ { \
char c; \ char c; \
do c = is.get(); while (isspace(c)); \ do is.get(c); while (isspace(c)); \
if (c != CHAR) { \ if (c != CHAR) { \
is.setstate(std::ios_base::failbit); \ is.setstate(std::ios_base::failbit); \
} \ } \
@ -474,7 +474,7 @@ template <bool Protected>
std::istream & operator>> (std::istream &is, Interval_nt<Protected> & I) std::istream & operator>> (std::istream &is, Interval_nt<Protected> & I)
{ {
char c; char c;
do c = is.get(); while (isspace(c)); do is.get(c); while (isspace(c));
is.putback(c); is.putback(c);
if(c == '['){ // read original output from operator << if(c == '['){ // read original output from operator <<
double inf,sup; double inf,sup;
@ -931,23 +931,6 @@ namespace INTERN_INTERVAL_NT {
return Uncertain<bool>::indeterminate(); return Uncertain<bool>::indeterminate();
} }
// TODO: Whats this for? Why is this in this file??
inline
std::pair<double, double>
to_interval (const long & l)
{
if (sizeof(double) > sizeof(long)) {
// On 64bit platforms, a long doesn't fit exactly in a double.
// Well, a perfect fix would be to use std::numeric_limits<>, but...
Protect_FPU_rounding<true> P(CGAL_FE_TONEAREST);
Interval_nt<false> approx (static_cast<double>(l));
FPU_set_cw(CGAL_FE_UPWARD);
approx += Interval_nt<false>::smallest();
return approx.pair();
}
else
return std::pair<double,double>(static_cast<double>(l),static_cast<double>(l));
}
} // namespace INTERN_INTERVAL_NT } // namespace INTERN_INTERVAL_NT

View File

@ -21,10 +21,10 @@
#define CGAL_GMP_H 1 #define CGAL_GMP_H 1
#include <CGAL/config.h> #include <CGAL/config.h>
#include <CGAL/disable_warnings.h>
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
# pragma warning(push) # pragma warning(push)
# pragma warning(disable:4244 4146) // conversion with loss of data # pragma warning(disable: 4127 4244 4146) // conversion with loss of data
// warning on - applied on unsigned number // warning on - applied on unsigned number
#endif #endif
@ -34,5 +34,5 @@
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
# pragma warning(pop) # pragma warning(pop)
#endif #endif
#include <CGAL/enable_warnings.h>
#endif // CGAL_GMP_H #endif // CGAL_GMP_H

View File

@ -58,6 +58,8 @@
#include <string> #include <string>
#include <map> #include <map>
#include <CGAL/disable_warnings.h>
// Automatically define CGAL_CONCURRENT_PROFILE if we're linked with TBB // Automatically define CGAL_CONCURRENT_PROFILE if we're linked with TBB
#ifdef CGAL_LINKED_WITH_TBB #ifdef CGAL_LINKED_WITH_TBB
# ifndef CGAL_CONCURRENT_PROFILE # ifndef CGAL_CONCURRENT_PROFILE
@ -256,4 +258,6 @@ private:
} //namespace CGAL } //namespace CGAL
#include <CGAL/enable_warnings.h>
#endif // CGAL_PROFILE_COUNTER_H #endif // CGAL_PROFILE_COUNTER_H

View File

@ -26,6 +26,8 @@
#ifndef CGAL_IO_FILE_SCANNER_OFF_H #ifndef CGAL_IO_FILE_SCANNER_OFF_H
#define CGAL_IO_FILE_SCANNER_OFF_H 1 #define CGAL_IO_FILE_SCANNER_OFF_H 1
#include <CGAL/disable_warnings.h>
#include <CGAL/config.h> #include <CGAL/config.h>
#include <cstddef> #include <cstddef>
#include <CGAL/IO/binary_file_io.h> #include <CGAL/IO/binary_file_io.h>
@ -699,5 +701,7 @@ file_scan_normal( File_scanner_OFF& scanner, Vector& v) {
#include <CGAL/IO/File_scanner_OFF_impl.h> #include <CGAL/IO/File_scanner_OFF_impl.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY
#include <CGAL/enable_warnings.h>
#endif // CGAL_IO_FILE_SCANNER_OFF_H // #endif // CGAL_IO_FILE_SCANNER_OFF_H //
// EOF // // EOF //

View File

@ -27,6 +27,7 @@
#ifndef CGAL_IO_H #ifndef CGAL_IO_H
#define CGAL_IO_H #define CGAL_IO_H
#include <CGAL/disable_warnings.h>
#include <cstdio> #include <cstdio>
#include <cctype> #include <cctype>
@ -616,4 +617,6 @@ inline void read_float_or_quotient(std::istream& is, Rat &z)
#include <CGAL/IO/io_impl.h> #include <CGAL/IO/io_impl.h>
#endif // CGAL_HEADER_ONLY #endif // CGAL_HEADER_ONLY
#include <CGAL/enable_warnings.h>
#endif // CGAL_IO_H #endif // CGAL_IO_H