else
{
prt_expression_helper(e, P_CALL);
- output(".data");
+ output(".nxdata");
}
return isbf;
else
{
set_location(vd->location);
- output("typedef struct { unsigned char data[%d]; } __attribute__((packed)) %s;",
+ output("typedef struct { unsigned char nxdata[%d]; } __attribute__((packed)) %s;",
(int)type_size_int(basetype), vd->ddecl->name);
}
return TRUE;
else
{
output_hton(ddecl->type);
- outputln("(%s.data, %s%s);", ddecl->name, NXBASE_PREFIX, ddecl->name);
+ outputln("(%s.nxdata, %s%s);", ddecl->name, NXBASE_PREFIX, ddecl->name);
}
return TRUE;
{
declaration fd;
psd_options opts = 0;
+ type_element interesting;
scan_declaration (fd, d->decls)
{
outputln(";");
}
}
+ /* If there's an unnamed struct/union field, we need to print it and
+ account for its size in ns */
if (!(opts & psd_duplicate))
- prt_interesting_elements(d->modifiers, opts);
+ scan_type_element (interesting, d->modifiers)
+ if (is_tag_ref(interesting))
+ {
+ tag_ref tr = CAST(tag_ref, interesting);
+
+ prt_type_element(interesting, opts);
+ outputln(";");
+ if (cval_isinteger(tr->tdecl->size))
+ ns->offset += cval_uint_value(tr->tdecl->size);
+ }
}
void prt_network_field_declaration(declaration d, struct network_state *ns)