From 73532aa78c8cdc4a2ed87cbcd6a9dd0a1ff49e05 Mon Sep 17 00:00:00 2001 From: David Xu Date: Sat, 9 Jan 2010 06:30:40 +0000 Subject: [PATCH] Use enum to define key types. Suggested by: jmallett --- sys/kern/kern_umtx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 3f0f8cf56362..8466a0809ecd 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -58,14 +58,16 @@ __FBSDID("$FreeBSD$"); #include #endif -#define TYPE_SIMPLE_WAIT 0 -#define TYPE_CV (TYPE_SIMPLE_WAIT+1) -#define TYPE_SEM (TYPE_CV+1) -#define TYPE_SIMPLE_LOCK (TYPE_SEM+1) -#define TYPE_NORMAL_UMUTEX (TYPE_SIMPLE_LOCK+1) -#define TYPE_PI_UMUTEX (TYPE_NORMAL_UMUTEX+1) -#define TYPE_PP_UMUTEX (TYPE_PI_UMUTEX+1) -#define TYPE_RWLOCK (TYPE_PP_UMUTEX+1) +enum { + TYPE_SIMPLE_WAIT, + TYPE_CV, + TYPE_SEM, + TYPE_SIMPLE_LOCK, + TYPE_NORMAL_UMUTEX, + TYPE_PI_UMUTEX, + TYPE_PP_UMUTEX, + TYPE_RWLOCK +}; #define _UMUTEX_TRY 1 #define _UMUTEX_WAIT 2