[Tux4kids-tuxtype-dev] [GSoC] New patches

Jerome Portal jerome.portal.2 at gmail.com
Wed Apr 17 18:53:31 UTC 2013


Hello,


Here are new commits, this time I am trying to do the transition to the T4K
library, and particularly the debug part as debug macros are used in a lot
of functions (so the real transition can't begin until  it's done) ; T4K
use also the debug_status variable, defined in t4k_main.c, that can be used
through t4k_common.h. So I did like in Tux Maths, and included t4k_common.h
in globals.h ; obviously the compiler told me there were few redefinitions
of macros, structures, so I commented these portions of Tux Typing code
(first commit:
https://github.com/OjeromeO/tuxtype/commit/8a9c0c0f4b0d4178af7b4fa532abeac655e3de05
).


Now about the debug macros themselves, T4K uses :
#define DEBUGCODE(mask) if((mask) & debug_status)

whereas Tux Typing uses :
#define DEBUGCODE if (settings.debug_on)

To make sure the behaviour will be the same, I commented the DEBUGCODE
macro, replaced all the DEBUGCODE with DEBUGCODE(mask), and I used
debug_all, a constant of t4k_common.h, as the mask ; obviously I set
debug_status to debug_all when the "-d" option is given to tuxtype (second
commit:
https://github.com/OjeromeO/tuxtype/commit/be81afd791552784635cc9503a7a872802c4aa88
).


And it works well, I built tuxtype and ran it with and without -d, and it
works as expected :)


I will have to repeat the same procedure for,
in T4K :
#define DEBUGMSG(mask, ...) \
    if((mask) & debug_status) \
{ \
    fprintf(stderr, __VA_ARGS__); fflush(stderr); \
}

and in Tux Typing :
#define LOG( str ) if (settings.debug_on) fprintf( stderr, str );



Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/tux4kids-tuxtype-dev/attachments/20130417/e919d480/attachment.html>


More information about the Tux4kids-tuxtype-dev mailing list