wok rev 24080
xxdiff: add bison-3.02.patch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 09 15:56:16 2021 +0000 (2021-07-09) |
parents | bf28cc07ebf1 |
children | e424d38736d6 |
files | xxdiff/receipt xxdiff/stuff/bison-3.02.patch |
line diff
1.1 --- a/xxdiff/receipt Fri Jul 09 10:46:05 2021 +0000 1.2 +++ b/xxdiff/receipt Fri Jul 09 15:56:16 2021 +0000 1.3 @@ -17,6 +17,7 @@ 1.4 # Rules to configure and make the package. 1.5 compile_rules() 1.6 { 1.7 + patch -p1 < $stuff/bison-3.02.patch 1.8 cd src 1.9 make QMAKE=/usr/bin/qmake -f Makefile.bootstrap && 1.10 make QMAKE=/usr/bin/qmake
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/xxdiff/stuff/bison-3.02.patch Fri Jul 09 15:56:16 2021 +0000 2.3 @@ -0,0 +1,106 @@ 2.4 +from f9f3270a4253144488f87a72bf941f510891dbb1 in https://github.com/blais/xxdiff/ 2.5 +--- xxdiff-401/src/resParser.cpp 2.6 ++++ xxdiff-401/src/resParser.cpp 2.7 +@@ -73,7 +73,7 @@ extern int resParserparse( void* ); 2.8 + 2.9 + //------------------------------------------------------------------------------ 2.10 + // 2.11 +-void resParsererror( const char* msg ) 2.12 ++void resParsererror( XxResources *, const char* msg ) 2.13 + { 2.14 + // Send errors to stdout so we can filter out the debug info shmeglu while 2.15 + // debugging parser. 2.16 +@@ -794,7 +794,7 @@ int parseFromKeywordList( 2.17 + QString os; 2.18 + QTextStream oss( &os ); 2.19 + oss << "Unknown " << errmsg << ": " << name << flush; 2.20 +- resParsererror( os.toLatin1().constData() ); 2.21 ++ resParsererror( NULL, os.toLatin1().constData() ); 2.22 + } 2.23 + num = ERROR_TOKEN; 2.24 + return ERROR_TOKEN; 2.25 +--- xxdiff-401/src/resParser.l 2.26 ++++ xxdiff-401/src/resParser.l 2.27 +@@ -76,7 +76,7 @@ if ( input_stream_ptr->atEnd() ) { 2.28 + result = YY_NULL; \ 2.29 + } \ 2.30 + else { \ 2.31 +- int ii = 0; \ 2.32 ++ unsigned ii = 0; \ 2.33 + for ( ; (ii < max_size) && (!input_stream_ptr->atEnd()); ++ii ) { \ 2.34 + (*input_stream_ptr) >> buf[ii]; \ 2.35 + } \ 2.36 +--- xxdiff-401/src/resParser.y 2.37 ++++ xxdiff-401/src/resParser.y 2.38 +@@ -20,11 +20,6 @@ 2.39 + * 2.40 + ******************************************************************************/ 2.41 + 2.42 +-%union 2.43 +-{ 2.44 +- int num; 2.45 +- char* str; 2.46 +-} 2.47 + %{ 2.48 + 2.49 + // xxdiff imports 2.50 +@@ -39,12 +34,22 @@ 2.51 + 2.52 + // The parser input is the resources object to fill in. 2.53 + #define RESOURCES ( static_cast<XxResources*>(resources) ) 2.54 +-#define YYPARSE_PARAM resources 2.55 ++%} 2.56 ++ 2.57 ++%define api.pure full 2.58 ++%parse-param {XxResources * resources} 2.59 + 2.60 ++%union 2.61 ++{ 2.62 ++ int num; 2.63 ++ char* str; 2.64 ++} 2.65 ++ 2.66 ++%{ 2.67 + // Declare lexer from other compilation unit. 2.68 + int resParserlex( YYSTYPE* yylval ); 2.69 + 2.70 +-void resParsererror( const char* msg ); 2.71 ++void resParsererror( XxResources *, const char* msg ); 2.72 + 2.73 + // Declare some parser functions and data defined in resParser.cpp 2.74 + namespace XxResParserNS { 2.75 +@@ -144,7 +149,6 @@ using namespace XxResParserNS; // Make s 2.76 + %type <num> boolkwd 2.77 + 2.78 + %start xxdiffrc 2.79 +-%pure_parser 2.80 + 2.81 + %% 2.82 + xxdiffrc : stmts 2.83 +@@ -188,7 +192,7 @@ prefgeometry : PREFGEOMETRY COLON GEOMSP 2.84 + RESOURCES->setPreferredGeometry( geometry ); 2.85 + } 2.86 + else { 2.87 +- yyerror( "Bad geometry specification." ); 2.88 ++ yyerror( NULL, "Bad geometry specification." ); 2.89 + // Should never happen, the lexer regexp should be tough 2.90 + // enough. 2.91 + } 2.92 +@@ -212,7 +216,7 @@ style : STYLE COLON STRING 2.93 + QString err = QString( "Requested style key does not exist." ); 2.94 + err += QString( "\nValid styles are: " ); 2.95 + err += styles.join( ", " ); 2.96 +- yyerror( err.toLatin1().constData() ); 2.97 ++ yyerror( NULL, err.toLatin1().constData() ); 2.98 + } 2.99 + } 2.100 + ; 2.101 +@@ -224,7 +228,7 @@ accel : ACCEL DOT ACCELNAME COLON STRIN 2.102 + char buf[2048]; 2.103 + ::snprintf( buf, 2048, 2.104 + "Unrecognized accelerator: %s\n", $5 ); 2.105 +- yyerror( buf ); 2.106 ++ yyerror( NULL, buf ); 2.107 + } 2.108 + } 2.109 + ;