From: John Kessenich Date: Sat, 8 Mar 2014 00:17:27 +0000 (+0000) Subject: Use more modern bison %parse-param and %lex-param rather than #defined YYPARSE_PARAM... X-Git-Tag: upstream/0.1~725 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b57784690391b59604947af24823d4db1d66e25;p=platform%2Fupstream%2Fglslang.git Use more modern bison %parse-param and %lex-param rather than #defined YYPARSE_PARAM and YYLEX_PARAM. This should make it build across a broader range of modern versions of bison, as well as avoid void* and type casting. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25746 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index a0a39d2..b2eb463 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -9,5 +9,5 @@ // source have to figure out how to create revision.h just to get a build // going. However, if it is not updated, it can be a version behind. -#define GLSLANG_REVISION "25511" -#define GLSLANG_DATE "2014/02/24 14:16:19" +#define GLSLANG_REVISION "25512" +#define GLSLANG_DATE "2014/02/24 14:36:08" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 9d3b9b8..aff1e62 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -43,7 +43,7 @@ #include "preprocessor/PpContext.h" -extern int yyparse(void*); +extern int yyparse(glslang::TParseContext*); namespace glslang { @@ -143,7 +143,7 @@ bool TParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& inp { currentScanner = &input; ppContext.setInput(input, versionWillBeError); - yyparse((void*)this); + yyparse(this); finalErrorCheck(); return numErrors == 0; diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 0a2a237..3d675df 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -42,8 +42,8 @@ #include "../Include/Types.h" #include "SymbolTable.h" -#include "glslang_tab.cpp.h" #include "ParseHelper.h" +#include "glslang_tab.cpp.h" #include "ScanContext.h" #include "Scan.h" diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index ba5cedd..32a0717 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -97,15 +97,15 @@ using namespace glslang; %{ -#define YYPARSE_PARAM voidParseContext -#define parseContext (*(TParseContext*)voidParseContext) -#define YYLEX_PARAM parseContext -#define yyerror(msg) parseContext.parserError(msg) +#define parseContext (*pParseContext) +#define yyerror(context, msg) context->parserError(msg) extern int yylex(YYSTYPE*, TParseContext&); %} +%parse-param {glslang::TParseContext* pParseContext} +%lex-param {parseContext} %pure_parser // enable thread safety %expect 1 // One shift reduce conflict because of if | else