From 3261805fee19e346b4d1f84b23816daa1628764a Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 16 Apr 2003 09:49:22 +0000 Subject: Update from the Windows port and general cleanup/restructure --- generic/perfos.c | 75 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 36 deletions(-) (limited to 'generic/perfos.c') diff --git a/generic/perfos.c b/generic/perfos.c index df7af11..3a0847a 100644 --- a/generic/perfos.c +++ b/generic/perfos.c @@ -26,13 +26,13 @@ * */ +#ifndef _WIN32 #include "perfos.h" #include "List.h" #include "Types.h" #include -#include static const char rcsid[] = "$Id$"; @@ -50,7 +50,8 @@ static ZnList Chronos = NULL; ********************************************************************************** */ static void -HardwareSynchronize(Display *test_display, Drawable test_window) +HardwareSynchronize(Display *test_display __unused, + Drawable test_window __unused) { /*XImage *image;*/ @@ -139,12 +140,12 @@ XCorrectionValue(Display *display, Drawable window) /* ********************************************************************************** * - * XStartChrono - Start a perf chrono with X synchronize. + * ZnXStartChrono - Start a perf chrono with X synchronize. * ********************************************************************************** */ void -XStartChrono(Chrono chrono, Display *display, Drawable window) +ZnXStartChrono(ZnChrono chrono, Display *display, Drawable window) { chrono->current_correction = XCorrectionValue(display, window); chrono->current_delay = XGetCurrentTime(display, window); @@ -154,12 +155,12 @@ XStartChrono(Chrono chrono, Display *display, Drawable window) /* ********************************************************************************** * - * XStopChrono - Stop a perf chrono with X synchronize. + * ZnXStopChrono - Stop a perf chrono with X synchronize. * ********************************************************************************** */ void -XStopChrono(Chrono chrono, Display *display, Drawable window) +ZnXStopChrono(ZnChrono chrono, Display *display, Drawable window) { chrono->total_delay = chrono->total_delay + (XGetCurrentTime(display, window) - @@ -171,12 +172,12 @@ XStopChrono(Chrono chrono, Display *display, Drawable window) /* ********************************************************************************** * - * StartChrono - Start a perf chrono in user time. + * ZnStartChrono - Start a perf chrono in user time. * ********************************************************************************** */ void -StartChrono(Chrono chrono) +ZnStartChrono(ZnChrono chrono) { chrono->current_delay = GetCurrentTime(); } @@ -185,12 +186,12 @@ StartChrono(Chrono chrono) /* ********************************************************************************** * - * StopChrono - Stop a perf chrono in user time. + * ZnStopChrono - Stop a perf chrono in user time. * ********************************************************************************** */ void -StopChrono(Chrono chrono) +ZnStopChrono(ZnChrono chrono) { chrono->total_delay = chrono->total_delay + (GetCurrentTime() - chrono->current_delay); chrono->actions++; @@ -200,12 +201,12 @@ StopChrono(Chrono chrono) /* ********************************************************************************** * - * StartUCChrono - Start a perf chrono in uc time. + * ZnStartUCChrono - Start a perf chrono in uc time. * ********************************************************************************** */ void -StartUCChrono(Chrono chrono) +ZnStartUCChrono(ZnChrono chrono) { chrono->current_delay = GetUCTime(); } @@ -214,12 +215,12 @@ StartUCChrono(Chrono chrono) /* ********************************************************************************** * - * StopUCChrono - Stop a perf chrono in uc time. + * ZnStopUCChrono - Stop a perf chrono in uc time. * ********************************************************************************** */ void -StopUCChrono(Chrono chrono) +ZnStopUCChrono(ZnChrono chrono) { chrono->total_delay = chrono->total_delay + (GetUCTime() - chrono->current_delay); chrono->actions++; @@ -229,19 +230,19 @@ StopUCChrono(Chrono chrono) /* ********************************************************************************** * - * PrintChronos - Print the currently available stats on all + * ZnPrintChronos - Print the currently available stats on all * chronos registered so far. * ********************************************************************************** */ void -PrintChronos(void) +ZnPrintChronos(void) { int i, cnt; - Chrono *chrs; + ZnChrono *chrs; cnt = ZnListSize(Chronos); - chrs = (Chrono *) ZnListArray(Chronos); + chrs = (ZnChrono *) ZnListArray(Chronos); for (i = 0; i < cnt; i++) { if (chrs[i]->actions != 0) { printf("%s : %ld ms on %d times\n", @@ -256,14 +257,14 @@ PrintChronos(void) /* ********************************************************************************** * - * GetChrono - Return the number of runs and the total time of the Chrono. + * ZnGetChrono - Return the number of runs and the total time of the Chrono. * ********************************************************************************** */ void -GetChrono(Chrono chrono, - long *time, - int *actions) +ZnGetChrono(ZnChrono chrono, + long *time, + int *actions) { if (time) { *time = chrono->total_delay*10; @@ -277,15 +278,15 @@ GetChrono(Chrono chrono, /* ********************************************************************************** * - * ResetChronos - Reset all chronos or only the specified. + * ZnResetChronos - Reset all chronos or only the specified. * ********************************************************************************** */ void -ResetChronos(Chrono chrono) +ZnResetChronos(ZnChrono chrono) { int i, cnt; - Chrono *chrs; + ZnChrono *chrs; if (chrono) { chrono->actions = 0; @@ -293,7 +294,7 @@ ResetChronos(Chrono chrono) } else { cnt = ZnListSize(Chronos); - chrs = (Chrono *) ZnListArray(Chronos); + chrs = (ZnChrono *) ZnListArray(Chronos); for (i = 0; i < cnt; i++) { chrs[i]->actions = 0; chrs[i]->total_delay = 0; @@ -305,21 +306,21 @@ ResetChronos(Chrono chrono) /* ********************************************************************************** * - * NewChrono - Return a new initialized chrono associated with + * ZnNewChrono - Return a new initialized chrono associated with * message. * ********************************************************************************** */ -Chrono -NewChrono(char *message) +ZnChrono +ZnNewChrono(char *message) { - Chrono new; + ZnChrono new; if (!Chronos) { - Chronos = ZnListNew(8, sizeof(Chrono)); + Chronos = ZnListNew(8, sizeof(ZnChrono)); } - new = (Chrono) ZnMalloc(sizeof(ChronoRec)); + new = (ZnChrono) ZnMalloc(sizeof(ZnChronoRec)); new->actions = 0; new->total_delay = 0; new->message = message; @@ -332,15 +333,15 @@ NewChrono(char *message) /* ********************************************************************************** * - * FreeChrono - Free the resources of a chrono. + * ZnFreeChrono - Free the resources of a chrono. * ********************************************************************************** */ void -FreeChrono(Chrono chrono) +ZnFreeChrono(ZnChrono chrono) { - int i; - Chrono *chrs = ZnListArray(Chronos); + int i; + ZnChrono *chrs = ZnListArray(Chronos); ZnFree(chrono); @@ -351,3 +352,5 @@ FreeChrono(Chrono chrono) } } } + +#endif /* _WIN32 */ -- cgit v1.1