}
extern int
-preprocess(void *talloc_ctx, const char **shader, size_t *shader_len)
+preprocess(void *talloc_ctx, const char **shader)
{
int errors;
glcpp_parser_t *parser = glcpp_parser_create ();
talloc_steal(talloc_ctx, parser->output);
*shader = parser->output;
- *shader_len = strlen(parser->output);
errors = parser->error;
glcpp_parser_destroy (parser);
%%
void
-_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
- const char *string, size_t len)
+_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
{
yylex_init_extra(state, & state->scanner);
- yy_scan_bytes(string, len, state->scanner);
+ yy_scan_string(string, state->scanner);
}
void
const char *fmt, ...);
extern "C" {
-extern int preprocess(void *ctx, const char **shader, size_t *shader_len);
+extern int preprocess(void *ctx, const char **shader);
}
extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
- const char *string, size_t len);
+ const char *string);
extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
* should probably be the parser context, but there isn't one yet.
*/
const char *source = shader->Source;
- state.error = preprocess(shader, &source, &shader->SourceLen);
+ state.error = preprocess(shader, &source);
if (!state.error) {
- _mesa_glsl_lexer_ctor(& state, source, shader->SourceLen);
+ _mesa_glsl_lexer_ctor(& state, source);
_mesa_glsl_parse(& state);
_mesa_glsl_lexer_dtor(& state);
}