From fc8319ad1008aad696a40dc7bb249d3da1135924 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 26 Feb 2018 23:01:29 -0800 Subject: [PATCH] Use NUM_TIME_EVENTS instead of hard constants for dbScan.c event code. --- modules/database/src/ioc/db/dbScan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/database/src/ioc/db/dbScan.c b/modules/database/src/ioc/db/dbScan.c index a55300a87..f016f0200 100644 --- a/modules/database/src/ioc/db/dbScan.c +++ b/modules/database/src/ioc/db/dbScan.c @@ -27,6 +27,7 @@ #include "ellLib.h" #include "epicsAtomic.h" #include "epicsEvent.h" +#include "epicsGeneralTime.h" #include "epicsMutex.h" #include "epicsPrint.h" #include "epicsRingBytes.h" @@ -114,7 +115,7 @@ typedef struct event_list { struct event_list *next; char eventname[1]; /* actually arbitrary size */ } event_list; -static event_list * volatile pevent_list[256]; +static event_list * volatile pevent_list[NUM_TIME_EVENTS]; static epicsMutexId event_lock; /* IO_EVENT*/ @@ -546,7 +547,7 @@ void postEvent(event_list *pel) /* backward compatibility */ void post_event(int event) { - if (event <= 0 || event > 255) return; + if (event <= 0 || event >= NUM_TIME_EVENTS) return; postEvent(pevent_list[event]); }