From 499a3a7c4772bb0f446f89a9c6e9430bd31c1218 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 5 Sep 2006 22:50:25 -0700 Subject: [PATCH] perf: Remove unused alarm functions --- perf/cairo-perf-timer-posix.c | 29 ----------------------------- perf/cairo-perf-timer-win32.c | 20 -------------------- perf/cairo-perf-timer.h | 10 ---------- perf/cairo-perf.c | 2 -- perf/cairo-perf.h | 2 -- 5 files changed, 63 deletions(-) diff --git a/perf/cairo-perf-timer-posix.c b/perf/cairo-perf-timer-posix.c index 7c7ec19b2..685d7e5a0 100644 --- a/perf/cairo-perf-timer-posix.c +++ b/perf/cairo-perf-timer-posix.c @@ -64,35 +64,6 @@ timer_elapsed (void) { return d; } -/* alarms */ - -void -alarm_handler (int signal) { - if (signal == SIGALRM) { - cairo_perf_alarm_expired = 1; - } -} - -void -set_alarm (double seconds) { - struct itimerval tr; - long sec, usec; - - cairo_perf_alarm_expired = 0; - signal (SIGALRM, alarm_handler); - - sec = floor (seconds); - seconds -= sec; - usec = seconds * 1e6; - - tr.it_interval.tv_sec = 0; - tr.it_interval.tv_usec = 0; - tr.it_value.tv_sec = sec; - tr.it_value.tv_usec = usec; - - setitimer (ITIMER_REAL, &tr, NULL); -} - /* yield */ void diff --git a/perf/cairo-perf-timer-win32.c b/perf/cairo-perf-timer-win32.c index 679abca3f..f0caa73a4 100644 --- a/perf/cairo-perf-timer-win32.c +++ b/perf/cairo-perf-timer-win32.c @@ -63,26 +63,6 @@ timer_elapsed (void) { return d; } -/* alarms */ - -void CALLBACK -alarm_handler (void *closure, DWORD dwTimerLowValue, DWORD dwTimerHighValue) { - cairo_perf_alarm_expired = 1; -} - -HANDLE hTimer = NULL; -void -set_alarm (double seconds) { - if (hTimer == NULL) - hTimer = CreateWaitableTimer(NULL, TRUE, NULL); - cairo_perf_alarm_expired = 0; - - LARGE_INTEGER expTime; - expTime.QuadPart = - (seconds * 10000000); - if (!SetWaitableTimer (hTimer, &expTime, 0, alarm_handler, &cairo_perf_alarm_expired, FALSE)) - fprintf (stderr, "SetWaitableTimer failed!\n"); -} - /* yield */ void diff --git a/perf/cairo-perf-timer.h b/perf/cairo-perf-timer.h index b03ddce61..fbe67a37b 100644 --- a/perf/cairo-perf-timer.h +++ b/perf/cairo-perf-timer.h @@ -34,8 +34,6 @@ typedef struct _cairo_perf_timer_t cairo_perf_timer_t; /* timers */ -extern int alarm_expired; - void timer_start (void); @@ -45,14 +43,6 @@ timer_stop (void); double timer_elapsed (void); -/* alarms */ - -void -alarm_handler (int signal); - -void -set_alarm (double seconds); - /* yield */ void diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index 32d96d3f1..9e51791d6 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -29,8 +29,6 @@ int cairo_perf_iterations = 100; -int cairo_perf_alarm_expired = 0; - typedef struct _cairo_perf { const char *name; cairo_perf_func_t run; diff --git a/perf/cairo-perf.h b/perf/cairo-perf.h index 7d7328aae..d9e5ad83f 100644 --- a/perf/cairo-perf.h +++ b/perf/cairo-perf.h @@ -32,8 +32,6 @@ #include "cairo-perf-timer.h" -extern int cairo_perf_alarm_expired; - typedef double (*cairo_perf_func_t) (cairo_t *cr, int width, int height); #define CAIRO_PERF_DECL(func) double func (cairo_t *cr, int width, int height)