summaryrefslogtreecommitdiff
path: root/src/glsl/glcpp/glcpp-lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glcpp/glcpp-lex.c')
-rw-r--r--src/glsl/glcpp/glcpp-lex.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.c b/src/glsl/glcpp/glcpp-lex.c
index 40db2c27c5..d976904135 100644
--- a/src/glsl/glcpp/glcpp-lex.c
+++ b/src/glsl/glcpp/glcpp-lex.c
@@ -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
@@ -159,15 +158,7 @@ typedef void* yyscan_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.
@@ -691,7 +682,7 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
} while(0);
#define YY_USER_INIT yylineno = 0; yycolumn = 0;
-#line 695 "glcpp/glcpp-lex.c"
+#line 686 "glcpp/glcpp-lex.c"
#define INITIAL 0
#define DONE 1
@@ -846,12 +837,7 @@ static int input (yyscan_t yyscanner );
/* 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. */
@@ -859,7 +845,7 @@ static int input (yyscan_t yyscanner );
/* 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,
@@ -870,7 +856,7 @@ static int input (yyscan_t yyscanner );
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; \
@@ -962,7 +948,7 @@ YY_DECL
/* Single-line comments */
-#line 966 "glcpp/glcpp-lex.c"
+#line 952 "glcpp/glcpp-lex.c"
yylval = yylval_param;
@@ -1133,7 +1119,7 @@ case 8:
YY_RULE_SETUP
#line 90 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
yyextra->space_tokens = 0;
@@ -1146,7 +1132,7 @@ case 9:
YY_RULE_SETUP
#line 100 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
return OTHER;
@@ -1283,7 +1269,7 @@ case 22:
YY_RULE_SETUP
#line 188 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
@@ -1291,7 +1277,7 @@ case 23:
YY_RULE_SETUP
#line 193 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
@@ -1299,7 +1285,7 @@ case 24:
YY_RULE_SETUP
#line 198 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
@@ -1377,7 +1363,7 @@ case 35:
YY_RULE_SETUP
#line 243 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
YY_BREAK
@@ -1392,7 +1378,7 @@ case 37:
YY_RULE_SETUP
#line 252 "glcpp/glcpp-lex.l"
{
- yylval->str = xtalloc_strdup (yyextra, yytext);
+ yylval->str = talloc_strdup (yyextra, yytext);
return OTHER;
}
YY_BREAK
@@ -1442,7 +1428,7 @@ YY_RULE_SETUP
#line 286 "glcpp/glcpp-lex.l"
ECHO;
YY_BREAK
-#line 1446 "glcpp/glcpp-lex.c"
+#line 1432 "glcpp/glcpp-lex.c"
case YY_STATE_EOF(DONE):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(UNREACHABLE):
@@ -2181,8 +2167,8 @@ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner)
/** Setup the input buffer state to scan the given bytes. The next call to glcpp_lex() 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.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/