From f89d5e4400ac453f2a256f79b4e830a4770af7a0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 5 Sep 2008 15:17:45 +0000 Subject: [PATCH] Use menuScan enums rather than #define macros where possible. --- src/db/dbAccess.c | 6 +++--- src/db/dbScan.c | 30 +++++++++++++++--------------- src/db/dbScan.h | 12 ++++++------ src/db/menuScan.dbd | 8 ++++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/db/dbAccess.c b/src/db/dbAccess.c index d6de0c2b4..1646df005 100644 --- a/src/db/dbAccess.c +++ b/src/db/dbAccess.c @@ -1089,9 +1089,9 @@ static long dbPutFieldLink( } scan = precord->scan; - if (inpOut && (scan==SCAN_IO_EVENT)) { + if (inpOut && (scan==menuScanI_O_Intr)) { scanDelete(precord); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; } switch (plink->type) { /* Old link type */ @@ -1203,7 +1203,7 @@ static long dbPutFieldLink( db_post_events(precord,plink,DBE_VALUE|DBE_LOG); restoreScan: - if (inpOut && (scan==SCAN_IO_EVENT)) { /* undo scanDelete() */ + if (inpOut && (scan==menuScanI_O_Intr)) { /* undo scanDelete() */ precord->scan = scan; scanAdd(precord); } diff --git a/src/db/dbScan.c b/src/db/dbScan.c index dd8be9c57..695891985 100644 --- a/src/db/dbScan.c +++ b/src/db/dbScan.c @@ -193,11 +193,11 @@ void scanAdd(struct dbCommon *precord) /* get the list on which this record belongs */ scan = precord->scan; - if (scan == SCAN_PASSIVE) return; + if (scan == menuScanPassive) return; if (scan < 0 || scan >= nPeriodic + SCAN_1ST_PERIODIC) { recGblRecordError(-1, (void *)precord, "scanAdd detected illegal SCAN value"); - } else if (scan == SCAN_EVENT) { + } else if (scan == menuScanEvent) { int evnt; int prio; event_scan_list *pesl; @@ -206,14 +206,14 @@ void scanAdd(struct dbCommon *precord) if (evnt < 0 || evnt >= MAX_EVENTS) { recGblRecordError(S_db_badField, (void *)precord, "scanAdd detected illegal EVNT value"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } prio = precord->prio; if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) { recGblRecordError(-1, (void *)precord, "scanAdd: illegal prio field"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } pesl = pevent_list[prio][evnt]; @@ -227,7 +227,7 @@ void scanAdd(struct dbCommon *precord) ellInit(&pesl->scan_list.list); } addToList(precord, &pesl->scan_list); - } else if (scan == SCAN_IO_EVENT) { + } else if (scan == menuScanI_O_Intr) { io_scan_list *piosl = NULL; int prio; DEVSUPFUN get_ioint_info; @@ -235,31 +235,31 @@ void scanAdd(struct dbCommon *precord) if (precord->dset == NULL){ recGblRecordError(-1, (void *)precord, "scanAdd: I/O Intr not valid (no DSET) "); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } get_ioint_info = precord->dset->get_ioint_info; if (get_ioint_info == NULL) { recGblRecordError(-1, (void *)precord, "scanAdd: I/O Intr not valid (no get_ioint_info)"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } if (get_ioint_info(0, precord, &piosl)) { - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } if (piosl == NULL) { recGblRecordError(-1, (void *)precord, "scanAdd: I/O Intr not valid"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } prio = precord->prio; if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) { recGblRecordError(-1, (void *)precord, "scanAdd: illegal prio field"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } piosl += prio; /* get piosl for correct priority*/ @@ -276,11 +276,11 @@ void scanDelete(struct dbCommon *precord) /* get the list on which this record belongs */ scan = precord->scan; - if (scan == SCAN_PASSIVE) return; + if (scan == menuScanPassive) return; if (scan < 0 || scan >= nPeriodic + SCAN_1ST_PERIODIC) { recGblRecordError(-1, (void *)precord, "scanDelete detected illegal SCAN value"); - } else if (scan == SCAN_EVENT) { + } else if (scan == menuScanEvent) { int evnt; int prio; event_scan_list *pesl; @@ -290,14 +290,14 @@ void scanDelete(struct dbCommon *precord) if (evnt < 0 || evnt >= MAX_EVENTS) { recGblRecordError(S_db_badField, (void *)precord, "scanAdd detected illegal EVNT value"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } prio = precord->prio; if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) { recGblRecordError(-1, (void *)precord, "scanAdd: illegal prio field"); - precord->scan = SCAN_PASSIVE; + precord->scan = menuScanPassive; return; } pesl = pevent_list[prio][evnt]; @@ -307,7 +307,7 @@ void scanDelete(struct dbCommon *precord) "scanDelete for bad evnt"); else deleteFromList(precord, psl); - } else if (scan == SCAN_IO_EVENT) { + } else if (scan == menuScanI_O_Intr) { io_scan_list *piosl=NULL; int prio; DEVSUPFUN get_ioint_info; diff --git a/src/db/dbScan.h b/src/db/dbScan.h index 03c1a7c3d..7f50d3e8d 100644 --- a/src/db/dbScan.h +++ b/src/db/dbScan.h @@ -15,19 +15,19 @@ #ifndef INCdbScanH #define INCdbScanH +#include "menuScan.h" #include "shareLib.h" #ifdef __cplusplus extern "C" { #endif -/* Note that these must match the first three definitions in choiceGbl.ascii*/ -#define SCAN_PASSIVE 0 -#define SCAN_EVENT 1 -#define SCAN_IO_EVENT 2 -#define SCAN_1ST_PERIODIC 3 +#define SCAN_PASSIVE menuScanPassive +#define SCAN_EVENT menuScanEvent +#define SCAN_IO_EVENT menuScanI_O_Intr +#define SCAN_1ST_PERIODIC (menuScanI_O_Intr + 1) -/*definitions for SCAN_IO_EVENT */ +/*definitions for I/O Interrupt Scanning */ struct io_scan_list; typedef struct io_scan_list *IOSCANPVT; diff --git a/src/db/menuScan.dbd b/src/db/menuScan.dbd index 05bb12e8e..17fedd59b 100644 --- a/src/db/menuScan.dbd +++ b/src/db/menuScan.dbd @@ -1,16 +1,16 @@ #************************************************************************* -# Copyright (c) 2002 The University of Chicago, as Operator of Argonne +# Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne # National Laboratory. # Copyright (c) 2002 The Regents of the University of California, as # Operator of Los Alamos National Laboratory. -# EPICS BASE Versions 3.13.7 -# and higher are distributed subject to a Software License Agreement found -# in file LICENSE that is included with this distribution. +# EPICS BASE is distributed subject to a Software License Agreement found +# in file LICENSE that is included with this distribution. #************************************************************************* menu(menuScan) { choice(menuScanPassive,"Passive") choice(menuScanEvent,"Event") choice(menuScanI_O_Intr,"I/O Intr") + # Periodic scans follow, ordered from slowest to fastest choice(menuScan10_second,"10 second") choice(menuScan5_second,"5 second") choice(menuScan2_second,"2 second")