Cleanup, remove some unnecessary casting.
This commit is contained in:
@@ -121,7 +121,7 @@ static void get_enum_strs(DBADDR *paddr, char **ppbuffer,
|
||||
struct rset *prset,long *options)
|
||||
{
|
||||
short field_type=paddr->field_type;
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbMenu *pdbMenu;
|
||||
dbDeviceMenu *pdbDeviceMenu;
|
||||
char **papChoice;
|
||||
@@ -370,7 +370,7 @@ static void getOptions(DBADDR *paddr,char **poriginal,long *options,void *pflin)
|
||||
|
||||
struct rset * epicsShareAPI dbGetRset(const struct dbAddr *paddr)
|
||||
{
|
||||
struct dbFldDes *pfldDes = (struct dbFldDes *)paddr->pfldDes;
|
||||
struct dbFldDes *pfldDes = paddr->pfldDes;
|
||||
|
||||
if(!pfldDes) return(0);
|
||||
return(pfldDes->pdbRecordType->prset);
|
||||
@@ -402,7 +402,7 @@ int epicsShareAPI dbIsValueField(const struct dbFldDes *pdbFldDes)
|
||||
|
||||
int epicsShareAPI dbGetFieldIndex(const struct dbAddr *paddr)
|
||||
{
|
||||
return(((struct dbFldDes *)paddr->pfldDes)->indRecordType);
|
||||
return paddr->pfldDes->indRecordType;
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetNelements(const struct link *plink,long *nelements)
|
||||
@@ -654,11 +654,11 @@ long epicsShareAPI dbNameToAddr(const char *pname,DBADDR *paddr)
|
||||
paddr->pfield = dbEntry.pfield;
|
||||
pflddes = dbEntry.pflddes;
|
||||
dbFinishEntry(&dbEntry);
|
||||
paddr->pfldDes = (void *)pflddes;
|
||||
paddr->field_type = pflddes->field_type;
|
||||
paddr->pfldDes = pflddes;
|
||||
paddr->field_type = pflddes->field_type;
|
||||
paddr->dbr_field_type = mapDBFToDBR[pflddes->field_type];
|
||||
paddr->field_size = pflddes->size;
|
||||
paddr->special = pflddes->special;
|
||||
paddr->field_size = pflddes->size;
|
||||
paddr->special = pflddes->special;
|
||||
|
||||
/*if special is SPC_DBADDR then call cvt_dbaddr */
|
||||
/*it may change pfield,no_elements,field_type,dbr_field_type,*/
|
||||
@@ -899,7 +899,7 @@ long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType,
|
||||
dbScanLock(precord);
|
||||
if(dbfType>=DBF_INLINK && dbfType<=DBF_FWDLINK) {
|
||||
DBENTRY dbEntry;
|
||||
dbFldDes *pfldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pfldDes = paddr->pfldDes;
|
||||
char *rtnString;
|
||||
char *pbuf = (char *)pbuffer;
|
||||
|
||||
@@ -1039,7 +1039,7 @@ static long dbPutFieldLink(
|
||||
DBLINK *plink = (DBLINK *)paddr->pfield;
|
||||
const char *pstring = (const char *)pbuffer;
|
||||
DBENTRY dbEntry;
|
||||
dbFldDes *pfldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pfldDes = paddr->pfldDes;
|
||||
DBADDR dbaddr;
|
||||
devSup *pdevSup = NULL;
|
||||
struct dset *new_dset = NULL;
|
||||
@@ -1220,10 +1220,10 @@ long epicsShareAPI dbPutField(
|
||||
DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
{
|
||||
long status = 0;
|
||||
long special=paddr->special;
|
||||
dbFldDes *pfldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
dbCommon *precord = (dbCommon *)(paddr->precord);
|
||||
short dbfType = paddr->field_type;
|
||||
long special = paddr->special;
|
||||
dbFldDes *pfldDes = paddr->pfldDes;
|
||||
dbCommon *precord = paddr->precord;
|
||||
short dbfType = paddr->field_type;
|
||||
|
||||
if(special==SPC_ATTRIBUTE)
|
||||
return S_db_noMod;
|
||||
@@ -1347,7 +1347,7 @@ long epicsShareAPI dbPut(DBADDR *paddr,short dbrType,
|
||||
}
|
||||
/* propagate events for this field */
|
||||
/* if the field is VAL and pvlMask&pvlOptPP is true dont propagate*/
|
||||
pfldDes = (dbFldDes *)(paddr->pfldDes);
|
||||
pfldDes = paddr->pfldDes;
|
||||
isValueField = dbIsValueField(pfldDes);
|
||||
if (isValueField) precord->udf=FALSE;
|
||||
if(precord->mlis.count &&
|
||||
|
||||
@@ -1,36 +1,33 @@
|
||||
/*************************************************************************\
|
||||
* 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
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#ifndef dbAddrh
|
||||
#define dbAddrh
|
||||
|
||||
#ifdef __cplusplus
|
||||
struct dbCommon;
|
||||
#endif
|
||||
struct dbCommon;
|
||||
struct dbFldDes;
|
||||
|
||||
typedef struct dbAddr{
|
||||
struct dbCommon *precord;/* address of record */
|
||||
void *pfield; /* address of field */
|
||||
void *pfldDes; /* address of struct fldDes */
|
||||
void *asPvt; /* Access Security Private */
|
||||
long no_elements; /* number of elements (arrays) */
|
||||
short field_type; /* type of database field */
|
||||
short field_size; /* size (bytes) of the field being accessed */
|
||||
short special; /* special processing */
|
||||
short dbr_field_type; /* field type as seen by database request*/
|
||||
/*DBR_STRING,...,DBR_ENUM,DBR_NOACCESS*/
|
||||
}dbAddr;
|
||||
typedef struct dbAddr {
|
||||
struct dbCommon *precord; /* address of record */
|
||||
void *pfield; /* address of field */
|
||||
struct dbFldDes *pfldDes; /* address of struct fldDes */
|
||||
long no_elements; /* number of elements (arrays) */
|
||||
short field_type; /* type of database field */
|
||||
short field_size; /* size of the field being accessed */
|
||||
short special; /* special processing */
|
||||
short dbr_field_type; /* field type as seen by database request*/
|
||||
/* DBR_STRING,...,DBR_ENUM,DBR_NOACCESS */
|
||||
} dbAddr;
|
||||
|
||||
typedef dbAddr DBADDR;
|
||||
|
||||
unsigned dbNameOfPV ( const dbAddr * paddr, char * pBuf, unsigned bufLen );
|
||||
unsigned dbNameSizeOfPV ( const dbAddr * paddr );
|
||||
unsigned dbNameOfPV (const dbAddr * paddr, char * pBuf, unsigned bufLen);
|
||||
unsigned dbNameSizeOfPV (const dbAddr * paddr);
|
||||
|
||||
#endif /* dbAddrh */
|
||||
|
||||
661
src/db/dbCa.c
661
src/db/dbCa.c
File diff suppressed because it is too large
Load Diff
@@ -2126,8 +2126,8 @@ static long getEnumEnum(
|
||||
static long getMenuString(DBADDR *paddr, void *pto,
|
||||
long nRequest, long no_elements, long offset)
|
||||
{
|
||||
char *pbuffer = (char *)pto;
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
char *pbuffer = (char *)pto;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbMenu *pdbMenu;
|
||||
char **papChoiceValue;
|
||||
char *pchoice;
|
||||
@@ -2152,8 +2152,8 @@ static long getMenuString(DBADDR *paddr, void *pto,
|
||||
static long getDeviceString(DBADDR *paddr, void *pto,
|
||||
long nRequest, long no_elements, long offset)
|
||||
{
|
||||
char *pbuffer = (char *)pto;
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
char *pbuffer = (char *)pto;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbDeviceMenu *pdbDeviceMenu;
|
||||
char **papChoice;
|
||||
char *pchoice;
|
||||
@@ -2499,7 +2499,7 @@ static long putStringMenu(
|
||||
DBADDR *paddr,const void *pfrom,long nRequest,long no_elements,long offset)
|
||||
{
|
||||
const char *pbuffer = (const char *)pfrom;
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbMenu *pdbMenu;
|
||||
char **papChoiceValue;
|
||||
char *pchoice;
|
||||
@@ -2536,7 +2536,7 @@ static long putStringDevice(
|
||||
DBADDR *paddr,const void *pfrom,long nRequest,long no_elements,long offset)
|
||||
{
|
||||
const char *pbuffer = (const char *)pfrom;
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbDeviceMenu *pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt;
|
||||
char **papChoice;
|
||||
char *pchoice;
|
||||
|
||||
@@ -299,7 +299,7 @@ static long cvt_st_menu(
|
||||
epicsEnum16 *to,
|
||||
struct dbAddr *paddr)
|
||||
{
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbMenu *pdbMenu = (dbMenu *)pdbFldDes->ftPvt;
|
||||
char **papChoiceValue;
|
||||
char *pchoice;
|
||||
@@ -331,7 +331,7 @@ static long cvt_st_device(
|
||||
epicsEnum16 *to,
|
||||
struct dbAddr *paddr)
|
||||
{
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
dbDeviceMenu *pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt;
|
||||
char **papChoice;
|
||||
char *pchoice;
|
||||
@@ -1043,7 +1043,7 @@ static long cvt_menu_st(
|
||||
char *pchoice;
|
||||
|
||||
if(! paddr
|
||||
|| !(pdbFldDes = (dbFldDes *)paddr->pfldDes)
|
||||
|| !(pdbFldDes = paddr->pfldDes)
|
||||
|| !(pdbMenu = (dbMenu *)pdbFldDes->ftPvt)
|
||||
|| *from>=pdbMenu->nChoice
|
||||
|| !(papChoiceValue = pdbMenu->papChoiceValue)
|
||||
@@ -1068,7 +1068,7 @@ static long cvt_device_st(
|
||||
char *pchoice;
|
||||
|
||||
if(!paddr
|
||||
|| !(pdbFldDes = (dbFldDes *)paddr->pfldDes)
|
||||
|| !(pdbFldDes = paddr->pfldDes)
|
||||
|| !(pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt)
|
||||
|| *from>=pdbDeviceMenu->nChoice
|
||||
|| !(papChoice= pdbDeviceMenu->papChoice)
|
||||
|
||||
@@ -201,7 +201,7 @@ STATIC void callUser(dbCommon *precord,putNotify *ppn)
|
||||
STATIC void putNotifyCommon(putNotify *ppn,dbCommon *precord)
|
||||
{
|
||||
long status=0;
|
||||
dbFldDes *pfldDes=(dbFldDes *)(ppn->paddr->pfldDes);
|
||||
dbFldDes *pfldDes = ppn->paddr->pfldDes;
|
||||
putNotifyPvt *pputNotifyPvt = (putNotifyPvt *)ppn->pputNotifyPvt;
|
||||
|
||||
if(precord->ppn && pputNotifyPvt->state!=putNotifyRestartCallbackRequested)
|
||||
|
||||
@@ -622,7 +622,7 @@ static void printDbAddr(DBADDR *paddr)
|
||||
{
|
||||
short field_type;
|
||||
short dbr_field_type;
|
||||
dbFldDes *pdbFldDes = (dbFldDes *)paddr->pfldDes;;
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
|
||||
printf("Record Address: %p",(void *)paddr->precord);
|
||||
printf(" Field Address: %p",paddr->pfield);
|
||||
|
||||
@@ -87,12 +87,12 @@ void epicsShareAPI recGblRecSupError(long status, struct dbAddr *paddr,
|
||||
const char *pmessage, const char *psupport_name)
|
||||
{
|
||||
dbCommon *precord = 0;
|
||||
dbFldDes *pdbFldDes = 0;
|
||||
dbRecordType *pdbRecordType = 0;
|
||||
dbFldDes *pdbFldDes = 0;
|
||||
dbRecordType *pdbRecordType = 0;
|
||||
|
||||
if(paddr) {
|
||||
precord = paddr->precord;
|
||||
pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
pdbFldDes = paddr->pfldDes;
|
||||
if(pdbFldDes) pdbRecordType = pdbFldDes->pdbRecordType;
|
||||
}
|
||||
errPrintf(status,0,0,
|
||||
@@ -110,7 +110,7 @@ void epicsShareAPI recGblRecSupError(long status, struct dbAddr *paddr,
|
||||
|
||||
void epicsShareAPI recGblGetPrec(struct dbAddr *paddr,long *precision)
|
||||
{
|
||||
dbFldDes *pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
|
||||
switch(pdbFldDes->field_type){
|
||||
case(DBF_SHORT):
|
||||
@@ -138,7 +138,7 @@ void epicsShareAPI recGblGetPrec(struct dbAddr *paddr,long *precision)
|
||||
void epicsShareAPI recGblGetGraphicDouble(
|
||||
struct dbAddr *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
dbFldDes *pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
dbFldDes *pdbFldDes = paddr->pfldDes;
|
||||
|
||||
getMaxRangeValues(pdbFldDes->field_type,&pgd->upper_disp_limit,
|
||||
&pgd->lower_disp_limit);
|
||||
@@ -160,7 +160,7 @@ void epicsShareAPI recGblGetAlarmDouble(
|
||||
void epicsShareAPI recGblGetControlDouble(
|
||||
struct dbAddr *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
dbFldDes *pdbFldDes=(dbFldDes *)(paddr->pfldDes);
|
||||
dbFldDes *pdbFldDes=paddr->pfldDes;
|
||||
|
||||
getMaxRangeValues(pdbFldDes->field_type,&pcd->upper_ctrl_limit,
|
||||
&pcd->lower_ctrl_limit);
|
||||
|
||||
@@ -72,9 +72,11 @@ struct macro_link {
|
||||
char *macroStr;
|
||||
};
|
||||
|
||||
struct dbCommon;
|
||||
|
||||
struct pv_link {
|
||||
char *pvname; /*pvname to link to*/
|
||||
void *precord; /*Address of record containing link*/
|
||||
struct dbCommon *precord; /*Address of record containing link*/
|
||||
void *pvt; /*CA or DB private*/
|
||||
LINKCVT getCvt; /*input conversion function*/
|
||||
short pvlMask; /*Options mask*/
|
||||
|
||||
Reference in New Issue
Block a user