add const in may places
This commit is contained in:
+29
-25
@@ -398,7 +398,7 @@ static void getOptions(DBADDR *paddr,void **poriginal,long *options,void *pflin)
|
||||
*poriginal = pbuffer;
|
||||
}
|
||||
|
||||
struct rset * epicsShareAPI dbGetRset(struct dbAddr *paddr)
|
||||
struct rset * epicsShareAPI dbGetRset(const struct dbAddr *paddr)
|
||||
{
|
||||
struct dbFldDes *pfldDes = (struct dbFldDes *)paddr->pfldDes;
|
||||
|
||||
@@ -406,7 +406,8 @@ struct rset * epicsShareAPI dbGetRset(struct dbAddr *paddr)
|
||||
return(pfldDes->pdbRecordType->prset);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbPutAttribute(char *recordTypename,char *name,char*value)
|
||||
long epicsShareAPI dbPutAttribute(
|
||||
const char *recordTypename,const char *name,const char*value)
|
||||
{
|
||||
DBENTRY dbEntry;
|
||||
DBENTRY *pdbEntry = &dbEntry;
|
||||
@@ -421,7 +422,7 @@ long epicsShareAPI dbPutAttribute(char *recordTypename,char *name,char*value)
|
||||
return(status);
|
||||
}
|
||||
|
||||
int epicsShareAPI dbIsValueField(struct dbFldDes *pdbFldDes)
|
||||
int epicsShareAPI dbIsValueField(const struct dbFldDes *pdbFldDes)
|
||||
{
|
||||
if(pdbFldDes->pdbRecordType->indvalFlddes == pdbFldDes->indRecordType)
|
||||
return(TRUE);
|
||||
@@ -429,12 +430,12 @@ int epicsShareAPI dbIsValueField(struct dbFldDes *pdbFldDes)
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
int epicsShareAPI dbGetFieldIndex(struct dbAddr *paddr)
|
||||
int epicsShareAPI dbGetFieldIndex(const struct dbAddr *paddr)
|
||||
{
|
||||
return(((struct dbFldDes *)paddr->pfldDes)->indRecordType);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetNelements(struct link *plink,long *nelements)
|
||||
long epicsShareAPI dbGetNelements(const struct link *plink,long *nelements)
|
||||
{
|
||||
switch(plink->type) {
|
||||
case CONSTANT:
|
||||
@@ -453,7 +454,7 @@ long epicsShareAPI dbGetNelements(struct link *plink,long *nelements)
|
||||
return(S_db_badField);
|
||||
}
|
||||
|
||||
int epicsShareAPI dbIsLinkConnected(struct link *plink)
|
||||
int epicsShareAPI dbIsLinkConnected(const struct link *plink)
|
||||
{
|
||||
switch(plink->type) {
|
||||
case DB_LINK: return(TRUE);
|
||||
@@ -463,7 +464,7 @@ int epicsShareAPI dbIsLinkConnected(struct link *plink)
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
int epicsShareAPI dbGetLinkDBFtype(struct link *plink)
|
||||
int epicsShareAPI dbGetLinkDBFtype(const struct link *plink)
|
||||
{
|
||||
switch(plink->type) {
|
||||
case DB_LINK:
|
||||
@@ -756,8 +757,8 @@ int epicsShareAPI dbLoadRecords(char* pfilename, char* substitutions)
|
||||
}
|
||||
|
||||
|
||||
long epicsShareAPI dbGetLinkValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
long *poptions, long *pnRequest)
|
||||
long epicsShareAPI dbGetLinkValue(struct link *plink,
|
||||
short dbrType, void *pbuffer,long *poptions, long *pnRequest)
|
||||
{
|
||||
long status = 0;
|
||||
|
||||
@@ -815,7 +816,7 @@ long epicsShareAPI dbGetLinkValue(struct link *plink, short dbrType, void *pbuff
|
||||
}
|
||||
}else if(plink->type==CA_LINK) {
|
||||
struct dbCommon *precord = plink->value.pv_link.precord;
|
||||
struct pv_link *pcalink = &(plink->value.pv_link);
|
||||
const struct pv_link *pcalink = &(plink->value.pv_link);
|
||||
unsigned short sevr;
|
||||
|
||||
status=dbCaGetLink(plink,dbrType,pbuffer,&sevr,pnRequest);
|
||||
@@ -831,8 +832,8 @@ long epicsShareAPI dbGetLinkValue(struct link *plink, short dbrType, void *pbuff
|
||||
return(status);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbPutLinkValue(struct link *plink,short dbrType,
|
||||
const void *pbuffer,long nRequest)
|
||||
long epicsShareAPI dbPutLinkValue(struct link *plink,
|
||||
short dbrType,const void *pbuffer,long nRequest)
|
||||
{
|
||||
long status=0;
|
||||
|
||||
@@ -868,8 +869,8 @@ long epicsShareAPI dbPutLinkValue(struct link *plink,short dbrType,
|
||||
return(status);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetField( DBADDR *paddr,short dbrType,void *pbuffer,
|
||||
long *options,long *nRequest,void *pflin)
|
||||
long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType,
|
||||
void *pbuffer, long *options,long *nRequest,void *pflin)
|
||||
{
|
||||
short dbfType = paddr->field_type;
|
||||
dbCommon *precord = (dbCommon *)(paddr->precord);
|
||||
@@ -911,8 +912,8 @@ done:
|
||||
return(status);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGet(DBADDR *paddr,short dbrType,void *pbuffer,long *options,
|
||||
long *nRequest,void *pflin)
|
||||
long epicsShareAPI dbGet(DBADDR *paddr,short dbrType,
|
||||
void *pbuffer,long *options,long *nRequest,void *pflin)
|
||||
{
|
||||
db_field_log *pfl= (db_field_log *)pflin;
|
||||
long no_elements=paddr->no_elements;
|
||||
@@ -995,7 +996,8 @@ long epicsShareAPI dbGet(DBADDR *paddr,short dbrType,void *pbuffer,long *options
|
||||
return(status);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbPutField(DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
long epicsShareAPI dbPutField(
|
||||
DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
{
|
||||
long status = 0;
|
||||
long special=paddr->special;
|
||||
@@ -1155,7 +1157,8 @@ long offset;
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbPut(DBADDR *paddr,short dbrType,const void *pbuffer,long nRequest)
|
||||
long epicsShareAPI dbPut(DBADDR *paddr,short dbrType,
|
||||
const void *pbuffer,long nRequest)
|
||||
{
|
||||
long no_elements=paddr->no_elements;
|
||||
long dummy;
|
||||
@@ -1228,7 +1231,7 @@ long epicsShareAPI dbPut(DBADDR *paddr,short dbrType,const void *pbuffer,long nR
|
||||
|
||||
/* various utility routines */
|
||||
long epicsShareAPI dbGetControlLimits(
|
||||
struct link *plink,double *low, double *high)
|
||||
const struct link *plink,double *low, double *high)
|
||||
{
|
||||
struct buffer {
|
||||
DBRctrlDouble
|
||||
@@ -1250,7 +1253,7 @@ long epicsShareAPI dbGetControlLimits(
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetGraphicLimits(
|
||||
struct link *plink,double *low, double *high)
|
||||
const struct link *plink,double *low, double *high)
|
||||
{
|
||||
struct buffer {
|
||||
DBRgrDouble
|
||||
@@ -1271,7 +1274,7 @@ long epicsShareAPI dbGetGraphicLimits(
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetAlarmLimits(struct link *plink,
|
||||
long epicsShareAPI dbGetAlarmLimits(const struct link *plink,
|
||||
double *lolo, double *low, double *high, double *hihi)
|
||||
{
|
||||
struct buffer {
|
||||
@@ -1296,7 +1299,7 @@ long epicsShareAPI dbGetAlarmLimits(struct link *plink,
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetPrecision(struct link *plink,short *precision)
|
||||
long epicsShareAPI dbGetPrecision(const struct link *plink,short *precision)
|
||||
{
|
||||
struct buffer {
|
||||
DBRprecision
|
||||
@@ -1316,7 +1319,8 @@ long epicsShareAPI dbGetPrecision(struct link *plink,short *precision)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
long epicsShareAPI dbGetUnits(
|
||||
const struct link *plink,char *units,int unitsSize)
|
||||
{
|
||||
struct buffer {
|
||||
DBRunits
|
||||
@@ -1336,7 +1340,7 @@ long epicsShareAPI dbGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetSevr(struct link *plink,short *severity)
|
||||
long epicsShareAPI dbGetSevr(const struct link *plink,short *severity)
|
||||
{
|
||||
DBADDR *paddr;
|
||||
|
||||
@@ -1347,7 +1351,7 @@ long epicsShareAPI dbGetSevr(struct link *plink,short *severity)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbGetTimeStamp(struct link *plink,epicsTimeStamp *pstamp)
|
||||
long epicsShareAPI dbGetTimeStamp(const struct link *plink,epicsTimeStamp *pstamp)
|
||||
{
|
||||
DBADDR *paddr;
|
||||
|
||||
|
||||
+14
-14
@@ -217,15 +217,15 @@ struct dbr_alDouble {DBRalDouble};
|
||||
: (((DBADDR*)((PLNK)->value.pv_link.pvt))) \
|
||||
)
|
||||
|
||||
epicsShareFunc struct rset * epicsShareAPI dbGetRset(struct dbAddr *paddr);
|
||||
epicsShareFunc struct rset * epicsShareAPI dbGetRset(const struct dbAddr *paddr);
|
||||
epicsShareFunc long epicsShareAPI dbPutAttribute(
|
||||
char *recordTypename,char *name,char*value);
|
||||
epicsShareFunc int epicsShareAPI dbIsValueField(struct dbFldDes *pdbFldDes);
|
||||
epicsShareFunc int epicsShareAPI dbGetFieldIndex(struct dbAddr *paddr);
|
||||
const char *recordTypename,const char *name,const char*value);
|
||||
epicsShareFunc int epicsShareAPI dbIsValueField(const struct dbFldDes *pdbFldDes);
|
||||
epicsShareFunc int epicsShareAPI dbGetFieldIndex(const struct dbAddr *paddr);
|
||||
epicsShareFunc long epicsShareAPI dbGetNelements(
|
||||
struct link *plink,long *nelements);
|
||||
epicsShareFunc int epicsShareAPI dbIsLinkConnected(struct link *plink);
|
||||
epicsShareFunc int epicsShareAPI dbGetLinkDBFtype(struct link *plink);
|
||||
const struct link *plink,long *nelements);
|
||||
epicsShareFunc int epicsShareAPI dbIsLinkConnected(const struct link *plink);
|
||||
epicsShareFunc int epicsShareAPI dbGetLinkDBFtype(const struct link *plink);
|
||||
epicsShareFunc long epicsShareAPI dbScanLink(
|
||||
struct dbCommon *pfrom, struct dbCommon *pto);
|
||||
epicsShareFunc long epicsShareAPI dbScanPassive(
|
||||
@@ -251,19 +251,19 @@ epicsShareFunc long epicsShareAPI dbPut(
|
||||
|
||||
/* various utility routines */
|
||||
epicsShareFunc long epicsShareAPI dbGetControlLimits(
|
||||
struct link *plink,double *low, double *high);
|
||||
const struct link *plink,double *low, double *high);
|
||||
epicsShareFunc long epicsShareAPI dbGetGraphicLimits(
|
||||
struct link *plink,double *low, double *high);
|
||||
const struct link *plink,double *low, double *high);
|
||||
epicsShareFunc long epicsShareAPI dbGetAlarmLimits(
|
||||
struct link *plink,double *lolo, double *low, double *high, double *hihi);
|
||||
const struct link *plink,double *lolo, double *low, double *high, double *hihi);
|
||||
epicsShareFunc long epicsShareAPI dbGetPrecision(
|
||||
struct link *plink,short *precision);
|
||||
const struct link *plink,short *precision);
|
||||
epicsShareFunc long epicsShareAPI dbGetUnits(
|
||||
struct link *plink,char *units,int unitsSize);
|
||||
const struct link *plink,char *units,int unitsSize);
|
||||
epicsShareFunc long epicsShareAPI dbGetSevr(
|
||||
struct link *plink,short *severity);
|
||||
const struct link *plink,short *severity);
|
||||
epicsShareFunc long epicsShareAPI dbGetTimeStamp(
|
||||
struct link *plink,epicsTimeStamp *pstamp);
|
||||
const struct link *plink,epicsTimeStamp *pstamp);
|
||||
|
||||
typedef void(*SPC_ASCALLBACK)(struct dbCommon *);
|
||||
/*dbSpcAsRegisterCallback called by access security */
|
||||
|
||||
+23
-13
@@ -246,7 +246,7 @@ long epicsShareAPI dbCaPutLink(struct link *plink,short dbrType,
|
||||
return(status);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetAttributes(struct link *plink,
|
||||
long epicsShareAPI dbCaGetAttributes(const struct link *plink,
|
||||
void (*callback)(void *usrPvt),void *usrPvt)
|
||||
{
|
||||
caLink *pca;
|
||||
@@ -280,7 +280,7 @@ long epicsShareAPI dbCaGetAttributes(struct link *plink,
|
||||
return(status);
|
||||
}
|
||||
|
||||
caAttributes *getpcaAttributes(struct link *plink)
|
||||
caAttributes *getpcaAttributes(const struct link *plink)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -290,7 +290,8 @@ caAttributes *getpcaAttributes(struct link *plink)
|
||||
return(pca->pcaAttributes);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetControlLimits(struct link *plink,double *low, double *high)
|
||||
long epicsShareAPI dbCaGetControlLimits(
|
||||
const struct link *plink,double *low, double *high)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -301,7 +302,8 @@ long epicsShareAPI dbCaGetControlLimits(struct link *plink,double *low, double *
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetGraphicLimits(struct link *plink,double *low, double *high)
|
||||
long epicsShareAPI dbCaGetGraphicLimits(
|
||||
const struct link *plink,double *low, double *high)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -312,8 +314,9 @@ long epicsShareAPI dbCaGetGraphicLimits(struct link *plink,double *low, double *
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetAlarmLimits(struct link *plink,
|
||||
double *lolo, double *low, double *high, double *hihi)
|
||||
long epicsShareAPI dbCaGetAlarmLimits(
|
||||
const struct link *plink,
|
||||
double *lolo, double *low, double *high, double *hihi)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -326,7 +329,8 @@ long epicsShareAPI dbCaGetAlarmLimits(struct link *plink,
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetPrecision(struct link *plink,short *precision)
|
||||
long epicsShareAPI dbCaGetPrecision(
|
||||
const struct link *plink,short *precision)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -336,7 +340,8 @@ long epicsShareAPI dbCaGetPrecision(struct link *plink,short *precision)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
long epicsShareAPI dbCaGetUnits(
|
||||
const struct link *plink,char *units,int unitsSize)
|
||||
{
|
||||
caAttributes *pcaAttributes;
|
||||
|
||||
@@ -347,7 +352,8 @@ long epicsShareAPI dbCaGetUnits(struct link *plink,char *units,int unitsSize)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetNelements(struct link *plink,long *nelements)
|
||||
long epicsShareAPI dbCaGetNelements(
|
||||
const struct link *plink,long *nelements)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -359,7 +365,8 @@ long epicsShareAPI dbCaGetNelements(struct link *plink,long *nelements)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetSevr(struct link *plink,short *severity)
|
||||
long epicsShareAPI dbCaGetSevr(
|
||||
const struct link *plink,short *severity)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -371,7 +378,8 @@ long epicsShareAPI dbCaGetSevr(struct link *plink,short *severity)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbCaGetTimeStamp(struct link *plink,epicsTimeStamp *pstamp)
|
||||
long epicsShareAPI dbCaGetTimeStamp(
|
||||
const struct link *plink,epicsTimeStamp *pstamp)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -383,7 +391,8 @@ long epicsShareAPI dbCaGetTimeStamp(struct link *plink,epicsTimeStamp *pstamp)
|
||||
return(0);
|
||||
}
|
||||
|
||||
int epicsShareAPI dbCaIsLinkConnected(struct link *plink)
|
||||
int epicsShareAPI dbCaIsLinkConnected(
|
||||
const struct link *plink)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
@@ -395,7 +404,8 @@ int epicsShareAPI dbCaIsLinkConnected(struct link *plink)
|
||||
if(ca_state(pca->chid)==cs_conn) return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
int epicsShareAPI dbCaGetLinkDBFtype(struct link *plink)
|
||||
int epicsShareAPI dbCaGetLinkDBFtype(
|
||||
const struct link *plink)
|
||||
{
|
||||
caLink *pca;
|
||||
|
||||
|
||||
+11
-11
@@ -24,24 +24,24 @@ epicsShareFunc long epicsShareAPI dbCaGetLink(
|
||||
epicsShareFunc long epicsShareAPI dbCaPutLink(
|
||||
struct link *plink,short dbrType,const void *pbuffer,long nRequest);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetAttributes(
|
||||
struct link *plink,void (*callback)(void *usrPvt),void *usrPvt);
|
||||
const struct link *plink,void (*callback)(void *usrPvt),void *usrPvt);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetControlLimits(
|
||||
struct link *plink,double *low, double *high);
|
||||
const struct link *plink,double *low, double *high);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetGraphicLimits(
|
||||
struct link *plink,double *low, double *high);
|
||||
const struct link *plink,double *low, double *high);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetAlarmLimits(
|
||||
struct link *plink,double *lolo, double *low, double *high, double *hihi);
|
||||
const struct link *plink,double *lolo, double *low, double *high, double *hihi);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetPrecision(
|
||||
struct link *plink,short *precision);
|
||||
const struct link *plink,short *precision);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetUnits(
|
||||
struct link *plink,char *units,int unitsSize);
|
||||
const struct link *plink,char *units,int unitsSize);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetNelements(
|
||||
struct link *plink,long *nelements);
|
||||
const struct link *plink,long *nelements);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetSevr(
|
||||
struct link *plink,short *severity);
|
||||
const struct link *plink,short *severity);
|
||||
epicsShareFunc long epicsShareAPI dbCaGetTimeStamp(
|
||||
struct link *plink,epicsTimeStamp *pstamp);
|
||||
epicsShareFunc int epicsShareAPI dbCaIsLinkConnected(struct link *plink);
|
||||
epicsShareFunc int epicsShareAPI dbCaGetLinkDBFtype(struct link *plink);
|
||||
const struct link *plink,epicsTimeStamp *pstamp);
|
||||
epicsShareFunc int epicsShareAPI dbCaIsLinkConnected(const struct link *plink);
|
||||
epicsShareFunc int epicsShareAPI dbCaGetLinkDBFtype(const struct link *plink);
|
||||
|
||||
#endif /*INCdbCah*/
|
||||
|
||||
+1
-1
@@ -350,7 +350,7 @@ long epicsShareAPI dbpr(char *pname,int interest_level)
|
||||
int tab_size;
|
||||
|
||||
if (pname == NULL)
|
||||
return;
|
||||
return(0);
|
||||
pmsg = pMsgBuff->message;
|
||||
tab_size = 20;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user