diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-01-26 14:30:30 +0000 |
---|---|---|
committer | Chris Wilson <cpwilson@src.gnome.org> | 2007-01-26 14:30:30 +0000 |
commit | d2dc82343a348aa22402c03b2a1677b6b73f7d5f (patch) | |
tree | c3db0d9306e298aba3c031b46e3ea80521ee16d2 /src/matcher.c | |
parent | b01b8d2fe3e37a6d6f333c27a8890dfb49295a69 (diff) |
Janitorial work - near elimination of #ifdef VTE_DEBUG from within
2007-01-26 Chris Wilson <chris@chris-wilson.co.uk>
Janitorial work - near elimination of #ifdef VTE_DEBUG from within
functions, trimming over a thousand lines of code.
We introduce a _vte_debug_print macro to cover the more common
occurrence of printing a message at a certain debug level.
And a _VTE_DEBUG_ON for a conditional code block.
src/debug.h | 11
src/iso2022.c | 201 ++-------
src/keymap.c | 41 -
src/matcher.c | 24 -
src/pty.c | 134 +-----
src/reaper.c | 21
src/ring.c | 78 +--
src/table.c | 11
src/trie.c | 19
src/vte.c | 1187 ++++++++++---------------------------------------
src/vteaccess.c | 198 +++------
src/vteapp.c | 21
src/vtebg.c | 43 --
src/vteconv.c | 60 +-
src/vteconv.h | 12
src/vtedraw.c | 6
src/vtefc.c | 4
src/vteft2.c | 5
src/vteglyph.c | 27 -
src/vtepango.c | 11
src/vtepangox.c | 7
src/vteregex.c | 2
src/vteseq.c | 385 +++++-------------
src/vtexft.c | 26 -
24 files changed, 789 insertions(+), 1745 deletions(-)
svn path=/trunk/; revision=1539
Diffstat (limited to 'src/matcher.c')
-rw-r--r-- | src/matcher.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/matcher.c b/src/matcher.c index fd1b25a..320f853 100644 --- a/src/matcher.c +++ b/src/matcher.c @@ -61,11 +61,7 @@ _vte_matcher_init(struct _vte_matcher *matcher, const char *emulation, char *stripped; int i; -#ifdef VTE_DEBUG - if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) { - g_printerr("_vte_matcher_init()\n"); - } -#endif + _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_init()\n"); /* Load the known capability strings from the termcap structure into * the table for recognition. */ @@ -117,13 +113,11 @@ _vte_matcher_init(struct _vte_matcher *matcher, const char *emulation, _vte_matcher_add(matcher, "\n", 1, "sf", 0); } -#ifdef VTE_DEBUG - if (_vte_debug_on(VTE_DEBUG_TRIE)) { + _VTE_DEBUG_ON(VTE_DEBUG_TRIE, ({ g_printerr("Trie contents:\n"); _vte_matcher_print(matcher); g_printerr("\n"); - } -#endif + })); } /* Allocates new matcher structure. */ @@ -133,11 +127,7 @@ _vte_matcher_create(gpointer key) char *emulation = key; struct _vte_matcher *ret = NULL; -#ifdef VTE_DEBUG - if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) { - g_printerr("_vte_matcher_create()\n"); - } -#endif + _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_create()\n"); ret = g_slice_new(struct _vte_matcher); ret->impl = &dummy_vte_matcher_trie; ret->match = NULL; @@ -158,11 +148,7 @@ _vte_matcher_destroy(gpointer value) { struct _vte_matcher *matcher = value; -#ifdef VTE_DEBUG - if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) { - g_printerr("_vte_matcher_destroy()\n"); - } -#endif + _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_destroy()\n"); if (matcher->match != NULL) /* do not call destroy on dummy values */ matcher->impl->klass->destroy(matcher->impl); g_slice_free(struct _vte_matcher, matcher); |