Re: [AD] TRACEs in xkeyboard.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sat, 2005-09-24 at 18:43 -0700, Chris wrote:
> Yeah, I mentioned in IRC to him that that could break programs. An alternative
> would be:
>
> static INLINE void _al_int_dummy()
> {
> }
> #ifdef DEBUGMODE
> #define TRACE ((0) ? _al_int_dummy : (al_trace("Allegro:: "),al_trace))
> #else
> #define TRACE ((1) ? _al_int_dummy : al_trace)
>
I just tried it again, and on closer look, some places already use
al_trace to continue a message in the same line. So solutions like these
won't work :/
I think, for 4.2.0, the best thing to do will be when I'm not so lazy
and simply add the prefixes manually to xkeyboard.c. Attached patch does
this :) Of course, this also shows that more will be needed after 4.2.0,
e.g. I wasn't sure how to now handle actual warnings. (I simply prefixed
the prefix with Warning: in that case for now.)
--
Elias Pschernig
Index: src/x/xkeyboard.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xkeyboard.c,v
retrieving revision 1.14
diff -r1.14 xkeyboard.c
33c33
< // TODO: Once this driver is deemed more stable, reduce debugging output.
---
> #define PREFIX "Allegro keyboard: "
348c348
< TRACE ("Key %i missing:", i);
---
> TRACE (PREFIX "Key %i missing:", i);
529c529
< TRACE ("xkeyboard: %i keys, %i symbols per key.\n", count, sym_per_key);
---
> TRACE (PREFIX "%i keys, %i symbols per key.\n", count, sym_per_key);
542c542
< TRACE ("key [%i: %s %s]", i, sym_str ? sym_str : "NULL", sym2_str ?
---
> TRACE (PREFIX "key [%i: %s %s]", i, sym_str ? sym_str : "NULL", sym2_str ?
595c595
< TRACE ("Modifier %d:", i + 1);
---
> TRACE (PREFIX "Modifier %d:", i + 1);
625c625
< TRACE ("User override: KeySym %i assigned to %i.\n", i, scancode);
---
> TRACE (PREFIX "User override: KeySym %i assigned to %i.\n", i, scancode);
698c698
< TRACE("x keyboard warning: XOpenIM failed.\n");
---
> TRACE("Warning: " PREFIX "XOpenIM failed.\n");
704c704
< TRACE("x keyboard warning: Input method doesn't support any styles.\n");
---
> TRACE("Warning: " PREFIX "Input method doesn't support any styles.\n");
718c718
< TRACE ("x keyboard warning: Input method doesn't support the style we support.\n");
---
> TRACE ("Warning: " PREFIX "Input method doesn't support the style we support.\n");
732c732
< TRACE ("x keyboard warning: XCreateIC failed.\n");
---
> TRACE ("Warning: " PREFIX "XCreateIC failed.\n");