[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit] Stylistic change to glr.c
From: |
Paul Hilfinger |
Subject: |
[commit] Stylistic change to glr.c |
Date: |
Wed, 11 Jan 2006 16:17:55 -0800 |
ChangeLog:
2006-01-11 Paul Hilfinger <address@hidden>
* data/glr.c (yysplitStack): A little stylistic rewrite.
Index: data/glr.c
===================================================================
RCS file: /sources/bison/bison/data/glr.c,v
retrieving revision 1.157
diff -u -p -r1.157 glr.c
--- data/glr.c 11 Jan 2006 23:08:49 -0000 1.157
+++ data/glr.c 12 Jan 2006 00:15:25 -0000
@@ -1534,18 +1534,27 @@ yysplitStack (yyGLRStack* yystackp, size
{
yyGLRState** yynewStates;
yybool* yynewLookaheadStatuses;
- if (! ((yystackp->yytops.yycapacity
- <= (YYSIZEMAX / (2 * sizeof yynewStates[0])))
- && (yynewStates =
- (yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
- ((yystackp->yytops.yycapacity *= 2)
- * sizeof yynewStates[0])))))
+
+ yynewStates = NULL;
+
+ if (yystackp->yytops.yycapacity
+ > (YYSIZEMAX / (2 * sizeof yynewStates[0])))
+ yyMemoryExhausted (yystackp);
+ yystackp->yytops.yycapacity *= 2;
+
+ yynewStates =
+ (yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
+ (yystackp->yytops.yycapacity
+ * sizeof yynewStates[0]));
+ if (yynewStates == NULL)
yyMemoryExhausted (yystackp);
yystackp->yytops.yystates = yynewStates;
- if (! (yynewLookaheadStatuses =
- (yybool*) YYREALLOC (yystackp->yytops.yylookaheadStatuses,
- ((yystackp->yytops.yycapacity)
- * sizeof yynewLookaheadStatuses[0]))))
+
+ yynewLookaheadStatuses =
+ (yybool*) YYREALLOC (yystackp->yytops.yylookaheadStatuses,
+ (yystackp->yytops.yycapacity
+ * sizeof yynewLookaheadStatuses[0]));
+ if (yynewLookaheadStatuses == NULL)
yyMemoryExhausted (yystackp);
yystackp->yytops.yylookaheadStatuses = yynewLookaheadStatuses;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [commit] Stylistic change to glr.c,
Paul Hilfinger <=