Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
fbp-generator: only set array size if whole array was exported
Browse files Browse the repository at this point in the history
Case only a single port of the array was exposed, it shouldn't
expose the whole array.

Signed-off-by: Bruno Dilly <bruno.dilly@intel.com>
  • Loading branch information
bdilly committed Sep 14, 2015
1 parent 9526fdc commit f2ee2d0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/bin/sol-fbp-generator/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,11 +1133,16 @@ add_fbp_type_to_type_store(struct type_store *parent_store, struct fbp_data *dat

SOL_VECTOR_FOREACH_IDX (&desc->in_ports, port, j) {
if (sol_str_slice_str_eq(e->port, port->name)) {
int array_size = 0;
/* case the whole array was exported */
if (e->port_idx == -1)
array_size = port->array_size;

p->data_type = strdupa(port->data_type);
p->array_size = port->array_size;
p->array_size = array_size;
p->base_port_idx = base_port_idx++;
if (port->array_size > 1)
base_port_idx += port->array_size - 1;
if (array_size > 1)
base_port_idx += array_size - 1;
}
}
SOL_NULL_CHECK_GOTO(p->data_type, fail_in_ports);
Expand All @@ -1155,11 +1160,16 @@ add_fbp_type_to_type_store(struct type_store *parent_store, struct fbp_data *dat

SOL_VECTOR_FOREACH_IDX (&desc->out_ports, port, j) {
if (sol_str_slice_str_eq(e->port, port->name)) {
int array_size = 0;
/* case the whole array was exported */
if (e->port_idx == -1)
array_size = port->array_size;

p->data_type = strdupa(port->data_type);
p->array_size = port->array_size;
p->array_size = array_size;
p->base_port_idx = base_port_idx++;
if (port->array_size > 1)
base_port_idx += port->array_size - 1;
if (array_size > 1)
base_port_idx += array_size - 1;
}
}
SOL_NULL_CHECK_GOTO(p->data_type, fail_out_ports);
Expand Down

0 comments on commit f2ee2d0

Please sign in to comment.