[PATCH vkd3d 2/5] vkd3d-shader: Use "hlsl_yy" as an API prefix for bison and flex definitions.

Zebediah Figura zfigura at codeweavers.com
Wed Feb 10 15:42:57 CST 2021


So as to differentiate their API from our internal functions.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 libs/vkd3d-shader/hlsl.l | 16 ++++++++--------
 libs/vkd3d-shader/hlsl.y |  6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libs/vkd3d-shader/hlsl.l b/libs/vkd3d-shader/hlsl.l
index 7e1fe14d..d9fd43d0 100644
--- a/libs/vkd3d-shader/hlsl.l
+++ b/libs/vkd3d-shader/hlsl.l
@@ -24,10 +24,10 @@
 #include "hlsl.h"
 #include "hlsl.tab.h"
 
-#define YYSTYPE HLSL_STYPE
-#define YYLTYPE HLSL_LTYPE
+#define YYSTYPE HLSL_YYSTYPE
+#define YYLTYPE HLSL_YYLTYPE
 
-static void update_location(struct hlsl_ctx *ctx, HLSL_LTYPE *loc);
+static void update_location(struct hlsl_ctx *ctx, YYLTYPE *loc);
 
 #define YY_USER_ACTION update_location(yyget_extra(yyscanner), yyget_lloc(yyscanner));
 
@@ -40,7 +40,7 @@ static void update_location(struct hlsl_ctx *ctx, HLSL_LTYPE *loc);
 %option noinput
 %option nounput
 %option noyywrap
-%option prefix="hlsl_"
+%option prefix="hlsl_yy"
 %option reentrant
 
 %x pp pp_line pp_pragma pp_ignore
@@ -278,7 +278,7 @@ row_major               {return KW_ROW_MAJOR;           }
 
 %%
 
-static void update_location(struct hlsl_ctx *ctx, HLSL_LTYPE *lloc)
+static void update_location(struct hlsl_ctx *ctx, YYLTYPE *lloc)
 {
     lloc->file = ctx->source_file;
     lloc->col = ctx->column;
@@ -292,12 +292,12 @@ int hlsl_lexer_compile(struct hlsl_ctx *ctx, const char *text, const char *entry
     int ret;
 
     yylex_init_extra(ctx, &ctx->scanner);
-    buffer = hlsl__scan_string(text, ctx->scanner);
-    hlsl__switch_to_buffer(buffer, ctx->scanner);
+    buffer = yy_scan_string(text, ctx->scanner);
+    yy_switch_to_buffer(buffer, ctx->scanner);
 
     ret = hlsl_parser_compile(ctx, entrypoint);
 
-    hlsl__delete_buffer(buffer, ctx->scanner);
+    yy_delete_buffer(buffer, ctx->scanner);
     yylex_destroy(ctx->scanner);
     return ret;
 }
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 8fc7f825..f0280fcf 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -26,7 +26,7 @@
 #include "hlsl.h"
 #include <stdio.h>
 
-#define HLSL_LTYPE struct source_location
+#define HLSL_YYLTYPE struct source_location
 
 struct parse_parameter
 {
@@ -102,7 +102,7 @@ enum parse_assign_op
 %code provides
 {
 
-int hlsl_lex(HLSL_STYPE *yylval_param, HLSL_LTYPE *yylloc_param, void *yyscanner);
+int yylex(HLSL_YYSTYPE *yylval_param, HLSL_YYLTYPE *yylloc_param, void *yyscanner);
 
 }
 
@@ -1496,7 +1496,7 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
 
 %locations
 %define parse.error verbose
-%define api.prefix {hlsl_}
+%define api.prefix {hlsl_yy}
 %define api.pure full
 %expect 1
 %lex-param {yyscan_t scanner}
-- 
2.30.0




More information about the wine-devel mailing list