struct mode_data *component; /* mode of components */
struct mode_data *wider; /* next wider mode */
- struct mode_data *wider_2x; /* 2x wider mode */
struct mode_data *contained; /* Pointer to list of modes that have
this mode as a component. */
static const struct mode_data blank_mode = {
0, "<unknown>", MAX_MODE_CLASS,
-1U, -1U, -1U, -1U,
- 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,
"<unknown>", 0, 0, 0, 0
};
/* Allocate max_n_modes + 1 entries to leave room for the extra null
pointer assigned after the qsort call below. */
- sortbuf = (struct mode_data **) alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
+ sortbuf = XALLOCAVEC (struct mode_data *, max_n_modes + 1);
for (c = 0; c < MAX_MODE_CLASS; c++)
{
for (prev = 0, m = modes[c]; m; m = next)
{
m->wider = void_mode;
- m->wider_2x = void_mode;
/* this is nreverse */
next = m->next;
for (j = 0; j < i; j++)
sortbuf[j]->next = sortbuf[j]->wider = sortbuf[j + 1];
-
modes[c] = sortbuf[0];
}
}
continue;
}
+ /* For vectors we want twice the number of components,
+ with the same element type. */
+ if (m->cl == MODE_VECTOR_INT
+ || m->cl == MODE_VECTOR_FLOAT
+ || m->cl == MODE_VECTOR_FRACT
+ || m->cl == MODE_VECTOR_UFRACT
+ || m->cl == MODE_VECTOR_ACCUM
+ || m->cl == MODE_VECTOR_UACCUM)
+ {
+ if (m2->ncomponents != 2 * m->ncomponents)
+ continue;
+ if (m->component != m2->component)
+ continue;
+ }
+
break;
}
if (m2 == void_mode)