Clean up warnings from gcc 4.6.3
This commit is contained in:
@@ -496,7 +496,7 @@ long dbGetNelements(const struct link *plink, long *nelements)
|
||||
return S_db_badField;
|
||||
}
|
||||
|
||||
long dbGetLinkValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
long dbGetLink(struct link *plink, short dbrType, void *pbuffer,
|
||||
long *poptions, long *pnRequest)
|
||||
{
|
||||
struct dbCommon *precord = plink->value.pv_link.precord;
|
||||
@@ -610,12 +610,15 @@ long dbGetTimeStamp(const struct link *plink, epicsTimeStamp *pstamp)
|
||||
return S_db_notFound;
|
||||
}
|
||||
|
||||
long dbPutLinkValue(struct link *plink, short dbrType, const void *pbuffer,
|
||||
long dbPutLink(struct link *plink, short dbrType, const void *pbuffer,
|
||||
long nRequest)
|
||||
{
|
||||
long status;
|
||||
|
||||
switch (plink->type) {
|
||||
case CONSTANT:
|
||||
status = 0;
|
||||
break;
|
||||
case DB_LINK:
|
||||
status = dbDbPutValue(plink, dbrType, pbuffer, nRequest);
|
||||
break;
|
||||
|
||||
@@ -45,19 +45,6 @@ typedef struct lset {
|
||||
void (*scanFwdLink)(struct link *plink);
|
||||
} lset;
|
||||
|
||||
#define dbGetLink(PLNK, DBRTYPE, PBUFFER, OPTIONS, NREQUEST) \
|
||||
( ( ( (PLNK)->type == CONSTANT ) && \
|
||||
( (NREQUEST) == 0) && \
|
||||
( (OPTIONS) == 0) ) \
|
||||
? 0 \
|
||||
: dbGetLinkValue((PLNK),(DBRTYPE), \
|
||||
(void *)(PBUFFER), (OPTIONS), (NREQUEST) ) )
|
||||
|
||||
#define dbPutLink(PLNK, DBRTYPE, PBUFFER, NREQUEST) \
|
||||
( ( (PLNK)->type == CONSTANT) \
|
||||
? 0 \
|
||||
: dbPutLinkValue( (PLNK), (DBRTYPE), (void *)(PBUFFER), (NREQUEST) ) )
|
||||
|
||||
#define dbGetSevr(PLINK, PSEVERITY) \
|
||||
dbGetAlarm((PLINK), NULL, (PSEVERITY));
|
||||
|
||||
@@ -71,7 +58,7 @@ epicsShareFunc void dbRemoveLink(struct link *plink);
|
||||
epicsShareFunc long dbGetNelements(const struct link *plink, long *nelements);
|
||||
epicsShareFunc int dbIsLinkConnected(const struct link *plink);
|
||||
epicsShareFunc int dbGetLinkDBFtype(const struct link *plink);
|
||||
epicsShareFunc long dbGetLinkValue(struct link *, short dbrType, void *pbuffer,
|
||||
epicsShareFunc long dbGetLink(struct link *, short dbrType, void *pbuffer,
|
||||
long *options, long *nRequest);
|
||||
epicsShareFunc long dbGetControlLimits(const struct link *plink, double *low,
|
||||
double *high);
|
||||
@@ -86,7 +73,7 @@ epicsShareFunc long dbGetAlarm(const struct link *plink, epicsEnum16 *status,
|
||||
epicsEnum16 *severity);
|
||||
epicsShareFunc long dbGetTimeStamp(const struct link *plink,
|
||||
epicsTimeStamp *pstamp);
|
||||
epicsShareFunc long dbPutLinkValue(struct link *, short dbrType,
|
||||
epicsShareFunc long dbPutLink(struct link *, short dbrType,
|
||||
const void *pbuffer, long nRequest);
|
||||
epicsShareFunc void dbScanFwdLink(struct link *plink);
|
||||
|
||||
|
||||
@@ -2277,15 +2277,13 @@ long epicsShareAPI dbPutString(DBENTRY *pdbentry,const char *pstring)
|
||||
short msOpt = 0;
|
||||
char *end;
|
||||
char *enddouble;
|
||||
double tempdouble;
|
||||
char *endlong;
|
||||
long templong;
|
||||
|
||||
/* Check first to see if string is a constant*/
|
||||
/*It is a string if epicsStrtod or strtol eats entire string*/
|
||||
/*leading and trailing blanks have already been stripped*/
|
||||
tempdouble = epicsStrtod(pstr, &enddouble);
|
||||
templong = strtol(pstr, &endlong, 0);
|
||||
(void) epicsStrtod(pstr, &enddouble);
|
||||
(void) strtol(pstr, &endlong, 0);
|
||||
|
||||
if (*enddouble == 0 || *endlong == 0) {
|
||||
if (plink->type == PV_LINK) dbCvtLinkToConstant(pdbentry);
|
||||
@@ -2654,10 +2652,9 @@ char * epicsShareAPI dbVerify(DBENTRY *pdbentry,const char *pstring)
|
||||
}
|
||||
case DBF_FLOAT:
|
||||
case DBF_DOUBLE: {
|
||||
double value;
|
||||
char *endp;
|
||||
|
||||
value = epicsStrtod(pstring,&endp);
|
||||
(void) epicsStrtod(pstring,&endp);
|
||||
if(*endp!=0) {
|
||||
strcpy(message,"not a number");
|
||||
return(message);
|
||||
@@ -3277,7 +3274,6 @@ long epicsShareAPI dbPutForm(DBENTRY *pdbentry,char **value)
|
||||
DBLINK *plink;
|
||||
char **verify;
|
||||
long lvalue;
|
||||
double dvalue;
|
||||
char *endp;
|
||||
long status = 0;
|
||||
|
||||
@@ -3289,7 +3285,7 @@ long epicsShareAPI dbPutForm(DBENTRY *pdbentry,char **value)
|
||||
case FORM_CONSTANT:
|
||||
**verify = 0; /*Initialize to no error*/
|
||||
if(**value == '\0') break;
|
||||
dvalue = epicsStrtod(*value,&endp);
|
||||
(void) epicsStrtod(*value,&endp);
|
||||
if(*endp!=0) {
|
||||
strcpy(*verify,"Illegal. Must be number");
|
||||
break;
|
||||
|
||||
@@ -60,9 +60,9 @@ void Test :: execute ()
|
||||
|
||||
for ( unsigned i = 0; i < 3; i++ ) {
|
||||
double mVal = rand ();
|
||||
mVal /= (RAND_MAX + 1);
|
||||
mVal /= ((double) RAND_MAX + 1);
|
||||
double fEVal = rand ();
|
||||
fEVal /= (RAND_MAX + 1);
|
||||
fEVal /= ((double) RAND_MAX + 1);
|
||||
fEVal *= DBL_MAX_EXP - DBL_MIN_EXP;
|
||||
fEVal += DBL_MIN_EXP;
|
||||
int eVal = static_cast < int > ( fEVal + 0.5 );
|
||||
@@ -72,7 +72,7 @@ void Test :: execute ()
|
||||
_measure ();
|
||||
}
|
||||
_srcVal = rand ();
|
||||
_srcVal /= (RAND_MAX + 1);
|
||||
_srcVal /= ((double) RAND_MAX + 1);
|
||||
_srcVal *= 10.0;
|
||||
_srcVal -= 5.0;
|
||||
for ( _prec = lowPrecision;
|
||||
|
||||
@@ -71,9 +71,8 @@ static long read_event(eventRecord *prec)
|
||||
long status;
|
||||
char newEvent[MAX_STRING_SIZE];
|
||||
|
||||
if (prec->inp.type != CONSTANT)
|
||||
{
|
||||
status = dbGetLinkValue(&prec->inp, DBR_STRING, newEvent, 0, 0);
|
||||
if (prec->inp.type != CONSTANT) {
|
||||
status = dbGetLink(&prec->inp, DBR_STRING, newEvent, 0, 0);
|
||||
if (status) return status;
|
||||
if (strcmp(newEvent, prec->val) != 0) {
|
||||
strcpy(prec->val, newEvent);
|
||||
|
||||
@@ -52,8 +52,6 @@ epicsExportAddress(dset,devHistogramSoft);
|
||||
|
||||
static long init_record(histogramRecord *prec)
|
||||
{
|
||||
long status = 0;
|
||||
|
||||
/* histogram.svl must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/
|
||||
switch (prec->svl.type) {
|
||||
case (CONSTANT) :
|
||||
@@ -69,13 +67,11 @@ static long init_record(histogramRecord *prec)
|
||||
"devHistogramSoft (init_record) Illegal SVL field");
|
||||
return(S_db_badField);
|
||||
}
|
||||
return(status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long read_histogram(histogramRecord *prec)
|
||||
{
|
||||
long status;
|
||||
|
||||
status = dbGetLink(&prec->svl,DBR_DOUBLE, &prec->sgnl,0,0);
|
||||
return(0); /*add count*/
|
||||
dbGetLink(&prec->svl, DBR_DOUBLE, &prec->sgnl, 0, 0);
|
||||
return 0; /*add count*/
|
||||
}
|
||||
|
||||
@@ -48,13 +48,11 @@ epicsExportAddress(dset,devLoSoft);
|
||||
|
||||
static long init_record(longoutRecord *prec)
|
||||
{
|
||||
return(0);
|
||||
return 0;
|
||||
} /* end init_record() */
|
||||
|
||||
static long write_longout(longoutRecord *prec)
|
||||
{
|
||||
long status;
|
||||
|
||||
status = dbPutLink(&prec->out,DBR_LONG, &prec->val,1);
|
||||
return(0);
|
||||
dbPutLink(&prec->out,DBR_LONG, &prec->val,1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,6 @@ static long init_record(mbboDirectRecord *prec)
|
||||
|
||||
static long write_mbbo(mbboDirectRecord *prec)
|
||||
{
|
||||
long status;
|
||||
|
||||
status = dbPutLink(&prec->out,DBR_USHORT,&prec->val,1);
|
||||
return(0);
|
||||
dbPutLink(&prec->out,DBR_USHORT,&prec->val,1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -62,10 +62,9 @@ static long init_record(mbboDirectRecord *prec)
|
||||
|
||||
static long write_mbbo(mbboDirectRecord *prec)
|
||||
{
|
||||
long status;
|
||||
unsigned long data;
|
||||
|
||||
data = prec->rval & prec->mask;
|
||||
status = dbPutLink(&prec->out,DBR_LONG, &data,1);
|
||||
return(0);
|
||||
dbPutLink(&prec->out,DBR_LONG, &data,1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -49,19 +49,13 @@ epicsExportAddress(dset,devMbboSoft);
|
||||
|
||||
static long init_record(mbboRecord *prec)
|
||||
{
|
||||
|
||||
long status=0;
|
||||
|
||||
/*dont convert*/
|
||||
status=2;
|
||||
return status;
|
||||
return 2;
|
||||
|
||||
} /* end init_record() */
|
||||
|
||||
static long write_mbbo(mbboRecord *prec)
|
||||
{
|
||||
long status;
|
||||
|
||||
status = dbPutLink(&prec->out,DBR_USHORT, &prec->val,1);
|
||||
return(0);
|
||||
dbPutLink(&prec->out,DBR_USHORT, &prec->val,1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -48,24 +48,19 @@ epicsExportAddress(dset,devMbboSoftRaw);
|
||||
|
||||
static long init_record(mbboRecord *prec)
|
||||
{
|
||||
|
||||
long status;
|
||||
|
||||
/*to preserve old functionality*/
|
||||
if(prec->nobt == 0) prec->mask = 0xffffffff;
|
||||
if (prec->nobt == 0) prec->mask = 0xffffffff;
|
||||
prec->mask <<= prec->shft;
|
||||
/*dont convert*/
|
||||
status = 2;
|
||||
return status;
|
||||
return 2;
|
||||
|
||||
} /* end init_record() */
|
||||
|
||||
static long write_mbbo(mbboRecord *prec)
|
||||
{
|
||||
long status;
|
||||
unsigned long data;
|
||||
|
||||
data = prec->rval & prec->mask;
|
||||
status = dbPutLink(&prec->out,DBR_LONG, &data,1);
|
||||
return(0);
|
||||
dbPutLink(&prec->out,DBR_LONG, &data,1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,6 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
long end = my->end;
|
||||
long nTarget = 0;
|
||||
long offset = 0;
|
||||
long status;
|
||||
long nSource = chan->addr.no_elements;
|
||||
|
||||
/* Only array data */
|
||||
@@ -108,7 +107,7 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
|
||||
prset->get_array_info) {
|
||||
prec = dbChannelRecord(chan);
|
||||
dbScanLock(prec);
|
||||
status = prset->get_array_info(&chan->addr, &nSource, &offset);
|
||||
prset->get_array_info(&chan->addr, &nSource, &offset);
|
||||
nTarget = wrapArrayIndices(&start, my->incr, &end, nSource);
|
||||
pfl->type = dbfl_type_ref;
|
||||
pfl->stat = prec->stat;
|
||||
|
||||
@@ -89,7 +89,6 @@ static int fl_equals_array(short type, const db_field_log *pfl1, void *p2) {
|
||||
|
||||
static void createAndOpen(const char *chan, const char *json, const char *type, dbChannel**pch, short no) {
|
||||
ELLNODE *node;
|
||||
chFilter *filter;
|
||||
char name[80];
|
||||
|
||||
strncpy(name, chan, sizeof(name)-1);
|
||||
@@ -101,11 +100,11 @@ static void createAndOpen(const char *chan, const char *json, const char *type,
|
||||
testOk(!(dbChannelOpen(*pch)), "dbChannel with plugin arr opened");
|
||||
|
||||
node = ellFirst(&(*pch)->pre_chain);
|
||||
filter = CONTAINER(node, chFilter, pre_node);
|
||||
(void) CONTAINER(node, chFilter, pre_node);
|
||||
testOk((ellCount(&(*pch)->pre_chain) == 0), "arr has no filter in pre chain");
|
||||
|
||||
node = ellFirst(&(*pch)->post_chain);
|
||||
filter = CONTAINER(node, chFilter, post_node);
|
||||
(void) CONTAINER(node, chFilter, post_node);
|
||||
testOk((ellCount(&(*pch)->post_chain) == no),
|
||||
"arr has %d filter(s) in post chain", no);
|
||||
}
|
||||
@@ -120,7 +119,7 @@ static void testHead (const char *title, const char *typ = "") {
|
||||
#define TEST1(Size, Offset, Incr, Text) \
|
||||
testDiag("Offset: %d (%s)", Offset, Text); \
|
||||
off = Offset; \
|
||||
status = dbPutField(&offaddr, DBR_LONG, &off, 1); \
|
||||
(void) dbPutField(&offaddr, DBR_LONG, &off, 1); \
|
||||
pfl = db_create_read_log(pch); \
|
||||
testOk(pfl->type == dbfl_type_rec, "original field log has type rec"); \
|
||||
pfl2 = dbChannelRunPostChain(pch, pfl); \
|
||||
@@ -132,7 +131,6 @@ static void testHead (const char *title, const char *typ = "") {
|
||||
static void check(short dbr_type) {
|
||||
dbChannel *pch;
|
||||
db_field_log *pfl, *pfl2;
|
||||
int status;
|
||||
dbAddr valaddr;
|
||||
dbAddr offaddr;
|
||||
const char *offname = NULL, *valname = NULL, *typname = NULL;
|
||||
@@ -173,10 +171,10 @@ static void check(short dbr_type) {
|
||||
testDiag("Invalid data type %d", dbr_type);
|
||||
}
|
||||
|
||||
status = dbNameToAddr(offname, &offaddr);
|
||||
(void) dbNameToAddr(offname, &offaddr);
|
||||
|
||||
status = dbNameToAddr(valname, &valaddr);
|
||||
status = dbPutField(&valaddr, DBR_LONG, ar, 10);
|
||||
(void) dbNameToAddr(valname, &valaddr);
|
||||
(void) dbPutField(&valaddr, DBR_LONG, ar, 10);
|
||||
|
||||
/* Default: should not change anything */
|
||||
|
||||
|
||||
@@ -576,8 +576,6 @@ static void checkAlarms(calcoutRecord *prec)
|
||||
|
||||
static void execOutput(calcoutRecord *prec)
|
||||
{
|
||||
long status;
|
||||
|
||||
/* Determine output data */
|
||||
switch(prec->dopt) {
|
||||
case calcoutDOPT_Use_VAL:
|
||||
@@ -598,12 +596,12 @@ static void execOutput(calcoutRecord *prec)
|
||||
/* Check to see what to do if INVALID */
|
||||
if (prec->nsev < INVALID_ALARM ) {
|
||||
/* Output the value */
|
||||
status = writeValue(prec);
|
||||
writeValue(prec);
|
||||
/* post output event if set */
|
||||
if (prec->epvt) postEvent(prec->epvt);
|
||||
} else switch (prec->ivoa) {
|
||||
case menuIvoaContinue_normally:
|
||||
status = writeValue(prec);
|
||||
writeValue(prec);
|
||||
/* post output event if set */
|
||||
if (prec->epvt) postEvent(prec->epvt);
|
||||
break;
|
||||
@@ -611,12 +609,11 @@ static void execOutput(calcoutRecord *prec)
|
||||
break;
|
||||
case menuIvoaSet_output_to_IVOV:
|
||||
prec->oval = prec->ivov;
|
||||
status = writeValue(prec);
|
||||
writeValue(prec);
|
||||
/* post output event if set */
|
||||
if (prec->epvt) postEvent(prec->epvt);
|
||||
break;
|
||||
default:
|
||||
status = -1;
|
||||
recGblRecordError(S_db_badField, (void *)prec,
|
||||
"calcout:process Illegal IVOA field");
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ static long process(fanoutRecord *prec)
|
||||
struct link *plink;
|
||||
unsigned short state;
|
||||
short i;
|
||||
unsigned short monitor_mask;
|
||||
|
||||
prec->pact = TRUE;
|
||||
|
||||
@@ -134,7 +133,7 @@ static long process(fanoutRecord *prec)
|
||||
recGblGetTimeStamp(prec);
|
||||
/* check monitors*/
|
||||
/* get previous stat and sevr and new stat and sevr*/
|
||||
monitor_mask = recGblResetAlarms(prec);
|
||||
recGblResetAlarms(prec);
|
||||
/* process the forward scan link record */
|
||||
recGblFwdLink(prec);
|
||||
prec->pact=FALSE;
|
||||
|
||||
@@ -91,7 +91,6 @@ static void monitor(subRecord *);
|
||||
static long init_record(subRecord *prec, int pass)
|
||||
{
|
||||
SUBFUNCPTR psubroutine;
|
||||
long status = 0;
|
||||
struct link *plink;
|
||||
int i;
|
||||
double *pvalue;
|
||||
@@ -114,7 +113,7 @@ static long init_record(subRecord *prec, int pass)
|
||||
return S_db_BadSub;
|
||||
}
|
||||
/* invoke the initialization subroutine */
|
||||
status = (*psubroutine)(prec);
|
||||
(*psubroutine)(prec);
|
||||
}
|
||||
|
||||
if (prec->snam[0] == 0) {
|
||||
|
||||
@@ -133,7 +133,6 @@ static long init_record(waveformRecord *prec, int pass)
|
||||
static long process(waveformRecord *prec)
|
||||
{
|
||||
struct wfdset *pdset = (struct wfdset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
if ((pdset==NULL) || (pdset->read_wf==NULL)) {
|
||||
@@ -144,7 +143,7 @@ static long process(waveformRecord *prec)
|
||||
|
||||
if (pact && prec->busy) return 0;
|
||||
|
||||
status=readValue(prec); /* read the new value */
|
||||
readValue(prec); /* read the new value */
|
||||
if (!pact && prec->pact) return 0;
|
||||
|
||||
prec->pact = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user