Use menuScan enums rather than #define macros where possible.

This commit is contained in:
Andrew Johnson
2008-09-05 15:17:45 +00:00
parent 9e5c6e04b7
commit f89d5e4400
4 changed files with 28 additions and 28 deletions

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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")