summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/patches/flex.patch
blob: 56a2d4d5c458b685fe20594e4c009625e0058611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff -u flex-2.5.39/gen.c flex-2.5.39J/gen.c
--- flex-2.5.39/gen.c	2014-03-26 06:46:44.000000000 -0600
+++ flex-2.5.39J/gen.c	2014-04-26 10:52:30.962073096 -0600
@@ -55,6 +55,14 @@
  * 0 elements of its arrays, too.)
  */
 
+static const char *get_yy_char_decl (void)
+{
+	return (gentables)
+		? "static yyconst YY_CHAR %s[%d] =\n    {   0,\n"
+		: "static yyconst YY_CHAR * %s = 0;\n";
+}
+
+
 static const char *get_int16_decl (void)
 {
 	return (gentables)
@@ -465,7 +473,7 @@
 	register int i, j;
 	int     numrows;
 
-	out_str_dec (get_int32_decl (), "yy_ec", csize);
+	out_str_dec (get_yy_char_decl (), "yy_ec", csize);
 
 	for (i = 1; i < csize; ++i) {
 		ecgroup[i] = ABS (ecgroup[i]);
@@ -1271,7 +1279,7 @@
 			fputs (_("\n\nMeta-Equivalence Classes:\n"),
 			       stderr);
 
-		out_str_dec (get_int32_decl (), "yy_meta", numecs + 1);
+		out_str_dec (get_yy_char_decl (), "yy_meta", numecs + 1);
 		buf_prints (&yydmap_buf,
 			    "\t{YYTD_ID_META, (void**)&yy_meta, sizeof(%s)},\n",
 			    "flex_int32_t");
@@ -1516,11 +1524,11 @@
 	if (yymore_used && !yytext_is_array) {
 		indent_puts ("YY_G(yytext_ptr) -= YY_G(yy_more_len); \\");
 		indent_puts
-			("yyleng = (size_t) (yy_cp - YY_G(yytext_ptr)); \\");
+			("yyleng = (int) (yy_cp - YY_G(yytext_ptr)); \\");
 	}
 
 	else
-		indent_puts ("yyleng = (size_t) (yy_cp - yy_bp); \\");
+		indent_puts ("yyleng = (int) (yy_cp - yy_bp); \\");
 
 	/* Now also deal with copying yytext_ptr to yytext if needed. */
 	skelout ();		/* %% [3.0] - break point in skel */