projects/aports·blob master · refs

142 lines · 4.0 KiB

1Patch-Source: https://invent.kde.org/libraries/kdb/-/commit/f32e5c03d18977d32b1eb5df2deb2a908ff4780c (updated)
2From f32e5c03d18977d32b1eb5df2deb2a908ff4780c Mon Sep 17 00:00:00 2001
3From: Volker Krause <[email protected]>
4Date: Mon, 24 Jun 2024 18:15:46 +0200
5Subject: [PATCH] Fix build with newer ICU
6
7Newer ICU requires C++17 but the checked-in generated parser code is
8incompatible with that...
9
10Needed to unbreak the Qt 5 CI seed jobs.
11---
12 CMakeLists.txt | 1 +
13 src/parser/generated/sqlscanner.cpp | 40 ++++++++++++++---------------
14 2 files changed, 21 insertions(+), 20 deletions(-)
15
16diff --git a/CMakeLists.txt b/CMakeLists.txt
17index 83801cce..634ab9e3 100644
18--- a/CMakeLists.txt
19+++ b/CMakeLists.txt
20@@ -29,6 +29,7 @@
21 cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
22
23 # Dependencies
24+set(CMAKE_CXX_STANDARD 17)
25 set(REQUIRED_QT_VERSION 5.4.0)
26 set(REQUIRED_KF5_VERSION 5.45.0)
27
28diff --git a/src/parser/generated/sqlscanner.cpp b/src/parser/generated/sqlscanner.cpp
29index c484bb25..2c0a8e2d 100644
30--- a/src/parser/generated/sqlscanner.cpp
31+++ b/src/parser/generated/sqlscanner.cpp
32@@ -864,9 +864,9 @@
33 */
34 YY_DECL
35 {
36- register yy_state_type yy_current_state;
37- register char *yy_cp, *yy_bp;
38- register int yy_act;
39+ yy_state_type yy_current_state;
40+ char *yy_cp, *yy_bp;
41+ int yy_act;
42
43 #line 63 "KDbSqlScanner.l"
44
45@@ -917,7 +917,7 @@
46 yy_match:
47 do
48 {
49- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
50+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
51 if ( yy_accept[yy_current_state] )
52 {
53 (yy_last_accepting_state) = yy_current_state;
54@@ -1582,9 +1582,9 @@
55 */
56 static int yy_get_next_buffer (void)
57 {
58- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
59- register char *source = (yytext_ptr);
60- register int number_to_move, i;
61+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
62+ char *source = (yytext_ptr);
63+ int number_to_move, i;
64 int ret_val;
65
66 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
67@@ -1716,14 +1716,14 @@
68
69 static yy_state_type yy_get_previous_state (void)
70 {
71- register yy_state_type yy_current_state;
72- register char *yy_cp;
73+ yy_state_type yy_current_state;
74+ char *yy_cp;
75
76 yy_current_state = (yy_start);
77
78 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
79 {
80- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
81+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
82 if ( yy_accept[yy_current_state] )
83 {
84 (yy_last_accepting_state) = yy_current_state;
85@@ -1748,10 +1748,10 @@
86 */
87 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
88 {
89- register int yy_is_jam;
90- register char *yy_cp = (yy_c_buf_p);
91+ int yy_is_jam;
92+ char *yy_cp = (yy_c_buf_p);
93
94- register YY_CHAR yy_c = 1;
95+ YY_CHAR yy_c = 1;
96 if ( yy_accept[yy_current_state] )
97 {
98 (yy_last_accepting_state) = yy_current_state;
99@@ -1769,9 +1769,9 @@
100 return yy_is_jam ? 0 : yy_current_state;
101 }
102
103- static void yyunput (int c, register char * yy_bp )
104+ static void yyunput (int c, char * yy_bp )
105 {
106- register char *yy_cp;
107+ char *yy_cp;
108
109 yy_cp = (yy_c_buf_p);
110
111@@ -1781,10 +1781,10 @@
112 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
113 { /* need to shift things up to make room */
114 /* +2 for EOB chars. */
115- register int number_to_move = (yy_n_chars) + 2;
116- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
117+ int number_to_move = (yy_n_chars) + 2;
118+ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
119 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
120- register char *source =
121+ char *source =
122 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
123
124 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
125@@ -2393,7 +2393,7 @@
126 #ifndef yytext_ptr
127 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
128 {
129- register int i;
130+ int i;
131 for ( i = 0; i < n; ++i )
132 s1[i] = s2[i];
133 }
134@@ -2402,7 +2402,7 @@
135 #ifdef YY_NEED_STRLEN
136 static int yy_flex_strlen (yyconst char * s )
137 {
138- register int n;
139+ int n;
140 for ( n = 0; s[n]; ++n )
141 ;
142