techee commented on this pull request.
@@ -2742,8 +2793,12 @@ extern void anonGenerate (vString *buffer, const char *prefix, int kind)
vStringCopyS(buffer, prefix);
- unsigned int uHash = anonHash((const unsigned char *)getInputFileName()); - sprintf(szNum,"%08x%02x%02x",uHash,lang -> anonumousIdentiferId, kind); +/* GEANY DIFF */ +/* unsigned int uHash = anonHash((const unsigned char *)getInputFileName()); + sprintf(szNum,"%08x%02x%02x",uHash,lang -> anonumousIdentiferId, kind); */ + sprintf(szNum,"%u", lang -> anonumousIdentiferId);
The problem with it is that in the symbol tree you'll see anonymous types like:
``` anon_enum_162324ab457c anon_enum_8734cb98f023 anon_enum_fc820958ba67 ```
instead of
``` anon_enum_1 anon_enum_2 anon_enum_3 ```
and the latter is nicer for users.
We already detect whether a tag is anonymous in tm_tag_is_anon() and don't perform autocompletion for it so there's no problem with the same anonymous names from different files.
Even this is not perfect - `anonumousIdentiferId` is used for all anonymous types so we'll get things like
``` anon_enum_1 anon_struct_2 anon_enum_3 ```
and it would be nicer to have
``` anon_enum_1 anon_struct_1 anon_enum_2 ```
But in the new cxx parser the anonymous name isn't different for individual types and the above would be
``` Anonymous1 Anonymous2 Anonymous3 ```
so at least for C and C++ this problem will disappear.