Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/giscanner/sourcescanner.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-24 04:04:35 (GMT)
committer Colin Walters <walters@verbum.org>2009-02-24 19:23:37 (GMT)
commitf3f8de20114405bae29a354d67c38a7bf0b096a2 (patch)
treeae6a6917db11c909f84771da264f7f5930154d09 /giscanner/sourcescanner.c
parent7bd4bc6807dc829f6e8ea4db1b58a85e365b8b97 (diff)
Bug 572790 - Don't register #defines from .c files as constants
We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
Diffstat (limited to 'giscanner/sourcescanner.c')
-rw-r--r--giscanner/sourcescanner.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c
index 1a2508d..79d89cd 100644
--- a/giscanner/sourcescanner.c
+++ b/giscanner/sourcescanner.c
@@ -60,6 +60,7 @@ gi_source_symbol_unref (GISourceSymbol * symbol)
if (symbol->base_type)
ctype_free (symbol->base_type);
g_free (symbol->const_string);
+ g_free (symbol->source_filename);
g_slice_free (GISourceSymbol, symbol);
}
}
@@ -245,6 +246,11 @@ gi_source_scanner_add_symbol (GISourceScanner *scanner,
if (found_filename || scanner->macro_scan)
scanner->symbols = g_slist_prepend (scanner->symbols,
gi_source_symbol_ref (symbol));
+ /* TODO: Refcounted string here or some other optimization */
+ if (found_filename && symbol->source_filename == NULL)
+ {
+ symbol->source_filename = g_strdup (scanner->current_filename);
+ }
switch (symbol->type)
{