From 971c281b11e37e80052c948c6be05ef153eb8721 Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 7 Mar 2014 15:16:22 +0400 Subject: [PATCH] 0024701: TKernel - drop redundant headers Standard_ctype.hxx and Standard_inverse.h --- src/Standard/FILES | 2 - src/Standard/Standard_Character.hxx | 45 ++++++------------- src/Standard/Standard_ExtCharacter.hxx | 13 +----- src/Standard/Standard_ctype.hxx | 33 -------------- src/Standard/Standard_inverse.h | 21 --------- src/TCollection/TCollection_AsciiString.cxx | 18 +++----- .../TCollection_ExtendedString.cxx | 8 ++-- 7 files changed, 23 insertions(+), 117 deletions(-) delete mode 100644 src/Standard/Standard_ctype.hxx delete mode 100644 src/Standard/Standard_inverse.h diff --git a/src/Standard/FILES b/src/Standard/FILES index 140178f3e1..7c1524edc5 100755 --- a/src/Standard/FILES +++ b/src/Standard/FILES @@ -55,8 +55,6 @@ Standard_Time.hxx Standard_Transient.hxx Standard_Transient_proto.hxx Standard_TypeDef.hxx -Standard_ctype.hxx -Standard_inverse.h Standard_math.cxx Standard_math.hxx Standard_osd_ffi.c diff --git a/src/Standard/Standard_Character.hxx b/src/Standard/Standard_Character.hxx index b973a8ee25..6b0adfa353 100644 --- a/src/Standard/Standard_Character.hxx +++ b/src/Standard/Standard_Character.hxx @@ -24,15 +24,10 @@ #ifndef _Standard_Character_HeaderFile #define _Standard_Character_HeaderFile -#ifndef _Standard_ctype_HeaderFile -#include -#endif +#include #include - -#ifndef _Standard_TypeDef_HeaderFile -#include -#endif +#include class Handle_Standard_Type; @@ -91,19 +86,19 @@ inline Standard_Boolean IsSimilar(const Standard_Character One, // IsAlphabetic : Returns Standard_True if a character is alphabetic // ================================================================== inline Standard_Boolean IsAlphabetic(const Standard_Character me) -{ return isalpha((unsigned char)me); } +{ return std::isalpha ((unsigned char)me); } // ================================================================== // IsDigit : Returns Standard_True if a character is a digit // ================================================================== inline Standard_Boolean IsDigit(const Standard_Character me) -{ return isdigit((unsigned char)me); } +{ return std::isdigit ((unsigned char)me); } // ================================================================== // IsXDigit : Returns Standard_True if a character is a digit // ================================================================== inline Standard_Boolean IsXDigit(const Standard_Character me) -{ return isxdigit((unsigned char)me); } +{ return std::isxdigit((unsigned char)me); } // ================================================================== // IsAlphanumeric : Returns Standard_True if a character is alphanumeric @@ -115,26 +110,26 @@ inline Standard_Boolean IsAlphanumeric(const Standard_Character me) // IsControl : Returns Standard_True if a character is a control character // ================================================================== inline Standard_Boolean IsControl(const Standard_Character me) -{ return iscntrl((unsigned char)me); } +{ return std::iscntrl((unsigned char)me); } // ================================================================== // IsGraphic : Returns Standard_True if a character is graphic // ================================================================== inline Standard_Boolean IsGraphic(const Standard_Character me) -{ return isgraph((unsigned char)me); } +{ return std::isgraph((unsigned char)me); } // ================================================================== // IsLowerCase : Returns Standard_True if a character is lowercase // ================================================================== inline Standard_Boolean IsLowerCase(const Standard_Character me) -{ return islower((unsigned char)me); } +{ return std::islower((unsigned char)me); } // ================================================================== // IsPrintable : Returns Standard_True if a character is printable // ================================================================== inline Standard_Boolean IsPrintable(const Standard_Character me) -{ return isprint((unsigned char)me); } +{ return std::isprint((unsigned char)me); } // ================================================================== // IsPunctuation : Returns Standard_True if a character is a graphic and @@ -147,25 +142,25 @@ inline Standard_Boolean IsPunctuation(const Standard_Character me) // IsSpace : Returns Standard_True if a character is a space // ================================================================== inline Standard_Boolean IsSpace(const Standard_Character me) -{ return isspace((unsigned char)me); } +{ return std::isspace((unsigned char)me); } // ================================================================== // IsUppercase : Returns Standard_True if a character is uppercase // ================================================================== inline Standard_Boolean IsUpperCase(const Standard_Character me) -{ return isupper((unsigned char)me); } +{ return std::isupper((unsigned char)me); } // ================================================================== // LowerCase : Returns a lowercase character // ================================================================== inline Standard_Character LowerCase(const Standard_Character me) -{ return (Standard_Character)(unsigned char)tolower(me); } +{ return (Standard_Character)(unsigned char)std::tolower(me); } // ================================================================== // UpperCase : Returns a uppercase character // ================================================================== inline Standard_Character UpperCase(const Standard_Character me) -{ return (Standard_Character)(unsigned char)toupper(me); } +{ return (Standard_Character)(unsigned char)std::toupper(me); } // ------------------------------------------------------------------ // ShallowCopy : Make a copy of one Character @@ -174,17 +169,3 @@ inline Standard_Character ShallowCopy (const Standard_Character me) { return me; } #endif - - - - - - - - - - - - - - diff --git a/src/Standard/Standard_ExtCharacter.hxx b/src/Standard/Standard_ExtCharacter.hxx index 68e2668e7a..35b8ef8d2d 100644 --- a/src/Standard/Standard_ExtCharacter.hxx +++ b/src/Standard/Standard_ExtCharacter.hxx @@ -24,20 +24,11 @@ #ifndef _Standard_ExtCharacter_HeaderFile #define _Standard_ExtCharacter_HeaderFile -#ifndef _Standard_ctype_HeaderFile -#include -#endif +#include +#include #include -#ifndef _Standard_TypeDef_HeaderFile -#include -#endif - -#ifndef _Standard_OStream_HeaderFile -#include -#endif - class Handle_Standard_Type; __Standard_API const Handle_Standard_Type& Standard_ExtCharacter_Type_(); diff --git a/src/Standard/Standard_ctype.hxx b/src/Standard/Standard_ctype.hxx deleted file mode 100644 index 793f38dd92..0000000000 --- a/src/Standard/Standard_ctype.hxx +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//============================================================================ -//==== Titre: Standard_ctype.hxx.hxx -//==== Role : This file is dedicated to encapsulate ctype.h file -//==== At the origin this file contains #define _U _X .... statements -//==== and conflicts with generated variables names may occur -//==== -//==== Implementation: The #define _X .. statements have been replaced -//==== with #define Standard_ctype_X ... statements -//==== Only tested on sun platform -//============================================================================ - - -/* @(#)ctype.h 1.9 89/10/06 SMI; from UCB 4.1 83/05/03 */ - - -#ifndef _Standard_ctype_HeaderFile -#define _Standard_ctype_HeaderFile -#include -#endif diff --git a/src/Standard/Standard_inverse.h b/src/Standard/Standard_inverse.h deleted file mode 100644 index b70fac3c71..0000000000 --- a/src/Standard/Standard_inverse.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (c) 1998-1999 Matra Datavision - Copyright (c) 1999-2014 OPEN CASCADE SAS - - This file is part of Open CASCADE Technology software library. - - This library is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License version 2.1 as published - by the Free Software Foundation, with special exception defined in the file - OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT - distribution for complete text of the license and disclaimer of any warranty. - - Alternatively, this file may be used under the terms of Open CASCADE - commercial license or contractual agreement. -*/ - -#define inverse(a)\ -(0 | (( a & 0x000000ff ) << 24 )\ -| (( a & 0x0000ff00 ) << 8 )\ -| (( a & 0x00ff0000 ) >> 8 )\ -| (( a >> 24 ) & 0x000000ff ) ) diff --git a/src/TCollection/TCollection_AsciiString.cxx b/src/TCollection/TCollection_AsciiString.cxx index ed20c7b41c..ca23604837 100644 --- a/src/TCollection/TCollection_AsciiString.cxx +++ b/src/TCollection/TCollection_AsciiString.cxx @@ -12,26 +12,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include - #include +#include + #include #include #include #include #include -#include -#include - -// ###### PLACER LE TYPE NON DEFINI strtol (portabilite) ###### -#ifdef WNT -# include -#else -extern "C" { - long strtol(const char*, char**, int); -} -#endif // WNT +#include +#include +#include // Shortcuts to standard allocate and reallocate functions static inline Standard_PCharacter Allocate(const Standard_Size aLength) diff --git a/src/TCollection/TCollection_ExtendedString.cxx b/src/TCollection/TCollection_ExtendedString.cxx index 7e228076e6..b71ae73ff8 100644 --- a/src/TCollection/TCollection_ExtendedString.cxx +++ b/src/TCollection/TCollection_ExtendedString.cxx @@ -12,18 +12,16 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//#if defined(WNT) || defined(LIN) -#include -//#endif - #include #include #include #include #include -#include #include +#include +#include + static Standard_PExtCharacter Allocate(const Standard_Size aLength);