summaryrefslogtreecommitdiff
path: root/lr0.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-01 14:44:51 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-01 14:44:51 +0900
commit372b8dfcdaf5efa7cc9e068843717e9621562c76 (patch)
treec048308d6627d11b2114c269c23c23c22dea7dfd /lr0.c
parente83b5dbc94116983df1ec99d4f02cc8640f63da5 (diff)
downloadbyacc-372b8dfcdaf5efa7cc9e068843717e9621562c76.tar.gz
byacc-372b8dfcdaf5efa7cc9e068843717e9621562c76.tar.bz2
byacc-372b8dfcdaf5efa7cc9e068843717e9621562c76.zip
Imported Upstream version 20100610upstream/20100610
Diffstat (limited to 'lr0.c')
-rw-r--r--lr0.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/lr0.c b/lr0.c
index 391a650..0759973 100644
--- a/lr0.c
+++ b/lr0.c
@@ -1,4 +1,4 @@
-/* $Id: lr0.c,v 1.9 2009/10/27 09:20:39 tom Exp $ */
+/* $Id: lr0.c,v 1.12 2010/06/09 08:53:17 tom Exp $ */
#include "defs.h"
@@ -171,7 +171,7 @@ get_state(int symbol)
isp1 = kernel_base[symbol];
iend = kernel_end[symbol];
- n = iend - isp1;
+ n = (int)(iend - isp1);
key = *isp1;
assert(0 <= key && key < nitems);
@@ -228,8 +228,7 @@ initialize_states(void)
continue;
p = (core *)MALLOC(sizeof(core) + i * sizeof(short));
- if (p == 0)
- no_space();
+ NO_SPACE(p);
p->next = 0;
p->link = 0;
@@ -299,7 +298,7 @@ new_state(int symbol)
iend = kernel_end[symbol];
n = (unsigned)(iend - isp1);
- p = (core *)allocate((unsigned)(sizeof(core) + (n - 1) * sizeof(short)));
+ p = (core *)allocate((sizeof(core) + (n - 1) * sizeof(short)));
p->accessing_symbol = (Value_t) symbol;
p->number = (Value_t) nstates;
p->nitems = (Value_t) n;
@@ -403,8 +402,8 @@ save_shifts(void)
short *sp2;
short *send;
- p = (shifts *)allocate((unsigned)(sizeof(shifts) +
- (unsigned)(nshifts - 1) * sizeof(short)));
+ p = (shifts *)allocate((sizeof(shifts) +
+ (unsigned)(nshifts - 1) * sizeof(short)));
p->number = this_state->number;
p->nshifts = (Value_t) nshifts;
@@ -451,9 +450,9 @@ save_reductions(void)
if (count)
{
- p = (reductions *)allocate((unsigned)(sizeof(reductions) +
- (unsigned)(count - 1) *
- sizeof(short)));
+ p = (reductions *)allocate((sizeof(reductions) +
+ (unsigned)(count - 1) *
+ sizeof(short)));
p->number = this_state->number;
p->nreds = count;
@@ -540,8 +539,7 @@ set_nullable(void)
int done_flag;
nullable = MALLOC(nsyms);
- if (nullable == 0)
- no_space();
+ NO_SPACE(nullable);
for (i = 0; i < nsyms; ++i)
nullable[i] = 0;