From d76beea6ad8cb219439a4e236f7ddf2cc616ebfe Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Wed, 8 Aug 2007 15:30:58 +0000 Subject: [PATCH] Remove obsolete config flag CGAL_CFG_NO_LOCALE. --- .../config/testfiles/CGAL_CFG_NO_LOCALE.cpp | 38 ----------- .../Kernel/Cartesian_moving_point_2.h | 4 -- .../Kernel/Cartesian_moving_point_3.h | 4 -- .../Cartesian_moving_weighted_point_3.h | 4 -- Number_types/include/CGAL/GMP/Gmpq_type.h | 18 +----- Number_types/include/CGAL/GMP/Gmpz_type.h | 63 ++++--------------- Number_types/include/CGAL/Gmpz.h | 6 +- Number_types/include/CGAL/Quotient.h | 20 +----- 8 files changed, 18 insertions(+), 139 deletions(-) delete mode 100644 Installation/config/testfiles/CGAL_CFG_NO_LOCALE.cpp diff --git a/Installation/config/testfiles/CGAL_CFG_NO_LOCALE.cpp b/Installation/config/testfiles/CGAL_CFG_NO_LOCALE.cpp deleted file mode 100644 index e14455379ae..00000000000 --- a/Installation/config/testfiles/CGAL_CFG_NO_LOCALE.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 1997 Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), -// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg -// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), -// and Tel-Aviv University (Israel). 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; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// 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$ -// -// -// Author(s) : various - -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by install_cgal. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| If a compiler doesn't know the locale classic -//| CGAL_CFG_NO_LOCALE is set. - -#include - -int main() -{ - return std::isspace(' ', std::locale::classic()) ? 0 : 1; -} diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_2.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_2.h index c952a75e27b..61b05648647 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_2.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_2.h @@ -180,11 +180,7 @@ std::istream &operator>>(std::istream &in, do { in >> c; } -#ifndef CGAL_CFG_NO_LOCALE while (std::isspace(c,std::locale::classic() )); -#else - while (std::isspace(c)); -#endif if (c != ',') { in.setstate(std::ios_base::failbit); diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_3.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_3.h index dda63522f83..d9833a72ccd 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_3.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_point_3.h @@ -178,11 +178,7 @@ std::istream &operator>>(std::istream &in, do { in >> c; } -#ifndef CGAL_CFG_NO_LOCALE while (std::isspace(c,std::locale::classic() )); -#else - while (std::isspace(c)); -#endif if (c != ',') { in.setstate(std::ios_base::failbit); diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_weighted_point_3.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_weighted_point_3.h index fac804a6cae..0001092bec6 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_weighted_point_3.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/Kernel/Cartesian_moving_weighted_point_3.h @@ -135,11 +135,7 @@ std::istream &operator>>(std::istream &in, do { in >> c; } -#ifndef CGAL_CFG_NO_LOCALE while (std::isspace(c,std::locale::classic() )); -#else - while (std::isspace(c)); -#endif if (c != ',') { in.setstate(std::ios_base::failbit); diff --git a/Number_types/include/CGAL/GMP/Gmpq_type.h b/Number_types/include/CGAL/GMP/Gmpq_type.h index d898b733bd8..38a0dce6bfa 100644 --- a/Number_types/include/CGAL/GMP/Gmpq_type.h +++ b/Number_types/include/CGAL/GMP/Gmpq_type.h @@ -304,14 +304,8 @@ namespace Gmpq_detail { bool is_space (const std::istream& /*is*/, std::istream::int_type c) { std::istream::char_type cc= c; - return - (c == std::istream::traits_type::eof()) || -#ifndef CGAL_CFG_NO_LOCALE - std::isspace(cc, std::locale::classic() ) -#else - std::isspace(cc) -#endif - ; + return (c == std::istream::traits_type::eof()) || + std::isspace(cc, std::locale::classic() ); } inline @@ -324,13 +318,7 @@ namespace Gmpq_detail { bool is_digit (const std::istream& /*is*/, std::istream::int_type c) { std::istream::char_type cc= c; - return -#ifndef CGAL_CFG_NO_LOCALE - std::isdigit(cc, std::locale::classic() ) -#else - std::isdigit(cc) -#endif - ; + return std::isdigit(cc, std::locale::classic() ); } } diff --git a/Number_types/include/CGAL/GMP/Gmpz_type.h b/Number_types/include/CGAL/GMP/Gmpz_type.h index 2d95fb0a5e3..56da3e08126 100644 --- a/Number_types/include/CGAL/GMP/Gmpz_type.h +++ b/Number_types/include/CGAL/GMP/Gmpz_type.h @@ -33,11 +33,7 @@ #include #include -#ifndef CGAL_CFG_NO_LOCALE -# include -#else -# include -#endif +#include CGAL_BEGIN_NAMESPACE @@ -321,22 +317,17 @@ void gmpz_eat_white_space(std::istream &is) std::istream::int_type c; do { c= is.peek(); - if (c== std::istream::traits_type::eof()) return; + if (c== std::istream::traits_type::eof()) + return; else { std::istream::char_type cc= c; - if ( -#ifndef CGAL_CFG_NO_LOCALE - std::isspace(cc, std::locale::classic() ) -#else - CGAL_CLIB_STD::isspace(cc) -#endif // CGAL_CFG_NO_LOCALE - ) { - is.get(); - // since peek succeeded, this should too - CGAL_assertion(!is.fail()); - } else { - return; - } + if ( std::isspace(cc, std::locale::classic()) ) { + is.get(); + // since peek succeeded, this should too + CGAL_assertion(!is.fail()); + } else { + return; + } } } while (true); } @@ -366,14 +357,8 @@ gmpz_new_read(std::istream &is, Gmpz &z) std::istream::char_type cc= c; - if (c== std::istream::traits_type::eof() - || -#ifndef CGAL_CFG_NO_LOCALE - !std::isdigit(cc, std::locale::classic() ) -#else - !std::isdigit(cc) -#endif // CGAL_CFG_NO_LOCALE) { - ){ + if (c== std::istream::traits_type::eof() || + !std::isdigit(cc, std::locale::classic() ) ){ is.setstate(std::ios_base::failbit); } else { CGAL_assertion(cc==c); @@ -386,13 +371,7 @@ gmpz_new_read(std::istream &is, Gmpz &z) break; } cc=c; - if ( -#ifndef CGAL_CFG_NO_LOCALE - !std::isdigit(cc, std::locale::classic() ) -#else - !std::isdigit(cc) -#endif // CGAL_CFG_NO_LOCALE - ) { + if ( !std::isdigit(cc, std::locale::classic() )) { break; } is.get(); @@ -424,36 +403,20 @@ read_gmpz(std::istream& is, Gmpz &z) { std::ios::fmtflags old_flags = is.flags(); is.unsetf(std::ios::skipws); -#ifndef CGAL_CFG_NO_LOCALE while (is.get(c) && std::isspace(c, std::locale::classic() )) -#else - while (is.get(c) && CGAL_CLIB_STD::isspace(c)) -#endif // CGAL_CFG_NO_LOCALE {} if (c == '-') { negative = true; -#ifndef CGAL_CFG_NO_LOCALE while (is.get(c) && std::isspace(c, std::locale::classic() )) -#else - while (is.get(c) && CGAL_CLIB_STD::isspace(c)) -#endif // CGAL_CFG_NO_LOCALE {} } -#ifndef CGAL_CFG_NO_LOCALE if (std::isdigit(c, std::locale::classic() )) -#else - if (std::isdigit(c)) -#endif // CGAL_CFG_NO_LOCALE { good = true; tmp = c - null; -#ifndef CGAL_CFG_NO_LOCALE while (is.get(c) && std::isdigit(c, std::locale::classic() )) -#else - while (is.get(c) && std::isdigit(c)) -#endif // CGAL_CFG_NO_LOCALE { tmp = 10*tmp + (c-null); } diff --git a/Number_types/include/CGAL/Gmpz.h b/Number_types/include/CGAL/Gmpz.h index 524c4651784..52783c12053 100644 --- a/Number_types/include/CGAL/Gmpz.h +++ b/Number_types/include/CGAL/Gmpz.h @@ -34,11 +34,7 @@ #include // spec of AST for Quotient #include -#ifndef CGAL_CFG_NO_LOCALE -# include -#else -# include -#endif +#include #include diff --git a/Number_types/include/CGAL/Quotient.h b/Number_types/include/CGAL/Quotient.h index cd0c92092b1..4bec165b8f5 100644 --- a/Number_types/include/CGAL/Quotient.h +++ b/Number_types/include/CGAL/Quotient.h @@ -35,13 +35,7 @@ #define CGAL_QUOTIENT_H #include - -#ifndef CGAL_CFG_NO_LOCALE -# include -#else -# include -#endif - +#include #include #include @@ -377,11 +371,7 @@ operator>>(std::istream& in, Quotient& r) char c = 0; -#ifndef CGAL_CFG_NO_LOCALE while (in.get(c) && std::isspace(c, std::locale::classic() )) {} -#else - while (in.get(c) && CGAL_CLIB_STD::isspace(c)) {} -#endif // CGAL_CFG_NO_LOCALE if ( !in ) return in; in.putback(c); @@ -389,18 +379,10 @@ operator>>(std::istream& in, Quotient& r) NT den(1); in >> num; -#ifndef CGAL_CFG_NO_LOCALE while (in.get(c) && std::isspace(c, std::locale::classic() )) {} -#else - while (in.get(c) && CGAL_CLIB_STD::isspace(c)) {} -#endif // CGAL_CFG_NO_LOCALE if (( in ) && ( c == '/')) { -#ifndef CGAL_CFG_NO_LOCALE while (in.get(c) && std::isspace(c, std::locale::classic() )) {} -#else - while (in.get(c) && CGAL_CLIB_STD::isspace(c)) {} -#endif // CGAL_CFG_NO_LOCALE CGAL_assertion( in ); in.putback(c); in >> den;