Update integer encoding
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-generate-io-struct.c
index 29068563f7657d7786d4a74b8323f40e794e5a65..b62f33d7354f5649ac01c695cd71d2c64fc737e8 100644 (file)
@@ -350,6 +350,11 @@ struct declaration *ctf_type_declarator_visit(FILE *fd, int depth,
 
                /* TYPEDEC_NESTED */
 
+               if (!nested_declaration) {
+                       fprintf(fd, "[error] %s: nested type is unknown.\n", __func__);
+                       return NULL;
+               }
+
                /* create array/sequence, pass nested_declaration as child. */
                if (cds_list_empty(&node_type_declarator->u.type_declarator.u.nested.length)) {
                        fprintf(fd, "[error] %s: expecting length field reference or value.\n", __func__);
@@ -1187,6 +1192,8 @@ struct declaration *ctf_declaration_integer_visit(FILE *fd, int depth,
                        else if (!strcmp(s_right, "ASCII")
                            || !strcmp(s_right, "ascii"))
                                encoding = CTF_STRING_ASCII;
+                       else if (!strcmp(s_right, "none"))
+                               encoding = CTF_STRING_NONE;
                        else {
                                fprintf(fd, "[error] %s: unknown string encoding \"%s\"\n", __func__, s_right);
                                g_free(s_right);
@@ -1605,7 +1612,7 @@ int ctf_event_visit(FILE *fd, int depth, struct ctf_node *node,
                }
                event->context = container_of(definition,
                                        struct definition_struct, p);
-               parent_def_scope = event->context->scope;
+               parent_def_scope = event->context->p.scope;
        }
        if (event->fields_decl) {
                struct definition *definition =
@@ -1617,7 +1624,7 @@ int ctf_event_visit(FILE *fd, int depth, struct ctf_node *node,
                }
                event->fields = container_of(definition,
                                        struct definition_struct, p);
-               parent_def_scope = event->fields->scope;
+               parent_def_scope = event->fields->p.scope;
        }
        return 0;
 
@@ -1811,7 +1818,7 @@ int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
                }
                stream->packet_context = container_of(definition,
                                                struct definition_struct, p);
-               parent_def_scope = stream->packet_context->scope;
+               parent_def_scope = stream->packet_context->p.scope;
        }
        if (stream->event_header_decl) {
                struct definition *definition =
@@ -1823,7 +1830,7 @@ int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
                }
                stream->event_header =
                        container_of(definition, struct definition_struct, p);
-               parent_def_scope = stream->event_header->scope;
+               parent_def_scope = stream->event_header->p.scope;
        }
        if (stream->event_context_decl) {
                struct definition *definition =
@@ -1835,7 +1842,7 @@ int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
                }
                stream->event_context =
                        container_of(definition, struct definition_struct, p);
-               parent_def_scope = stream->event_context->scope;
+               parent_def_scope = stream->event_context->p.scope;
        }
        stream->definition_scope = parent_def_scope;
 
@@ -2039,7 +2046,7 @@ int ctf_trace_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_trace
                }
                trace->packet_header =
                        container_of(definition, struct definition_struct, p);
-               parent_def_scope = trace->packet_header->scope;
+               parent_def_scope = trace->packet_header->p.scope;
        }
        trace->definition_scope = parent_def_scope;
 
This page took 0.025682 seconds and 4 git commands to generate.