From 3226e337da6031e9781e3d3e93a6b45c74f2875c Mon Sep 17 00:00:00 2001 From: ika Date: Mon, 20 Apr 2020 13:09:26 +0300 Subject: [PATCH] # Get rid of warnings --- src/ExpToCasExe/ExpToCasExe.cxx | 19 +++++++++++++--- src/ExpToCasExe/expparse.cxx | 28 +++++++++++++++++------ src/ExpToCasExe/expparse.h | 14 ++++++++++++ src/ExpToCasExe/expscan.cxx | 31 ++++++++++++++++++++++++-- src/ExpToCasExe/exptocas.h | 15 +++++++++++++ src/ExpToCasExe/exptocas.l | 19 +++++++++++----- src/ExpToCasExe/exptocas.y | 19 +++++++++++----- src/ExpToCasExe/lex.yy.c | 15 +++++++++++++ src/Express/Express_Alias.hxx | 4 ++-- src/Express/Express_Boolean.hxx | 2 +- src/Express/Express_ComplexType.hxx | 4 ++-- src/Express/Express_Entity.cxx | 8 +------ src/Express/Express_Entity.hxx | 2 +- src/Express/Express_Enum.hxx | 2 +- src/Express/Express_Integer.hxx | 2 +- src/Express/Express_Logical.hxx | 8 +++---- src/Express/Express_NamedType.hxx | 10 ++++----- src/Express/Express_PredefinedType.hxx | 2 +- src/Express/Express_Real.hxx | 2 +- src/Express/Express_Reference.hxx | 2 +- src/Express/Express_Select.hxx | 2 +- src/Express/Express_String.hxx | 4 ++-- 22 files changed, 162 insertions(+), 52 deletions(-) diff --git a/src/ExpToCasExe/ExpToCasExe.cxx b/src/ExpToCasExe/ExpToCasExe.cxx index 3eead1ccf7..a717fc0ffc 100644 --- a/src/ExpToCasExe/ExpToCasExe.cxx +++ b/src/ExpToCasExe/ExpToCasExe.cxx @@ -1,7 +1,17 @@ -// File: ExpToCasExe.cxx // Created: Mon Nov 1 12:50:27 1999 // Author: Andrey BETENEV -// +// Copyright (c) 1999-2020 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. #include #include @@ -13,9 +23,11 @@ #include #include +#ifdef _MSC_VER #pragma warning(push) #pragma warning (disable:4267) #pragma warning (disable:4706) +#endif Handle(Express_Schema) ec_parse ( FILE *fin ); // interface to parser @@ -205,5 +217,6 @@ Standard_Integer main ( const Standard_Integer argc, const char *argv[] ) // std::cout << "Finished; total " << nbgen << " classes generated" << std::endl; return 1; } - +#ifdef _MSC_VER #pragma warning(pop) +#endif diff --git a/src/ExpToCasExe/expparse.cxx b/src/ExpToCasExe/expparse.cxx index 20d5abfca4..08ee5cc5e7 100644 --- a/src/ExpToCasExe/expparse.cxx +++ b/src/ExpToCasExe/expparse.cxx @@ -1,11 +1,20 @@ # line 2 "Express.y" -/* File: Express.y */ -/* Created: Thu Oct 28 12:21:16 1999 */ -/* Author: Andrey BETENEV */ -/* */ -/* Copyright: Matra Datavision 1999 */ +// Created: Thu Oct 28 12:21:16 1999 +// Author: Andrey BETENEV +// Copyright (c) 1999-2020 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. /*****************************************************************************\ @@ -53,10 +62,15 @@ complex time or redefinition of inherited field are ignored. #include #include +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4244) #pragma warning(disable:4274) #pragma warning(disable:4800) +#endif +#if defined(__clang__) +#pragma GCC diagnostic ignored "-Wmissing-braces" +#endif /************************************************/ /* ERROR MESSAGE FUNCTION */ @@ -605,8 +619,6 @@ char * yyreds[] = * Copyright (c) 1993 by Sun Microsystems, Inc. */ -#pragma ident "@(#)yaccpar 6.14 97/01/16 SMI" - /* ** Skeleton parser driver for yacc output */ @@ -1319,4 +1331,6 @@ case 66: goto yystack; /* reset registers in driver code */ } +#ifdef _MSC_VER #pragma warning(pop) +#endif diff --git a/src/ExpToCasExe/expparse.h b/src/ExpToCasExe/expparse.h index e6cd7d62b2..d506fce811 100644 --- a/src/ExpToCasExe/expparse.h +++ b/src/ExpToCasExe/expparse.h @@ -1,3 +1,17 @@ +// Created: Mon Nov 1 12:50:27 1999 +// Author: Andrey BETENEV +// Copyright (c) 1999-2020 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. typedef union #ifdef __cplusplus diff --git a/src/ExpToCasExe/expscan.cxx b/src/ExpToCasExe/expscan.cxx index 6274344bf5..3f570a41a7 100644 --- a/src/ExpToCasExe/expscan.cxx +++ b/src/ExpToCasExe/expscan.cxx @@ -1,5 +1,25 @@ +// Created: Mon Nov 1 12:50:27 1999 +// Author: Andrey BETENEV +// Copyright (c) 1999-2020 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. + #include #include + +#if defined(__clang__) +#pragma GCC diagnostic ignored "-Wmissing-braces" +#endif + # define U(x) x # define NLSTATE yyprevious=YYNEWLINE # define BEGIN yybgin = yysvec + 1 + @@ -80,11 +100,18 @@ struct yysvf { struct yysvf *yyestate; extern struct yysvf yysvec[], *yybgin; +#ifdef _MSC_VER #pragma warning(push) #pragma warning (disable:4244) #pragma warning (disable:4274) #pragma warning (disable:4706) #pragma warning (disable:4701) +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wwrite-strings" +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif # line 4 "exptocas.l" /* File: exptocas.l */ @@ -2656,8 +2683,6 @@ char yyextra[] = { /* The copyright notice above does not evidence any */ /* actual or intended publication of such source code. */ -#pragma ident "@(#)ncform 6.11 97/01/06 SMI" - int yylineno =1; # define YYU(x) x # define NLSTATE yyprevious=YYNEWLINE @@ -2916,4 +2941,6 @@ yyunput(c) unput(c); } +#ifdef _MSC_VER #pragma warning(pop) +#endif diff --git a/src/ExpToCasExe/exptocas.h b/src/ExpToCasExe/exptocas.h index 385a582ccb..66003e0ca6 100644 --- a/src/ExpToCasExe/exptocas.h +++ b/src/ExpToCasExe/exptocas.h @@ -1,3 +1,18 @@ +// Created: Mon Nov 1 12:50:27 1999 +// Author: Andrey BETENEV +// Copyright (c) 1999-2020 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. + #ifndef EXPCAS_H #define EXPCAS_H diff --git a/src/ExpToCasExe/exptocas.l b/src/ExpToCasExe/exptocas.l index 1360f89bcc..1c3ee41b98 100644 --- a/src/ExpToCasExe/exptocas.l +++ b/src/ExpToCasExe/exptocas.l @@ -1,10 +1,19 @@ %{ -/* File: exptocas.l */ -/* Created: Thu Oct 28 12:21:16 1999 */ -/* Author: Andrey BETENEV */ -/* */ -/* Copyright: Matra Datavision 1999 */ +/* Created: Thu Oct 28 12:21:16 1999 +/* Author: Andrey BETENEV +/* Copyright (c) 1999-2020 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. /*****************************************************************************\ diff --git a/src/ExpToCasExe/exptocas.y b/src/ExpToCasExe/exptocas.y index efdc9fe358..d50b61ec5c 100644 --- a/src/ExpToCasExe/exptocas.y +++ b/src/ExpToCasExe/exptocas.y @@ -1,10 +1,19 @@ %{ -/* File: exptocas.y */ -/* Created: Thu Oct 28 12:21:16 1999 */ -/* Author: Andrey BETENEV */ -/* */ -/* Copyright: Matra Datavision 1999 */ +/* Created: Thu Oct 28 12:21:16 1999 +/* Author: Andrey BETENEV +/* Copyright (c) 1999-2020 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. /*****************************************************************************\ diff --git a/src/ExpToCasExe/lex.yy.c b/src/ExpToCasExe/lex.yy.c index ed53260bf7..4e9b828d2c 100644 --- a/src/ExpToCasExe/lex.yy.c +++ b/src/ExpToCasExe/lex.yy.c @@ -1,3 +1,18 @@ +// Created: Mon Nov 1 12:50:27 1999 +// Author: Andrey BETENEV +// Copyright (c) 1999-2020 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. + #include #include # define U(x) x diff --git a/src/Express/Express_Alias.hxx b/src/Express/Express_Alias.hxx index 5ee19a76a7..3498604d6d 100644 --- a/src/Express/Express_Alias.hxx +++ b/src/Express/Express_Alias.hxx @@ -36,10 +36,10 @@ public: Standard_EXPORT const Handle(Express_Type)& Type() const; //! Returns name of aliased type - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; //! Create HXX/CXX files from item - Standard_EXPORT virtual Standard_Boolean GenerateClass() const; + Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE; diff --git a/src/Express/Express_Boolean.hxx b/src/Express/Express_Boolean.hxx index b2961a7f16..f97d846156 100644 --- a/src/Express/Express_Boolean.hxx +++ b/src/Express/Express_Boolean.hxx @@ -31,7 +31,7 @@ public: Standard_EXPORT Express_Boolean(); //! Returns "Standard_Boolean" - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; diff --git a/src/Express/Express_ComplexType.hxx b/src/Express/Express_ComplexType.hxx index 9f2aeb046d..e002575d38 100644 --- a/src/Express/Express_ComplexType.hxx +++ b/src/Express/Express_ComplexType.hxx @@ -37,11 +37,11 @@ public: Standard_EXPORT const Handle(Express_Type)& Type() const; //! Returns CPP-style name of the type - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; //! Declares type as used by some item being generated. //! Calls Use() for type of elements - Standard_EXPORT virtual Standard_Boolean Use (const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False) const; + Standard_EXPORT virtual Standard_Boolean Use (const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False) const Standard_OVERRIDE; diff --git a/src/Express/Express_Entity.cxx b/src/Express/Express_Entity.cxx index 39075cf847..81cf6b256f 100644 --- a/src/Express/Express_Entity.cxx +++ b/src/Express/Express_Entity.cxx @@ -1174,13 +1174,7 @@ Standard_Integer Express_Entity::MakeInit (Standard_OStream &os, } // write field - if ( mode == 0 ) { - if (field->Type()->IsHandle()) - os << "const Handle(" << field->Type()->CPPName()->ToCString() << ")& the" << varName->ToCString(); - else - os << "const " << field->Type()->CPPName()->ToCString() << " the" << varName->ToCString(); - } - else if (mode == 1) { + if ( mode == 0 || mode ==1) { os << "const " << (field->Type()->IsHandle() ? "Handle(" : "") << field->Type()->CPPName()->ToCString() << (field->Type()->IsHandle() ? ")" : "") << (field->Type()->IsSimple() ? " the" : "& the") << varName->ToCString(); diff --git a/src/Express/Express_Entity.hxx b/src/Express/Express_Entity.hxx index 34d1be8db6..20ba8d2425 100644 --- a/src/Express/Express_Entity.hxx +++ b/src/Express/Express_Entity.hxx @@ -73,7 +73,7 @@ private: typedef NCollection_DataMap DataMapOfStringInteger; //! Create HXX/CXX files from item - Standard_EXPORT virtual Standard_Boolean GenerateClass() const; + Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE; //! Writes includes section of HXX Standard_EXPORT Standard_Boolean WriteIncludes (Standard_OStream& os, DataMapOfStringInteger& dict) const; diff --git a/src/Express/Express_Enum.hxx b/src/Express/Express_Enum.hxx index 8663e3c23f..fde36c4808 100644 --- a/src/Express/Express_Enum.hxx +++ b/src/Express/Express_Enum.hxx @@ -35,7 +35,7 @@ public: Standard_EXPORT const Handle(TColStd_HSequenceOfHAsciiString)& Names() const; //! Create HXX/CXX files from item - Standard_EXPORT virtual Standard_Boolean GenerateClass() const; + Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE; diff --git a/src/Express/Express_Integer.hxx b/src/Express/Express_Integer.hxx index 1d03027f79..0490b5e1ea 100644 --- a/src/Express/Express_Integer.hxx +++ b/src/Express/Express_Integer.hxx @@ -31,7 +31,7 @@ public: Standard_EXPORT Express_Integer(); //! Returns "Standard_Integer" - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; diff --git a/src/Express/Express_Logical.hxx b/src/Express/Express_Logical.hxx index 8cc9d6f4aa..01fb3c5a7c 100644 --- a/src/Express/Express_Logical.hxx +++ b/src/Express/Express_Logical.hxx @@ -32,16 +32,16 @@ public: Standard_EXPORT Express_Logical(); //! Returns "StepData_Logical" - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; //! Return False - Standard_EXPORT virtual Standard_Boolean IsStandard() const; + Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE; //! Return False - Standard_EXPORT virtual Standard_Boolean IsSimple() const; + Standard_EXPORT virtual Standard_Boolean IsSimple() const Standard_OVERRIDE; //! Return False - Standard_EXPORT virtual Standard_Boolean IsHandle() const; + Standard_EXPORT virtual Standard_Boolean IsHandle() const Standard_OVERRIDE; diff --git a/src/Express/Express_NamedType.hxx b/src/Express/Express_NamedType.hxx index 8ec8cb6bec..e43daf0541 100644 --- a/src/Express/Express_NamedType.hxx +++ b/src/Express/Express_NamedType.hxx @@ -47,20 +47,20 @@ public: Standard_EXPORT void SetItem (const Handle(Express_Item)& it) ; //! Returns CPP-style name of the type - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; //! Return True if type is defined in package Standard - Standard_EXPORT virtual Standard_Boolean IsStandard() const; + Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE; //! Return True if type is simple (not a class) - Standard_EXPORT virtual Standard_Boolean IsSimple() const; + Standard_EXPORT virtual Standard_Boolean IsSimple() const Standard_OVERRIDE; //! Return True if type is inherited from Transient - Standard_EXPORT virtual Standard_Boolean IsHandle() const; + Standard_EXPORT virtual Standard_Boolean IsHandle() const Standard_OVERRIDE; //! Declares type as used by some item being generated. //! Calls Use() for referred item (found by name). - Standard_EXPORT virtual Standard_Boolean Use (const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False) const; + Standard_EXPORT virtual Standard_Boolean Use(const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False) const Standard_OVERRIDE; diff --git a/src/Express/Express_PredefinedType.hxx b/src/Express/Express_PredefinedType.hxx index 98e06c0066..7f59a926ed 100644 --- a/src/Express/Express_PredefinedType.hxx +++ b/src/Express/Express_PredefinedType.hxx @@ -27,7 +27,7 @@ public: //! Returns True - Standard_EXPORT virtual Standard_Boolean IsStandard() const; + Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE; diff --git a/src/Express/Express_Real.hxx b/src/Express/Express_Real.hxx index ec2654d11c..1d8deae96d 100644 --- a/src/Express/Express_Real.hxx +++ b/src/Express/Express_Real.hxx @@ -31,7 +31,7 @@ public: Standard_EXPORT Express_Real(); //! Returns "Standard_Real" - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; diff --git a/src/Express/Express_Reference.hxx b/src/Express/Express_Reference.hxx index 7adefbfe5d..a0856e3062 100644 --- a/src/Express/Express_Reference.hxx +++ b/src/Express/Express_Reference.hxx @@ -42,7 +42,7 @@ public: //! Redefined to empty (in order to be able to instantiate) //! Returna False - Standard_EXPORT virtual Standard_Boolean GenerateClass() const; + Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE; diff --git a/src/Express/Express_Select.hxx b/src/Express/Express_Select.hxx index 708261c4b5..3113c13694 100644 --- a/src/Express/Express_Select.hxx +++ b/src/Express/Express_Select.hxx @@ -42,7 +42,7 @@ public: Standard_EXPORT const Handle(Express_HSequenceOfItem)& Items() const; //! Create HXX/CXX files from item - Standard_EXPORT virtual Standard_Boolean GenerateClass() const; + Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE; diff --git a/src/Express/Express_String.hxx b/src/Express/Express_String.hxx index 6351ef45e5..09c2af920e 100644 --- a/src/Express/Express_String.hxx +++ b/src/Express/Express_String.hxx @@ -32,10 +32,10 @@ public: Standard_EXPORT Express_String(); //! Returns "Handle(TCollection_HAsciiString)" - Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const; + Standard_EXPORT virtual Handle(TCollection_HAsciiString) CPPName() const Standard_OVERRIDE; //! Returns False - Standard_EXPORT virtual Standard_Boolean IsStandard() const; + Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE; -- 2.39.5