+2008-10-11 Lucas Rocha <lucasr@gnome.org>
+
+ Bug 552376: scanner generates wrong names for enum members when
+ there's no defined gtype.
+
+ * giscanner/utils.py (strip_common_prefix): Always strip common
+ prefix exactly up to the last "_", and not beyond.
+ * tests/scanner/foo.h (FooEnumNoType): add FOO_ENUM_NEUF. The point
+ here is that the first character after the last '_' should should be
+ the same as the character in the same position on the type name.
+ * tests/scanner/foo-expected.gir: test that
+
2008-10-10 Lucas Rocha <lucasr@gnome.org>
Bug 555293: append library_paths to LPATH env variable to work
def strip_common_prefix(first, second):
+ max_index = second.rfind('_')
+ second_len = len(second)
second = second.replace('_', '')
+ max_index -= second_len - len(second) - 1
for i, c in enumerate(first.upper()):
- if i >= len(second) or c != second[i]:
+ if i >= len(second) or c != second[i] or i == max_index:
return second[i:]
return second[i + 1:]
<member name="un" value="1" c:identifier="FOO_ENUM_UN"/>
<member name="deux" value="2" c:identifier="FOO_ENUM_DEUX"/>
<member name="trois" value="3" c:identifier="FOO_ENUM_TROIS"/>
+ <member name="neuf" value="9" c:identifier="FOO_ENUM_NEUF"/>
</enumeration>
<enumeration name="EnumFullname" c:type="FooEnumFullname">
<member name="one" value="1" c:identifier="FOO_ENUM_FULLNAME_ONE"/>
FOO_ENUM_UN = 1,
FOO_ENUM_DEUX = 2,
FOO_ENUM_TROIS = 3,
+ FOO_ENUM_NEUF = 9
} FooEnumNoType;
GType foo_flags_type_get_type (void);