Skip to content

Commit

Permalink
Fix updating symbol list for overloaded C++ symbols
Browse files Browse the repository at this point in the history
When searching for an old entry to reuse when updating an existing
symbol list, take into account the symbol's argument list not to
always match the same entry for overloaded symbols.

Closes #3406644.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5910 ea778897-0a13-0410-b9d1-a72fbfd435f5
  • Loading branch information
b4n committed Sep 12, 2011
1 parent 5d687aa commit aace32f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2011-09-12 Colomban Wendling <colomban(at)geany(dot)org>

* src/symbols.c:
Fix updating symbol list for overloaded C++ symbols (closes
#3406644).


2011-09-02 Colomban Wendling <colomban(at)geany(dot)org>

* src/ui_utils.c:
Expand Down
10 changes: 9 additions & 1 deletion src/symbols.c
Expand Up @@ -1191,7 +1191,9 @@ static gboolean tag_equal(gconstpointer v1, gconstpointer v2)
const TMTag *t2 = v2;

return (t1->type == t2->type && strcmp(t1->name, t2->name) == 0 &&
utils_str_equal(t1->atts.entry.scope, t2->atts.entry.scope));
utils_str_equal(t1->atts.entry.scope, t2->atts.entry.scope) &&
/* include arglist in match to support e.g. C++ overloading */
utils_str_equal(t1->atts.entry.arglist, t2->atts.entry.arglist));
}


Expand All @@ -1210,6 +1212,12 @@ static guint tag_hash(gconstpointer v)
for (p = tag->atts.entry.scope; *p != '\0'; p++)
h = (h << 5) + h + *p;
}
/* for e.g. C++ overloading */
if (tag->atts.entry.arglist)
{
for (p = tag->atts.entry.arglist; *p != '\0'; p++)
h = (h << 5) + h + *p;
}

return h;
}
Expand Down

0 comments on commit aace32f

Please sign in to comment.