diff --git a/compiler/capnpc-c.c b/compiler/capnpc-c.c index fc03c38..ce20ec5 100644 --- a/compiler/capnpc-c.c +++ b/compiler/capnpc-c.c @@ -68,14 +68,14 @@ static void resolve_names(struct str *b, struct node *n, capn_text name, struct str_add(&n->name, b->str, b->len); str_add(b, "_", 1); - for (i = 0; i < n->n.nestedNodes.p.len; i++) { + for (i = n->n.nestedNodes.p.len-1; i >= 0; i--) { struct Node_NestedNode nest; get_Node_NestedNode(&nest, n->n.nestedNodes, i); resolve_names(b, find_node(nest.id), nest.name, file); } if (n->n.which == Node__struct) { - for (i = 0; i < n->n._struct.fields.p.len; i++) { + for (i = n->n._struct.fields.p.len-1; i >= 0; i--) { if (n->fields[i].group) { resolve_names(b, n->fields[i].group, n->fields[i].f.name, file); } diff --git a/compiler/simple.capnp b/compiler/simple.capnp deleted file mode 100644 index 290e715..0000000 --- a/compiler/simple.capnp +++ /dev/null @@ -1,25 +0,0 @@ -@0xbee1ff6b75d24d73; - -struct Foo { - body @0 union { - voidValue @10 :Void; - boolValue @2 :Bool; - int8Value @3 :Int8; - int16Value @4 :Int16; - int32Value @5 :Int32; - int64Value @6 :Int64; - uint8Value @7 :UInt8; - uint16Value @8 :UInt16; - uint32Value @9 :UInt32; - uint64Value @1 :UInt64; - float32Value @11 :Float32; - float64Value @12 :Float64; - textValue @13 :Text; - dataValue @14 :Data; - listValue @15 :Object; - enumValue @16 :UInt16; - structValue @17 :Object; - interfaceValue @18 :Void; - objectValue @19 :Object; - } -}