[Cmake-commits] [cmake-commits] king committed cmCommandArgumentLexer.cxx 1.16 1.17 cmCommandArgumentLexer.in.l 1.11 1.12

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Dec 17 09:33:20 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv19610/Source

Modified Files:
	cmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l 
Log Message:
COMP: Fix unused yyunput warning in lexer

This adds the "nounput" option to the flex input file so that yyunput is
not generated.  The function is static but not used so some compilers
warn.


Index: cmCommandArgumentLexer.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentLexer.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -C 2 -d -r1.16 -r1.17
*** cmCommandArgumentLexer.cxx	17 Dec 2008 13:24:35 -0000	1.16
--- cmCommandArgumentLexer.cxx	17 Dec 2008 14:33:18 -0000	1.17
***************
*** 606,611 ****
  #endif
  
-     static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
-     
  #ifndef yytext_ptr
  static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
--- 606,609 ----
***************
*** 730,737 ****
      struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  
! #line 63 "cmCommandArgumentLexer.in.l"
  
  
! #line 734 "cmCommandArgumentLexer.cxx"
  
          if ( !yyg->yy_init )
--- 728,735 ----
      struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  
! #line 64 "cmCommandArgumentLexer.in.l"
  
  
! #line 732 "cmCommandArgumentLexer.cxx"
  
          if ( !yyg->yy_init )
***************
*** 818,830 ****
  case 1:
  YY_RULE_SETUP
! #line 65 "cmCommandArgumentLexer.in.l"
! { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
!   yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
!   return cal_ENVCURLY; 
! } 
  case 2:
  YY_RULE_SETUP
! #line 71 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 816,828 ----
  case 1:
  YY_RULE_SETUP
! #line 66 "cmCommandArgumentLexer.in.l"
! {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
!   yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
!   return cal_ENVCURLY;
! }
  case 2:
  YY_RULE_SETUP
! #line 72 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 834,838 ****
  case 3:
  YY_RULE_SETUP
! #line 77 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 832,836 ----
  case 3:
  YY_RULE_SETUP
! #line 78 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 842,846 ****
  case 4:
  YY_RULE_SETUP
! #line 83 "cmCommandArgumentLexer.in.l"
  {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 840,844 ----
  case 4:
  YY_RULE_SETUP
! #line 84 "cmCommandArgumentLexer.in.l"
  {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 851,855 ****
  case 5:
  YY_RULE_SETUP
! #line 90 "cmCommandArgumentLexer.in.l"
  {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 849,853 ----
  case 5:
  YY_RULE_SETUP
! #line 91 "cmCommandArgumentLexer.in.l"
  {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 860,864 ****
  case 6:
  YY_RULE_SETUP
! #line 97 "cmCommandArgumentLexer.in.l"
  {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 858,862 ----
  case 6:
  YY_RULE_SETUP
! #line 98 "cmCommandArgumentLexer.in.l"
  {
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 869,873 ****
  case 7:
  YY_RULE_SETUP
! #line 104 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 867,871 ----
  case 7:
  YY_RULE_SETUP
! #line 105 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 877,881 ****
  case 8:
  YY_RULE_SETUP
! #line 110 "cmCommandArgumentLexer.in.l"
  {
    if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
--- 875,879 ----
  case 8:
  YY_RULE_SETUP
! #line 111 "cmCommandArgumentLexer.in.l"
  {
    if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
***************
*** 888,892 ****
  /* rule 9 can match eol */
  YY_RULE_SETUP
! #line 118 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
--- 886,890 ----
  /* rule 9 can match eol */
  YY_RULE_SETUP
! #line 119 "cmCommandArgumentLexer.in.l"
  { 
    //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
***************
*** 896,900 ****
  case 10:
  YY_RULE_SETUP
! #line 124 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
--- 894,898 ----
  case 10:
  YY_RULE_SETUP
! #line 125 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
***************
*** 904,908 ****
  case 11:
  YY_RULE_SETUP
! #line 130 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
--- 902,906 ----
  case 11:
  YY_RULE_SETUP
! #line 131 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
***************
*** 912,916 ****
  case 12:
  YY_RULE_SETUP
! #line 136 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
--- 910,914 ----
  case 12:
  YY_RULE_SETUP
! #line 137 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
***************
*** 920,924 ****
  case 13:
  YY_RULE_SETUP
! #line 142 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
--- 918,922 ----
  case 13:
  YY_RULE_SETUP
! #line 143 "cmCommandArgumentLexer.in.l"
  {
    //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
***************
*** 928,935 ****
  case 14:
  YY_RULE_SETUP
! #line 148 "cmCommandArgumentLexer.in.l"
  ECHO;
          YY_BREAK
! #line 945 "cmCommandArgumentLexer.cxx"
  case YY_STATE_EOF(INITIAL):
  case YY_STATE_EOF(ESCAPES):
--- 926,933 ----
  case 14:
  YY_RULE_SETUP
! #line 149 "cmCommandArgumentLexer.in.l"
  ECHO;
          YY_BREAK
! #line 943 "cmCommandArgumentLexer.cxx"
  case YY_STATE_EOF(INITIAL):
  case YY_STATE_EOF(ESCAPES):
***************
*** 1265,1306 ****
  }
  
-     static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
- {
-         register char *yy_cp;
-     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- 
-     yy_cp = yyg->yy_c_buf_p;
- 
-         /* undo effects of setting up yytext */
-         *yy_cp = yyg->yy_hold_char;
- 
-         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-                 { /* need to shift things up to make room */
-                 /* +2 for EOB chars. */
-                 register int number_to_move = yyg->yy_n_chars + 2;
-                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-                 register char *source =
-                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- 
-                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                         *--dest = *--source;
- 
-                 yy_cp += (int) (dest - source);
-                 yy_bp += (int) (dest - source);
-                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- 
-                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
-                 }
- 
-         *--yy_cp = (char) c;
- 
-         yyg->yytext_ptr = yy_bp;
-         yyg->yy_hold_char = *yy_cp;
-         yyg->yy_c_buf_p = yy_cp;
- }
- 
  #ifndef YY_NO_INPUT
  #ifdef __cplusplus
--- 1263,1266 ----
***************
*** 2088,2092 ****
  #define YYTABLES_NAME "yytables"
  
! #line 148 "cmCommandArgumentLexer.in.l"
  
  
--- 2048,2052 ----
  #define YYTABLES_NAME "yytables"
  
! #line 149 "cmCommandArgumentLexer.in.l"
  
  

Index: cmCommandArgumentLexer.in.l
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentLexer.in.l,v
retrieving revision 1.11
retrieving revision 1.12
diff -C 2 -d -r1.11 -r1.12
*** cmCommandArgumentLexer.in.l	17 Dec 2008 13:24:35 -0000	1.11
--- cmCommandArgumentLexer.in.l	17 Dec 2008 14:33:18 -0000	1.12
***************
*** 57,60 ****
--- 57,61 ----
  %option reentrant
  %option noyywrap
+ %option nounput
  %pointer
  %s ESCAPES



More information about the Cmake-commits mailing list