To make full use of all 16 bits of a sym, we should make sure
we consistent use "unsigned".
Signed-off-by: NeilBrown <neilb@suse.de>
`((cnt - 1) | 7) + 1`.
###### functions
`((cnt - 1) | 7) + 1`.
###### functions
- static void symset_add(struct symset *s, int key, int val)
+ static void symset_add(struct symset *s, unsigned short key, unsigned short val)
{
int i;
int current = ((s->cnt-1) | 7) + 1;
{
int i;
int current = ((s->cnt-1) | 7) + 1;
We return the index where the value was found (so data can be accessed),
or `-1` to indicate failure.
We return the index where the value was found (so data can be accessed),
or `-1` to indicate failure.
- static int symset_find(struct symset *ss, int key)
+ static int symset_find(struct symset *ss, unsigned short key)
{
int lo = 0;
int hi = ss->cnt;
{
int lo = 0;
int hi = ss->cnt;
int added = 0;
for (i = 0; i < b->cnt; i++)
if (symset_find(a, b->syms[i]) < 0) {
int added = 0;
for (i = 0; i < b->cnt; i++)
if (symset_find(a, b->syms[i]) < 0) {
+ unsigned short data = 0;
if (b->data != NO_DATA)
data = b->data[i];
symset_add(a, b->syms[i], data);
if (b->data != NO_DATA)
data = b->data[i];
symset_add(a, b->syms[i], data);
int p2;
struct symbol *s;
struct symset LA = INIT_SYMSET;
int p2;
struct symbol *s;
struct symset LA = INIT_SYMSET;
if (bs == pr->body_size)
continue;
if (bs == pr->body_size)
continue;
// if they don't exist.
for (i = 0; i < done.cnt; i++) {
int j;
// if they don't exist.
for (i = 0; i < done.cnt; i++) {
int j;
struct symset newitemset = INIT_SYMSET;
if (type >= LALR)
newitemset = INIT_DATASET;
struct symset newitemset = INIT_SYMSET;
if (type >= LALR)
newitemset = INIT_DATASET;
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
int pos;
if (bp == pr->body_size)
int pos;
if (bp == pr->body_size)
struct symset first = INIT_SYMSET;
struct itemset *is;
int again;
struct symset first = INIT_SYMSET;
struct itemset *is;
int again;
if (type >= LALR) {
// LA set just has eof
struct symset eof = INIT_SYMSET;
if (type >= LALR) {
// LA set just has eof
struct symset eof = INIT_SYMSET;
continue;
/* First collect the shifts */
for (j = 0; j < is->items.cnt; j++) {
continue;
/* First collect the shifts */
for (j = 0; j < is->items.cnt; j++) {
- int itm = is->items.syms[j];
+ unsigned short itm = is->items.syms[j];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
}
/* Now look for reduction and conflicts */
for (j = 0; j < is->items.cnt; j++) {
}
/* Now look for reduction and conflicts */
for (j = 0; j < is->items.cnt; j++) {
- int itm = is->items.syms[j];
+ unsigned short itm = is->items.syms[j];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];