From 3b3ca4afdcbbab444c81c8aa8085a9c34b71b603 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 17 Dec 2010 15:38:23 +0100 Subject: [PATCH] Use enum for scheduler timeout classes --- sched.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sched.h b/sched.h index d134c86..f8e11a4 100644 --- a/sched.h +++ b/sched.h @@ -35,10 +35,12 @@ typedef unsigned long SCH_TimeoutID; -typedef unsigned long SCH_TimeoutClass; -static const SCH_TimeoutClass SCH_ReservedTimeoutValue = 0; -static const SCH_TimeoutClass SCH_NtpSamplingClass = 1; -static const SCH_TimeoutClass SCH_NtpBroadcastClass = 2; +typedef enum { + SCH_ReservedTimeoutValue = 0, + SCH_NtpSamplingClass, + SCH_NtpBroadcastClass, + SCH_NumberOfClasses /* needs to be last */ +} SCH_TimeoutClass; typedef void* SCH_ArbitraryArgument; typedef void (*SCH_FileHandler)(SCH_ArbitraryArgument);