Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h misc.c mod-misc.c Log Message: Enable showing differential time in debug output. =================================================================== RCS file: /cvs/e/e16/e/src/E.h,v retrieving revision 1.601 retrieving revision 1.602 diff -u -3 -r1.601 -r1.602 --- E.h 24 Jan 2008 18:37:45 -0000 1.601 +++ E.h 27 Jan 2008 18:37:18 -0000 1.602 @@ -431,6 +431,7 @@ char autosave; char memory_paranoia; char save_under; + char difftime; } EConf; =================================================================== RCS file: /cvs/e/e16/e/src/misc.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -3 -r1.80 -r1.81 --- misc.c 7 Nov 2007 22:05:18 -0000 1.80 +++ misc.c 27 Jan 2008 18:37:19 -0000 1.81 @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2007 Kim Woelders + * Copyright (C) 2004-2008 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -204,8 +204,6 @@ tvd->tv_usec = tus; } -#if 1 /* Set to 0 for differential time */ - void Eprintf(const char *fmt, ...) { @@ -217,39 +215,29 @@ gettimeofday(&tv, NULL); _tvdiff(&tv, &tv0, &tv); - fprintf(stdout, "[%d] %4ld.%06ld: ", getpid(), tv.tv_sec, tv.tv_usec); - va_start(args, fmt); - vfprintf(stdout, fmt, args); - va_end(args); -} - -#else - -void -Eprintf(const char *fmt, ...) -{ - static struct timeval tv1; - va_list args; - struct timeval tv, tvd; - unsigned long nreq; - if (tv0.tv_sec == 0) - gettimeofday(&tv0, NULL); - - gettimeofday(&tv, NULL); - _tvdiff(&tv, &tv0, &tv); - _tvdiff(&tvd, &tv1, &tv); - tv1 = tv; + if (Conf.difftime) + { + static struct timeval tv1 = { 0, 0 }; + struct timeval tvd; + unsigned long nreq; + + _tvdiff(&tvd, &tv1, &tv); + tv1 = tv; + + nreq = (disp) ? NextRequest(disp) : 0; + fprintf(stdout, "[%d] %#8lx %4ld.%06ld [%3ld.%06ld]: ", getpid(), + nreq, tv1.tv_sec, tv1.tv_usec, tvd.tv_sec, tvd.tv_usec); + } + else + { + fprintf(stdout, "[%d] %4ld.%06ld: ", getpid(), tv.tv_sec, tv.tv_usec); + } - nreq = (disp) ? NextRequest(disp) : 0; - fprintf(stdout, "[%d] %#8lx %4ld.%06ld [%3ld.%06ld]: ", getpid(), - nreq, tv1.tv_sec, tv1.tv_usec, tvd.tv_sec, tvd.tv_usec); va_start(args, fmt); vfprintf(stdout, fmt, args); va_end(args); } - -#endif #if ENABLE_DEBUG_EVENTS /* =================================================================== RCS file: /cvs/e/e16/e/src/mod-misc.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -3 -r1.62 -r1.63 --- mod-misc.c 24 Jan 2008 18:37:45 -0000 1.62 +++ mod-misc.c 27 Jan 2008 18:37:19 -0000 1.63 @@ -202,6 +202,7 @@ CFG_ITEM_BOOL(Conf, autosave, 1), CFG_ITEM_BOOL(Conf, memory_paranoia, 1), CFG_ITEM_BOOL(Conf, save_under, 0), + CFG_ITEM_BOOL(Conf, difftime, 0), }; #define N_CFG_ITEMS ((int)(sizeof(MiscCfgItems)/sizeof(CfgItem))) ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs