# HG changeset patch # User Pascal Bellard # Date 1625846176 0 # Node ID 505527cf814f9a72fe4758c0330d90d783db00a2 # Parent bf28cc07ebf16b61a1349de1db4e9febad29fee0 xxdiff: add bison-3.02.patch diff -r bf28cc07ebf1 -r 505527cf814f xxdiff/receipt --- a/xxdiff/receipt Fri Jul 09 10:46:05 2021 +0000 +++ b/xxdiff/receipt Fri Jul 09 15:56:16 2021 +0000 @@ -17,6 +17,7 @@ # Rules to configure and make the package. compile_rules() { + patch -p1 < $stuff/bison-3.02.patch cd src make QMAKE=/usr/bin/qmake -f Makefile.bootstrap && make QMAKE=/usr/bin/qmake diff -r bf28cc07ebf1 -r 505527cf814f xxdiff/stuff/bison-3.02.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xxdiff/stuff/bison-3.02.patch Fri Jul 09 15:56:16 2021 +0000 @@ -0,0 +1,106 @@ +from f9f3270a4253144488f87a72bf941f510891dbb1 in https://github.com/blais/xxdiff/ +--- xxdiff-401/src/resParser.cpp ++++ xxdiff-401/src/resParser.cpp +@@ -73,7 +73,7 @@ extern int resParserparse( void* ); + + //------------------------------------------------------------------------------ + // +-void resParsererror( const char* msg ) ++void resParsererror( XxResources *, const char* msg ) + { + // Send errors to stdout so we can filter out the debug info shmeglu while + // debugging parser. +@@ -794,7 +794,7 @@ int parseFromKeywordList( + QString os; + QTextStream oss( &os ); + oss << "Unknown " << errmsg << ": " << name << flush; +- resParsererror( os.toLatin1().constData() ); ++ resParsererror( NULL, os.toLatin1().constData() ); + } + num = ERROR_TOKEN; + return ERROR_TOKEN; +--- xxdiff-401/src/resParser.l ++++ xxdiff-401/src/resParser.l +@@ -76,7 +76,7 @@ if ( input_stream_ptr->atEnd() ) { + result = YY_NULL; \ + } \ + else { \ +- int ii = 0; \ ++ unsigned ii = 0; \ + for ( ; (ii < max_size) && (!input_stream_ptr->atEnd()); ++ii ) { \ + (*input_stream_ptr) >> buf[ii]; \ + } \ +--- xxdiff-401/src/resParser.y ++++ xxdiff-401/src/resParser.y +@@ -20,11 +20,6 @@ + * + ******************************************************************************/ + +-%union +-{ +- int num; +- char* str; +-} + %{ + + // xxdiff imports +@@ -39,12 +34,22 @@ + + // The parser input is the resources object to fill in. + #define RESOURCES ( static_cast(resources) ) +-#define YYPARSE_PARAM resources ++%} ++ ++%define api.pure full ++%parse-param {XxResources * resources} + ++%union ++{ ++ int num; ++ char* str; ++} ++ ++%{ + // Declare lexer from other compilation unit. + int resParserlex( YYSTYPE* yylval ); + +-void resParsererror( const char* msg ); ++void resParsererror( XxResources *, const char* msg ); + + // Declare some parser functions and data defined in resParser.cpp + namespace XxResParserNS { +@@ -144,7 +149,6 @@ using namespace XxResParserNS; // Make s + %type boolkwd + + %start xxdiffrc +-%pure_parser + + %% + xxdiffrc : stmts +@@ -188,7 +192,7 @@ prefgeometry : PREFGEOMETRY COLON GEOMSP + RESOURCES->setPreferredGeometry( geometry ); + } + else { +- yyerror( "Bad geometry specification." ); ++ yyerror( NULL, "Bad geometry specification." ); + // Should never happen, the lexer regexp should be tough + // enough. + } +@@ -212,7 +216,7 @@ style : STYLE COLON STRING + QString err = QString( "Requested style key does not exist." ); + err += QString( "\nValid styles are: " ); + err += styles.join( ", " ); +- yyerror( err.toLatin1().constData() ); ++ yyerror( NULL, err.toLatin1().constData() ); + } + } + ; +@@ -224,7 +228,7 @@ accel : ACCEL DOT ACCELNAME COLON STRIN + char buf[2048]; + ::snprintf( buf, 2048, + "Unrecognized accelerator: %s\n", $5 ); +- yyerror( buf ); ++ yyerror( NULL, buf ); + } + } + ;