From: Igor Khozhanov Date: Mon, 11 May 2020 18:27:50 +0000 (+0300) Subject: Fixed casting pointer to int error. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=866561c1c08de69c82b7caddfc6efe33e3d377ed;p=occt-copy.git Fixed casting pointer to int error. Fixed /**/ comment inside comment warnings. Fixed converting string constant to 'char*' warning. --- diff --git a/src/ExpToCasExe/expparse.cxx b/src/ExpToCasExe/expparse.cxx index fb8af94d49..fc7b1f3a87 100644 --- a/src/ExpToCasExe/expparse.cxx +++ b/src/ExpToCasExe/expparse.cxx @@ -373,7 +373,7 @@ int main ( void ) printf ( "\nTotal %d", num ); } -/* tlistfree ( yylval.tlist ); * / +// tlistfree ( yylval.tlist ); return num; } */ diff --git a/src/ExpToCasExe/expscan.cxx b/src/ExpToCasExe/expscan.cxx index 3f570a41a7..a6cbd11aa9 100644 --- a/src/ExpToCasExe/expscan.cxx +++ b/src/ExpToCasExe/expscan.cxx @@ -15,6 +15,7 @@ #include #include +#include #if defined(__clang__) #pragma GCC diagnostic ignored "-Wmissing-braces" @@ -2771,7 +2772,7 @@ yylook() } # endif yyr = yyt; - if ( (int)yyt > (int)yycrank){ + if ( (intptr_t)yyt > (intptr_t)yycrank){ yyt = yyr + yych; if (yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ @@ -2785,7 +2786,7 @@ yylook() } } # ifdef YYOPTIM - else if((int)yyt < (int)yycrank) { /* r < yycrank */ + else if((intptr_t)yyt < (intptr_t)yycrank) { /* r < yycrank */ yyt = yyr = yycrank+(yycrank-yyt); # ifdef LEXDEBUG if(debug)fprintf(yyout,"compressed state\n"); diff --git a/src/ExpToCasExe/exptocas.l b/src/ExpToCasExe/exptocas.l index 00bcc4e50d..06daf7cbda 100644 --- a/src/ExpToCasExe/exptocas.l +++ b/src/ExpToCasExe/exptocas.l @@ -62,7 +62,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;