* metadata ::= [ rule [ '\n' relativerule ]* ]
* rule ::= pattern ' ' [ args ]
* relativerule ::= '.' rule
- * pattern ::= glob [ '#' selector ] [ '.' glob ]*
+ * pattern ::= glob [ '#' selector ] [ '.' pattern ]
*/
private Metadata tree = new Metadata ("");
private Scanner scanner;
/*
* The changed is a faster way to check whether the type has changed and it may affect the C declaration.
- * If type arguments change, the C declaration is not affected.
*/
DataType? element_get_type (DataType orig_type, bool owned_by_default, out bool changed = null) {
changed = false;
changed = true;
}
- if (owned_by_default || type.value_owned) {
+ if (type.value_owned) {
if (metadata.has_argument (ArgumentType.UNOWNED)) {
type.value_owned = !metadata.get_bool (ArgumentType.UNOWNED);
}
- } else if (!owned_by_default || !type.value_owned) {
+ } else {
if (metadata.has_argument (ArgumentType.OWNED)) {
type.value_owned = metadata.get_bool (ArgumentType.OWNED);
}
}
bool changed;
- type = element_get_type (type, false, out changed);
+ type = element_get_type (type, direction == "out" || direction == "ref", out changed);
if (!changed) {
// discard ctype, duplicated information
ctype = null;
start_element ("array");
if (type_name == null) {
- if (reader.get_attribute ("length") != null
- && &array_length_index != null) {
+ if (reader.get_attribute ("length") != null) {
array_length_index = int.parse (reader.get_attribute ("length"));
}
next ();