summaryrefslogtreecommitdiff
path: root/graphics/asymptote/patches/bison.patch
blob: 5f7e4fe1dcd4f9b1e6f04031b4b77351bd33f6e5 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
diff -ru bison-2.0a/data/yacc.c bison-2.0aJ/data/yacc.c
--- bison-2.0a/data/yacc.c	2005-05-21 11:12:32.000000000 -0600
+++ bison-2.0aJ/data/yacc.c	2005-06-30 18:14:16.509158136 -0600
@@ -237,7 +237,7 @@
 
 # ifdef YYSTACK_ALLOC
    /* Pacify GCC's `empty if-body' warning. */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+#  define YYSTACK_FREE(Ptr) { /* empty */; }
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
@@ -291,19 +291,20 @@
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
-#  if defined (__GNUC__) && 1 < __GNUC__
+#  if defined (__GNUC__)
+#   if 1 < __GNUC__
 #   define YYCOPY(To, From, Count) \
       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
+#   endif
+#  endif
+# endif
+# ifndef YYCOPY
 #   define YYCOPY(To, From, Count)		\
-      do					\
 	{					\
 	  YYSIZE_T yyi;				\
 	  for (yyi = 0; yyi < (Count); yyi++)	\
 	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (0)
-#  endif
+	}
 # endif
 
 /* Relocate STACK from its old location to the new one.  The
@@ -312,15 +313,13 @@
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
 # define YYSTACK_RELOCATE(Stack)					\
-    do									\
       {									\
 	YYSIZE_T yynewbytes;						\
 	YYCOPY (&yyptr->Stack, Stack, yysize);				\
 	Stack = &yyptr->Stack;						\
 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (0)
+      }
 
 #endif
 
@@ -487,6 +486,7 @@
 #define YYACCEPT	goto yyacceptlab
 #define YYABORT		goto yyabortlab
 #define YYERROR		goto yyerrorlab
+int yy_false=false; /* Used to suppress compiler warning about unused label */
 
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
@@ -498,7 +498,7 @@
 #define YYRECOVERING()  (!!yyerrstatus)
 
 #define YYBACKUP(Token, Value)					\
-do								\
+{								\
   if (yychar == YYEMPTY && yylen == 1)				\
     {								\
       yychar = (Token);						\
@@ -512,7 +512,7 @@
       yyerror (]b4_yyerror_args[_("syntax error: cannot back up")); \
       YYERROR;							\
     }								\
-while (0)
+}
 
 
 #define YYTERROR	1
@@ -526,7 +526,7 @@
 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)				\
-    do									\
+    {									\
       if (N)								\
 	{								\
 	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
@@ -541,7 +541,7 @@
 	  (Current).first_column = (Current).last_column =		\
 	    YYRHSLOC (Rhs, 0).last_column;				\
 	}								\
-    while (0)
+    }
 #endif
 
 
@@ -550,7 +550,7 @@
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# ifdef YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)			\
      fprintf (File, "%d.%d-%d.%d",			\
               (Loc).first_line, (Loc).first_column,	\
@@ -578,13 +578,13 @@
 # endif
 
 # define YYDPRINTF(Args)			\
-do {						\
+{						\
   if (yydebug)					\
     YYFPRINTF Args;				\
-} while (0)
+}
 
 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)		\
-do {								\
+{								\
   if (yydebug)							\
     {								\
       YYFPRINTF (stderr, "%s ", Title);				\
@@ -592,7 +592,7 @@
                   Type, Value]b4_location_if([, Location])[);	\
       YYFPRINTF (stderr, "\n");					\
     }								\
-} while (0)
+}
 
 /*------------------------------------------------------------------.
 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
@@ -610,10 +610,10 @@
 }
 
 # define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
+{								\
   if (yydebug)							\
     yy_stack_print ((Bottom), (Top));				\
-} while (0)
+}
 
 
 /*------------------------------------------------.
@@ -634,10 +634,10 @@
 }
 
 # define YY_REDUCE_PRINT(Rule)		\
-do {					\
+{					\
   if (yydebug)				\
     yy_reduce_print (Rule);		\
-} while (0)
+}
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -826,7 +826,7 @@
 
   /* When reducing, the number of symbols on the RHS of the reduced
      rule.  */
-  int yylen;
+  int yylen=0;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
 
@@ -874,7 +874,7 @@
   yyssp++;
 
  yysetstate:
-  *yyssp = yystate;
+  *yyssp = (short int) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
     {
@@ -1222,12 +1222,6 @@
 `---------------------------------------------------*/
 yyerrorlab:
 
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (0)
-     goto yyerrorlab;
-
 ]b4_location_if([[  yyerror_range[0] = yylsp[1-yylen];
   yylsp -= yylen;
   ]])[yyvsp -= yylen;
@@ -1297,6 +1291,13 @@
 `-----------------------------------*/
 yyabortlab:
   yyresult = 1;
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (yy_false)
+     goto yyerrorlab;
+
   goto yyreturn;
 
 #ifndef yyoverflow