diff options
author | Bernard Normier <bernard@zeroc.com> | 2012-09-07 11:19:34 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2012-09-07 11:19:34 -0400 |
commit | c9c426efd3e579d0220fbdee4a0a261fa2c191b5 (patch) | |
tree | d67c6356bfda2700e983586afaa71f28734c2cc9 /cpp/demo/book/lifecycle/Scanner.cpp | |
parent | Undo pragma-once-in-header enhancement (diff) | |
download | ice-c9c426efd3e579d0220fbdee4a0a261fa2c191b5.tar.bz2 ice-c9c426efd3e579d0220fbdee4a0a261fa2c191b5.tar.xz ice-c9c426efd3e579d0220fbdee4a0a261fa2c191b5.zip |
Port to Solaris 11 / Solaris Studio 12.3 (== CC 5.12)
Fix to BasicStream.h (unitialized data member) that caused occasional failures in Ice/stream test
Diffstat (limited to 'cpp/demo/book/lifecycle/Scanner.cpp')
-rw-r--r-- | cpp/demo/book/lifecycle/Scanner.cpp | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/cpp/demo/book/lifecycle/Scanner.cpp b/cpp/demo/book/lifecycle/Scanner.cpp index bc4b1c7f7a3..9920e412452 100644 --- a/cpp/demo/book/lifecycle/Scanner.cpp +++ b/cpp/demo/book/lifecycle/Scanner.cpp @@ -54,6 +54,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -142,15 +141,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -532,9 +523,19 @@ using namespace std; # define YY_NO_UNISTD_H #endif +#ifdef __SUNPRO_CC +# ifdef yywrap +# undef yywrap +# define yywrap() 1 +# endif +# ifdef ICE_64 +# pragma error_messages(off,truncwarn) +# endif +#endif + #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) -#line 537 "lex.yy.c" +#line 538 "lex.yy.c" #define INITIAL 0 @@ -615,12 +616,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -628,7 +624,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -639,7 +635,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -721,10 +717,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 48 "Scanner.l" +#line 58 "Scanner.l" -#line 727 "lex.yy.c" +#line 723 "lex.yy.c" if ( !(yy_init) ) { @@ -809,7 +805,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 50 "Scanner.l" +#line 60 "Scanner.l" { // C++-style comment int c; @@ -822,7 +818,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 60 "Scanner.l" +#line 70 "Scanner.l" { // C-style comment while(true) @@ -850,77 +846,77 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 85 "Scanner.l" +#line 95 "Scanner.l" { return TOK_HELP; } YY_BREAK case 4: YY_RULE_SETUP -#line 89 "Scanner.l" +#line 99 "Scanner.l" { return TOK_EXIT; } YY_BREAK case 5: YY_RULE_SETUP -#line 93 "Scanner.l" +#line 103 "Scanner.l" { return TOK_LIST; } YY_BREAK case 6: YY_RULE_SETUP -#line 97 "Scanner.l" +#line 107 "Scanner.l" { return TOK_LIST_RECURSIVE; } YY_BREAK case 7: YY_RULE_SETUP -#line 101 "Scanner.l" +#line 111 "Scanner.l" { return TOK_CREATE_FILE; } YY_BREAK case 8: YY_RULE_SETUP -#line 105 "Scanner.l" +#line 115 "Scanner.l" { return TOK_CREATE_DIR; } YY_BREAK case 9: YY_RULE_SETUP -#line 109 "Scanner.l" +#line 119 "Scanner.l" { return TOK_PWD; } YY_BREAK case 10: YY_RULE_SETUP -#line 113 "Scanner.l" +#line 123 "Scanner.l" { return TOK_CD; } YY_BREAK case 11: YY_RULE_SETUP -#line 117 "Scanner.l" +#line 127 "Scanner.l" { return TOK_CAT; } YY_BREAK case 12: YY_RULE_SETUP -#line 121 "Scanner.l" +#line 131 "Scanner.l" { return TOK_WRITE; } YY_BREAK case 13: YY_RULE_SETUP -#line 125 "Scanner.l" +#line 135 "Scanner.l" { return TOK_RM; } @@ -928,7 +924,7 @@ YY_RULE_SETUP case 14: /* rule 14 can match eol */ YY_RULE_SETUP -#line 129 "Scanner.l" +#line 139 "Scanner.l" { size_t len = strlen(yytext); for(size_t i = 0; i < len; ++i) @@ -943,14 +939,14 @@ YY_RULE_SETUP case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 140 "Scanner.l" +#line 150 "Scanner.l" { return ';'; } YY_BREAK case 16: YY_RULE_SETUP -#line 144 "Scanner.l" +#line 154 "Scanner.l" { // "..."-type strings string s; @@ -1027,7 +1023,7 @@ YY_RULE_SETUP YY_BREAK case 17: YY_RULE_SETUP -#line 218 "Scanner.l" +#line 228 "Scanner.l" { // '...'-type strings string s; @@ -1055,7 +1051,7 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 243 "Scanner.l" +#line 253 "Scanner.l" { // Simple strings string s; @@ -1082,10 +1078,10 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 267 "Scanner.l" +#line 277 "Scanner.l" ECHO; YY_BREAK -#line 1088 "lex.yy.c" +#line 1084 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1839,8 +1835,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2079,7 +2075,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 267 "Scanner.l" +#line 277 "Scanner.l" |