Fixed alignment issue on solaris-sparc-gnu.
This commit is contained in:
@@ -1150,31 +1150,31 @@ static long dbPutFieldLink(
|
||||
|
||||
switch (plink->type) { /* New link type */
|
||||
case PV_LINK:
|
||||
if (plink==&precord->tsel) recGblTSELwasModified(plink);
|
||||
if (plink == &precord->tsel)
|
||||
recGblTSELwasModified(plink);
|
||||
plink->value.pv_link.precord = precord;
|
||||
if (!(plink->value.pv_link.pvlMask & (pvlOptCA|pvlOptCP|pvlOptCPP)) &&
|
||||
(dbNameToAddr(plink->value.pv_link.pvname,&dbaddr)==0)) {
|
||||
(dbNameToAddr(plink->value.pv_link.pvname, &dbaddr) == 0)) {
|
||||
/* It's a DB link */
|
||||
DBADDR *pdbAddr;
|
||||
|
||||
plink->type = DB_LINK;
|
||||
pdbAddr = dbCalloc(1,sizeof(struct dbAddr));
|
||||
pdbAddr = dbMalloc(sizeof(struct dbAddr));
|
||||
*pdbAddr = dbaddr; /* NB: structure copy */;
|
||||
plink->value.pv_link.precord = precord;
|
||||
plink->value.pv_link.pvt = pdbAddr;
|
||||
dbLockSetRecordLock(pdbAddr->precord);
|
||||
dbLockSetMerge(precord,pdbAddr->precord);
|
||||
dbLockSetMerge(precord, pdbAddr->precord);
|
||||
} else { /* Make it a CA link */
|
||||
char *pperiod;
|
||||
|
||||
plink->type = CA_LINK;
|
||||
plink->value.pv_link.precord = precord;
|
||||
if (pfldDes->field_type==DBF_INLINK) {
|
||||
if (pfldDes->field_type == DBF_INLINK) {
|
||||
plink->value.pv_link.pvlMask |= pvlOptInpNative;
|
||||
}
|
||||
dbCaAddLink(plink);
|
||||
if (pfldDes->field_type==DBF_FWDLINK) {
|
||||
pperiod = strrchr(plink->value.pv_link.pvname,'.');
|
||||
if (pperiod && strstr(pperiod,"PROC"))
|
||||
if (pfldDes->field_type == DBF_FWDLINK) {
|
||||
pperiod = strrchr(plink->value.pv_link.pvname, '.');
|
||||
if (pperiod && strstr(pperiod, "PROC"))
|
||||
plink->value.pv_link.pvlMask |= pvlOptFWD;
|
||||
}
|
||||
}
|
||||
@@ -1443,7 +1443,7 @@ long epicsShareAPI dbGetPrecision(const struct link *plink,short *precision)
|
||||
paddr = (DBADDR *)plink->value.pv_link.pvt;
|
||||
status = dbGet(paddr,DBR_DOUBLE,&buffer,&options,&number_elements,0);
|
||||
if(status) return(status);
|
||||
*precision = buffer.precision;
|
||||
*precision = buffer.precision.dp;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,11 +107,14 @@ epicsShareExtern volatile int interruptAccept;
|
||||
#define DB_UNITS_SIZE 16
|
||||
#define DBRunits \
|
||||
char units[DB_UNITS_SIZE]; /* units */
|
||||
#define DBRprecision \
|
||||
long precision; /* number of decimal places*/
|
||||
/* The above type must match the pointer arguments to
|
||||
#define DBRprecision union { \
|
||||
long dp; /* number of decimal places*/\
|
||||
double unused; /* for alignment */\
|
||||
} precision;
|
||||
/* precision must be long to match the pointer arguments to
|
||||
* RSET->get_precision() and recGblGetPrec(), which it's
|
||||
* too late to change now... */
|
||||
* too late to change now. DBRprecision must be padded to
|
||||
* maintain 8-byte alignment. */
|
||||
#define DBRtime \
|
||||
epicsTimeStamp time; /* time stamp*/
|
||||
#define DBRenumStrs \
|
||||
|
||||
@@ -684,7 +684,7 @@ static void printBuffer(
|
||||
struct dbr_precision *pdbr_precision = (void *)pbuffer;
|
||||
|
||||
printf("precision = %ld\n",
|
||||
pdbr_precision->precision);
|
||||
pdbr_precision->precision.dp);
|
||||
}else{
|
||||
printf("precision not returned\n");
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ void *pfl
|
||||
pfl);
|
||||
pold->status = new.status;
|
||||
pold->severity = new.severity;
|
||||
pold->precision = new.precision;
|
||||
pold->precision = new.precision.dp;
|
||||
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
|
||||
pold->units[MAX_UNITS_SIZE-1] = '\0';
|
||||
pold->upper_disp_limit = epicsConvertDoubleToFloat(new.upper_disp_limit);
|
||||
@@ -771,7 +771,7 @@ void *pfl
|
||||
pfl);
|
||||
pold->status = new.status;
|
||||
pold->severity = new.severity;
|
||||
pold->precision = new.precision;
|
||||
pold->precision = new.precision.dp;
|
||||
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
|
||||
pold->units[MAX_UNITS_SIZE-1] = '\0';
|
||||
pold->upper_disp_limit = new.upper_disp_limit;
|
||||
@@ -844,7 +844,7 @@ void *pfl
|
||||
pfl);
|
||||
pold->status = new.status;
|
||||
pold->severity = new.severity;
|
||||
pold->precision = new.precision;
|
||||
pold->precision = new.precision.dp;
|
||||
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
|
||||
pold->units[MAX_UNITS_SIZE-1] = '\0';
|
||||
pold->upper_disp_limit = epicsConvertDoubleToFloat(new.upper_disp_limit);
|
||||
@@ -985,7 +985,7 @@ void *pfl
|
||||
pfl);
|
||||
pold->status = new.status;
|
||||
pold->severity = new.severity;
|
||||
pold->precision = new.precision;
|
||||
pold->precision = new.precision.dp;
|
||||
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
|
||||
pold->units[MAX_UNITS_SIZE-1] = '\0';
|
||||
pold->upper_disp_limit = new.upper_disp_limit;
|
||||
|
||||
Reference in New Issue
Block a user