int indent = 0, i;
GString *id = g_string_new("");
char *serialize = (serialization == SERIALIZE) ? "serialize" : "deserialize";
+ gboolean use_ampersand = TRUE;
- //forb_idl_print_node(ts, 0);
-
switch(IDL_NODE_TYPE(name)) {
case IDLN_IDENT:
fprintf(of, " ");
if (use_name)
g_string_assign(id, IDL_IDENT(name).str);
+
+ if (IDL_NODE_TYPE(forb_cbe_get_typespec(ts)) == IDLN_TYPE_ARRAY)
+ use_ampersand = FALSE;
+
+/* printf("%s%s:\n", var_prefix, use_name ? id->str:""); */
+/* forb_idl_print_node(forb_cbe_get_typespec(ts), 2); */
+
break;
case IDLN_TYPE_ARRAY:
{
}
fprintf(of, "if (!");
forb_cbe_write_typespec(of, ts);
- fprintf(of, "_%s(codec, &%s%s)) goto ser_exception;\n",
- serialize, var_prefix, id->str);
+ fprintf(of, "_%s(codec, %s%s%s)) goto ser_exception;\n",
+ serialize, use_ampersand ? "&":"", var_prefix, id->str);
if (indent)
fprintf(of, " }\n");