From 1350b7802163fda0235f43a9f8a79f09b30c0ed2 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 6 Feb 2016 01:58:35 +0100 Subject: [PATCH 1/1] clang don't like the register modifer in c++ --- src/surf/simgrid_dtd.c | 32 ++++++++++++++++---------------- tools/cmake/MaintainerMode.cmake | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/surf/simgrid_dtd.c b/src/surf/simgrid_dtd.c index 09e0f06381..03e2864746 100644 --- a/src/surf/simgrid_dtd.c +++ b/src/surf/simgrid_dtd.c @@ -198,7 +198,7 @@ extern FILE *surf_parse_in, *surf_parse_out; * existing scanners that call yyless() from OUTSIDE surf_parse_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-surf_parse_lineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. + * normally declared as a variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ @@ -5461,9 +5461,9 @@ extern int surf_parse_lex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -5666,7 +5666,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -9795,9 +9795,9 @@ case YY_STATE_EOF(IMPOSSIBLE): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -9929,14 +9929,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -9961,10 +9961,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -10617,7 +10617,7 @@ int surf_parse_lex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -10626,7 +10626,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; diff --git a/tools/cmake/MaintainerMode.cmake b/tools/cmake/MaintainerMode.cmake index bf8bd9c478..72e46c0a22 100644 --- a/tools/cmake/MaintainerMode.cmake +++ b/tools/cmake/MaintainerMode.cmake @@ -203,6 +203,7 @@ if(enable_maintainer_mode AND NOT WIN32) COMMAND ${SED_EXE} -i ${string9} src/surf/simgrid_dtd.c COMMAND ${SED_EXE} -i ${string15} src/surf/simgrid_dtd.c COMMAND ${SED_EXE} -i "s/int yyl;/unsigned int yyl;/" src/surf/simgrid_dtd.c + COMMAND ${SED_EXE} -i "s/register //" src/surf/simgrid_dtd.c COMMAND ${CMAKE_COMMAND} -E echo "surf/simgrid_dtd.c" #xbt/graphxml.c: xbt/graphxml.l -- 2.20.1