From f3f8de20114405bae29a354d67c38a7bf0b096a2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 23 Feb 2009 23:04:35 -0500 Subject: 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. --- giscanner/sourcescanner.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'giscanner/sourcescanner.c') diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c index 1a2508d9..79d89cdc 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) { -- cgit v1.2.1