def rename_duplicates(structures):
    """Renames any duplicated struct names by appending a number."""
    non_duplicates = []
    for s1 in structures:
        count = 1
        base = s1.name
        while s1.name in non_duplicates:
            count += 1
            s1.name = "{}{}".format(base, count)
        non_duplicates.append(s1.name)
    return structures