From: ika Date: Wed, 26 Aug 2020 15:29:38 +0000 (+0300) Subject: Get rid of warnings. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=1f02cd5f2139446df96b07cae5cdd9018e638278;p=occt-copy.git Get rid of warnings. Move own include in RW source, according to code rules. Update list of already generated entities. --- diff --git a/src/ExpToCasExe/expparse.cxx b/src/ExpToCasExe/expparse.cxx index fc7b1f3a87..2b289643e7 100644 --- a/src/ExpToCasExe/expparse.cxx +++ b/src/ExpToCasExe/expparse.cxx @@ -71,16 +71,19 @@ complex time or redefinition of inherited field are ignored. #if defined(__clang__) #pragma GCC diagnostic ignored "-Wmissing-braces" #endif +#if __cplusplus > 199711L +#define register// Deprecated in C++11. +#endif /************************************************/ /* ERROR MESSAGE FUNCTION */ /* external functions (from Express.l) */ -int ec_error ( char *s, char *text ); +int ec_error ( char const *s, char const *text ); int ec_curline ( void ); #define yyerror ec_error -void ec_error ( char *s ) +void ec_error ( char const *s ) { printf ( "\nParse error at line %d: %s\n", ec_curline(), s ); } @@ -1286,7 +1289,7 @@ case 52: { yyval.field = mkfield ( yypvt[-4].str, yypvt[-1].type, yypvt[-2].num ); } break; case 53: # line 242 "Express.y" -{ yyval.num = NULL; printf ( "Warning at line %d: field redefinition ignored\n", ec_curline() ); /* redefinition of inherited field */ } break; +{ yyval.num = 0; printf ( "Warning at line %d: field redefinition ignored\n", ec_curline() ); /* redefinition of inherited field */ } break; case 54: # line 244 "Express.y" { yyval.tlist = mktlist ( yypvt[-0].str, 0 ); /* inherited field specification */ } break; diff --git a/src/ExpToCasExe/expscan.cxx b/src/ExpToCasExe/expscan.cxx index a6cbd11aa9..14b934bf26 100644 --- a/src/ExpToCasExe/expscan.cxx +++ b/src/ExpToCasExe/expscan.cxx @@ -20,6 +20,9 @@ #if defined(__clang__) #pragma GCC diagnostic ignored "-Wmissing-braces" #endif +#if __cplusplus > 199711L +#define register// Deprecated in C++11. +#endif # define U(x) x # define NLSTATE yyprevious=YYNEWLINE @@ -186,7 +189,7 @@ int ec_curline ( void ) return ec_linenum; } -int ec_error ( char *s, char *text ) +int ec_error ( char const *s, char const *text ) { printf ( "\nError at line %d: %s \"%s\"\n", ec_curline(), s, text ); return 0; @@ -210,7 +213,7 @@ int ec_error ( char *s, char *text ) /* parsing rules */ # define YYNEWLINE 10 int yylex(){ -int nstr; extern int yyprevious; +int nstr = 0; extern int yyprevious; #ifdef __cplusplus /* to avoid CC and lint complaining yyfussy not being used ...*/ static int __lex_hack = 0; diff --git a/src/ExpToCasExe/exptocas.h b/src/ExpToCasExe/exptocas.h index 66003e0ca6..26d783fb8d 100644 --- a/src/ExpToCasExe/exptocas.h +++ b/src/ExpToCasExe/exptocas.h @@ -101,7 +101,7 @@ struct ec_type *mktset ( int keyword, int ilow, int ihigh, struct ec_type *o struct ec_field *mkfield ( char *name, struct ec_type *type, int optional ); /* Error reporting functions */ -int ec_error ( char *s, char *text ); +int ec_error ( char const *s, char const *text ); int ec_curline ( void ); /* Access to result of parsing */ diff --git a/src/ExpToCasExe/occt_step_entities.lst b/src/ExpToCasExe/occt_step_entities.lst index d7ddbbb505..0472a22583 100644 --- a/src/ExpToCasExe/occt_step_entities.lst +++ b/src/ExpToCasExe/occt_step_entities.lst @@ -778,3 +778,7 @@ TessellatedItem StepVisual TessellatedGeometricSet StepVisual TessellatedCurveSet StepVisual CoordinatesList StepVisual +SurfaceStyleTransparent StepVisual +SurfaceStyleReflectanceAmbient StepVisual +SurfaceStyleRendering StepVisual +SurfaceStyleRenderingWithProperties StepVisual diff --git a/src/Express/Express_Entity.cxx b/src/Express/Express_Entity.cxx index 81cf6b256f..f507f4bfc6 100644 --- a/src/Express/Express_Entity.cxx +++ b/src/Express/Express_Entity.cxx @@ -427,13 +427,13 @@ Standard_Boolean Express_Entity::GenerateClass () const Express::WriteFileStamp ( os ); // write include section - os << "#include " << std::endl; - os << "#include " << std::endl; - os << "#include " << std::endl; os << "#include <" << RWCPPName->ToCString() << ".hxx>" << std::endl; dict.Clear(); os << "#include <" << CPPname->ToCString() << ".hxx>" << std::endl; dict.Bind(CPPname->ToCString(), 1); + os << "#include " << std::endl; + os << "#include " << std::endl; + os << "#include " << std::endl; WriteRWInclude ( os, dict ); // write constructor Express::WriteMethodStamp ( os, RWCPPName );