clean up some whitespace
This commit is contained in:
@ -25,9 +25,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aaiRecord *aai = (aaiRecord *) record;
|
||||
aaiRecord *aai = (aaiRecord *)record;
|
||||
double dval;
|
||||
long lval;
|
||||
|
||||
@ -37,7 +37,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
if (streamScanf (record, format, &dval) != OK)
|
||||
if (streamScanf(record, format, &dval) != OK)
|
||||
{
|
||||
return aai->nord ? OK : ERROR;
|
||||
}
|
||||
@ -50,7 +50,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
((epicsFloat32 *)aai->bptr)[aai->nord] = (epicsFloat32)dval;
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from double to %s\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -61,7 +61,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_LONG:
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &lval) != OK)
|
||||
if (streamScanf(record, format, &lval) != OK)
|
||||
{
|
||||
return aai->nord ? OK : ERROR;
|
||||
}
|
||||
@ -93,7 +93,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
((epicsInt8 *)aai->bptr)[aai->nord] = (epicsInt8)lval;
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from long to %s\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -105,7 +105,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
switch (aai->ftvl)
|
||||
{
|
||||
case DBF_STRING:
|
||||
if (streamScanfN (record, format,
|
||||
if (streamScanfN(record, format,
|
||||
(char *)aai->bptr + aai->nord * MAX_STRING_SIZE,
|
||||
MAX_STRING_SIZE) != OK)
|
||||
{
|
||||
@ -114,9 +114,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
break;
|
||||
case DBF_CHAR:
|
||||
case DBF_UCHAR:
|
||||
memset (aai->bptr, 0, aai->nelm);
|
||||
memset(aai->bptr, 0, aai->nelm);
|
||||
aai->nord = 0;
|
||||
if (streamScanfN (record, format,
|
||||
if (streamScanfN(record, format,
|
||||
(char *)aai->bptr, aai->nelm) != OK)
|
||||
{
|
||||
return ERROR;
|
||||
@ -128,7 +128,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
aai->nord = lval+1;
|
||||
return OK;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from string to %s\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -137,7 +137,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
}
|
||||
default:
|
||||
{
|
||||
errlogSevPrintf (errlogMajor,
|
||||
errlogSevPrintf(errlogMajor,
|
||||
"readData %s: can't convert from %s to %s\n",
|
||||
record->name, pamapdbfType[format->type].strvalue,
|
||||
pamapdbfType[aai->ftvl].strvalue);
|
||||
@ -148,9 +148,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aaiRecord *aai = (aaiRecord *) record;
|
||||
aaiRecord *aai = (aaiRecord *)record;
|
||||
double dval;
|
||||
long lval;
|
||||
unsigned long nowd;
|
||||
@ -197,12 +197,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
dval = ((epicsUInt8 *)aai->bptr)[nowd];
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to double\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||
return ERROR;
|
||||
}
|
||||
if (streamPrintf (record, format, dval))
|
||||
if (streamPrintf(record, format, dval))
|
||||
return ERROR;
|
||||
break;
|
||||
}
|
||||
@ -240,12 +240,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
lval = ((epicsUInt8 *)aai->bptr)[nowd];
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to long\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||
return ERROR;
|
||||
}
|
||||
if (streamPrintf (record, format, lval))
|
||||
if (streamPrintf(record, format, lval))
|
||||
return ERROR;
|
||||
break;
|
||||
}
|
||||
@ -254,7 +254,7 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
switch (aai->ftvl)
|
||||
{
|
||||
case DBF_STRING:
|
||||
if (streamPrintf (record, format,
|
||||
if (streamPrintf(record, format,
|
||||
((char *)aai->bptr) + nowd * MAX_STRING_SIZE))
|
||||
return ERROR;
|
||||
break;
|
||||
@ -269,12 +269,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
{
|
||||
((char *)aai->bptr)[aai->nelm-1] = 0;
|
||||
}
|
||||
if (streamPrintf (record, format,
|
||||
if (streamPrintf(record, format,
|
||||
((char *)aai->bptr)))
|
||||
return ERROR;
|
||||
return OK;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to string\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -283,7 +283,7 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
}
|
||||
default:
|
||||
{
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to %s\n",
|
||||
record->name, pamapdbfType[aai->ftvl].strvalue,
|
||||
pamapdbfType[format->type].strvalue);
|
||||
@ -294,19 +294,19 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
aaiRecord *aai = (aaiRecord *) record;
|
||||
aaiRecord *aai = (aaiRecord *)record;
|
||||
|
||||
aai->bptr = calloc(aai->nelm, dbValueSize(aai->ftvl));
|
||||
if (aai->bptr == NULL)
|
||||
{
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"initRecord %s: can't allocate memory for data array\n",
|
||||
record->name);
|
||||
return ERROR;
|
||||
}
|
||||
return streamInitRecord (record, &aai->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &aai->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aaoRecord *aao = (aaoRecord *) record;
|
||||
aaoRecord *aao = (aaoRecord *)record;
|
||||
double dval;
|
||||
long lval;
|
||||
|
||||
@ -37,7 +37,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
if (streamScanf (record, format, &dval) != OK)
|
||||
if (streamScanf(record, format, &dval) != OK)
|
||||
{
|
||||
return aao->nord ? OK : ERROR;
|
||||
}
|
||||
@ -50,7 +50,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
((epicsFloat32 *)aao->bptr)[aao->nord] = (epicsFloat32)dval;
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from double to %s\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -61,7 +61,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_LONG:
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &lval) != OK)
|
||||
if (streamScanf(record, format, &lval) != OK)
|
||||
{
|
||||
return aao->nord ? OK : ERROR;
|
||||
}
|
||||
@ -93,7 +93,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
((epicsInt8 *)aao->bptr)[aao->nord] = (epicsInt8)lval;
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from long to %s\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -105,7 +105,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
switch (aao->ftvl)
|
||||
{
|
||||
case DBF_STRING:
|
||||
if (streamScanfN (record, format,
|
||||
if (streamScanfN(record, format,
|
||||
(char *)aao->bptr + aao->nord * MAX_STRING_SIZE,
|
||||
MAX_STRING_SIZE) != OK)
|
||||
{
|
||||
@ -114,9 +114,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
break;
|
||||
case DBF_CHAR:
|
||||
case DBF_UCHAR:
|
||||
memset (aao->bptr, 0, aao->nelm);
|
||||
memset(aao->bptr, 0, aao->nelm);
|
||||
aao->nord = 0;
|
||||
if (streamScanfN (record, format,
|
||||
if (streamScanfN(record, format,
|
||||
(char *)aao->bptr, aao->nelm) != OK)
|
||||
{
|
||||
return ERROR;
|
||||
@ -128,7 +128,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
aao->nord = lval+1;
|
||||
return OK;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from string to %s\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -137,7 +137,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
}
|
||||
default:
|
||||
{
|
||||
errlogSevPrintf (errlogMajor,
|
||||
errlogSevPrintf(errlogMajor,
|
||||
"readData %s: can't convert from %s to %s\n",
|
||||
record->name, pamapdbfType[format->type].strvalue,
|
||||
pamapdbfType[aao->ftvl].strvalue);
|
||||
@ -148,9 +148,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aaoRecord *aao = (aaoRecord *) record;
|
||||
aaoRecord *aao = (aaoRecord *)record;
|
||||
double dval;
|
||||
long lval;
|
||||
unsigned long nowd;
|
||||
@ -197,12 +197,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
dval = ((epicsUInt8 *)aao->bptr)[nowd];
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to double\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||
return ERROR;
|
||||
}
|
||||
if (streamPrintf (record, format, dval))
|
||||
if (streamPrintf(record, format, dval))
|
||||
return ERROR;
|
||||
break;
|
||||
}
|
||||
@ -240,12 +240,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
lval = ((epicsUInt8 *)aao->bptr)[nowd];
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to long\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||
return ERROR;
|
||||
}
|
||||
if (streamPrintf (record, format, lval))
|
||||
if (streamPrintf(record, format, lval))
|
||||
return ERROR;
|
||||
break;
|
||||
}
|
||||
@ -254,7 +254,7 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
switch (aao->ftvl)
|
||||
{
|
||||
case DBF_STRING:
|
||||
if (streamPrintf (record, format,
|
||||
if (streamPrintf(record, format,
|
||||
((char *)aao->bptr) + nowd * MAX_STRING_SIZE))
|
||||
return ERROR;
|
||||
break;
|
||||
@ -269,12 +269,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
{
|
||||
((char *)aao->bptr)[aao->nelm-1] = 0;
|
||||
}
|
||||
if (streamPrintf (record, format,
|
||||
if (streamPrintf(record, format,
|
||||
((char *)aao->bptr)))
|
||||
return ERROR;
|
||||
return OK;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to string\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -283,7 +283,7 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
}
|
||||
default:
|
||||
{
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to %s\n",
|
||||
record->name, pamapdbfType[aao->ftvl].strvalue,
|
||||
pamapdbfType[format->type].strvalue);
|
||||
@ -294,19 +294,19 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
aaoRecord *aao = (aaoRecord *) record;
|
||||
aaoRecord *aao = (aaoRecord *)record;
|
||||
|
||||
aao->bptr = calloc(aao->nelm, dbValueSize(aao->ftvl));
|
||||
if (aao->bptr == NULL)
|
||||
{
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"initRecord %s: can't allocate memory for data array\n",
|
||||
record->name);
|
||||
return ERROR;
|
||||
}
|
||||
return streamInitRecord (record, &aao->out, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &aao->out, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -25,23 +25,23 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aiRecord *ai = (aiRecord *) record;
|
||||
aiRecord *ai = (aiRecord *)record;
|
||||
double val;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
break;
|
||||
}
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
long rval;
|
||||
if (streamScanf (record, format, &rval)) return ERROR;
|
||||
if (streamScanf(record, format, &rval)) return ERROR;
|
||||
ai->rval = rval;
|
||||
if (ai->linr == 0)
|
||||
{
|
||||
@ -65,9 +65,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return DO_NOT_CONVERT;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aiRecord *ai = (aiRecord *) record;
|
||||
aiRecord *ai = (aiRecord *)record;
|
||||
|
||||
double val = ai->val - ai->aoff;
|
||||
if (ai->aslo != 0.0 && ai->aslo != 1.0) val /= ai->aslo;
|
||||
@ -76,35 +76,35 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
return streamPrintf (record, format, val);
|
||||
return streamPrintf(record, format, val);
|
||||
}
|
||||
case DBF_ULONG:
|
||||
{
|
||||
if (ai->linr == 0)
|
||||
{
|
||||
/* allow more bits than 32 */
|
||||
return streamPrintf (record, format, (unsigned long)val);
|
||||
return streamPrintf(record, format, (unsigned long)val);
|
||||
}
|
||||
return streamPrintf (record, format, (unsigned long)ai->rval);
|
||||
return streamPrintf(record, format, (unsigned long)ai->rval);
|
||||
}
|
||||
case DBF_LONG:
|
||||
{
|
||||
if (ai->linr == 0)
|
||||
{
|
||||
/* allow more bits than 32 */
|
||||
return streamPrintf (record, format, (long)val);
|
||||
return streamPrintf(record, format, (long)val);
|
||||
}
|
||||
return streamPrintf (record, format, (long)ai->rval);
|
||||
return streamPrintf(record, format, (long)ai->rval);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
aiRecord *ai = (aiRecord *) record;
|
||||
aiRecord *ai = (aiRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &ai->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &ai->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -23,23 +23,23 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aoRecord *ao = (aoRecord *) record;
|
||||
aoRecord *ao = (aoRecord *)record;
|
||||
double val;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
break;
|
||||
}
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
long rval;
|
||||
if (streamScanf (record, format, &rval)) return ERROR;
|
||||
if (streamScanf(record, format, &rval)) return ERROR;
|
||||
ao->rbv = rval;
|
||||
ao->rval = rval;
|
||||
if (ao->linr == 0)
|
||||
@ -61,9 +61,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return DO_NOT_CONVERT;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
aoRecord *ao = (aoRecord *) record;
|
||||
aoRecord *ao = (aoRecord *)record;
|
||||
|
||||
double val = (INIT_RUN ? ao->val : ao->oval) - ao->aoff;
|
||||
if (ao->aslo != 0.0 && ao->aslo != 1.0) val /= ao->aslo;
|
||||
@ -72,35 +72,35 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
return streamPrintf (record, format, val);
|
||||
return streamPrintf(record, format, val);
|
||||
}
|
||||
case DBF_ULONG:
|
||||
{
|
||||
if (ao->linr == 0)
|
||||
{
|
||||
/* allow integers with more than 32 bits */
|
||||
return streamPrintf (record, format, (unsigned long)val);
|
||||
return streamPrintf(record, format, (unsigned long)val);
|
||||
}
|
||||
return streamPrintf (record, format, (unsigned long)ao->rval);
|
||||
return streamPrintf(record, format, (unsigned long)ao->rval);
|
||||
}
|
||||
case DBF_LONG:
|
||||
{
|
||||
if (ao->linr == 0)
|
||||
{
|
||||
/* allow integers with more than 32 bits */
|
||||
return streamPrintf (record, format, (long)val);
|
||||
return streamPrintf(record, format, (long)val);
|
||||
}
|
||||
return streamPrintf (record, format, (long)ao->rval);
|
||||
return streamPrintf(record, format, (long)ao->rval);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
aoRecord *ao = (aoRecord *) record;
|
||||
aoRecord *ao = (aoRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &ao->out, readData, writeData);
|
||||
return streamInitRecord(record, &ao->out, readData, writeData);
|
||||
}
|
||||
|
||||
struct {
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
biRecord *bi = (biRecord *) record;
|
||||
biRecord *bi = (biRecord *)record;
|
||||
unsigned long val;
|
||||
|
||||
switch (format->type)
|
||||
@ -33,21 +33,21 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
if (bi->mask) val &= bi->mask;
|
||||
bi->rval = val;
|
||||
return OK;
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
bi->val = (val != 0);
|
||||
return DO_NOT_CONVERT;
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
char buffer[sizeof(bi->znam)];
|
||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
||||
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||
return ERROR;
|
||||
if (strcmp (bi->znam, buffer) == 0)
|
||||
{
|
||||
@ -64,35 +64,35 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
biRecord *bi = (biRecord *) record;
|
||||
biRecord *bi = (biRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
return streamPrintf (record, format, bi->rval);
|
||||
return streamPrintf(record, format, bi->rval);
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
return streamPrintf (record, format, (long)bi->val);
|
||||
return streamPrintf(record, format, (long)bi->val);
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
return streamPrintf (record, format,
|
||||
return streamPrintf(record, format,
|
||||
bi->val ? bi->onam : bi->znam);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
biRecord *bi = (biRecord *) record;
|
||||
biRecord *bi = (biRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &bi->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &bi->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
boRecord *bo = (boRecord *) record;
|
||||
boRecord *bo = (boRecord *)record;
|
||||
unsigned long val;
|
||||
|
||||
switch (format->type)
|
||||
@ -33,7 +33,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
if (bo->mask) val &= bo->mask;
|
||||
bo->rbv = val;
|
||||
if (INIT_RUN) bo->rval = val;
|
||||
@ -41,14 +41,14 @@ static long readData (dbCommon *record, format_t *format)
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
bo->val = (val != 0);
|
||||
return DO_NOT_CONVERT;
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
char buffer[sizeof(bo->znam)];
|
||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
||||
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||
return ERROR;
|
||||
if (strcmp (bo->znam, buffer) == 0)
|
||||
{
|
||||
@ -65,35 +65,35 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
boRecord *bo = (boRecord *) record;
|
||||
boRecord *bo = (boRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
return streamPrintf (record, format, bo->rval);
|
||||
return streamPrintf(record, format, bo->rval);
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
return streamPrintf (record, format, (long)bo->val);
|
||||
return streamPrintf(record, format, (long)bo->val);
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
return streamPrintf (record, format,
|
||||
return streamPrintf(record, format,
|
||||
bo->val ? bo->onam : bo->znam);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
boRecord *bo = (boRecord *) record;
|
||||
boRecord *bo = (boRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &bo->out, readData, writeData);
|
||||
return streamInitRecord(record, &bo->out, readData, writeData);
|
||||
}
|
||||
|
||||
struct {
|
||||
|
@ -22,15 +22,15 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
calcoutRecord *co = (calcoutRecord *) record;
|
||||
calcoutRecord *co = (calcoutRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
return streamScanf (record, format, &co->val);
|
||||
return streamScanf(record, format, &co->val);
|
||||
}
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
@ -38,7 +38,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
{
|
||||
long lval;
|
||||
|
||||
if (streamScanf (record, format, &lval)) return ERROR;
|
||||
if (streamScanf(record, format, &lval)) return ERROR;
|
||||
if (format->type == DBF_LONG)
|
||||
co->val = lval;
|
||||
else
|
||||
@ -49,34 +49,34 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
calcoutRecord *co = (calcoutRecord *) record;
|
||||
calcoutRecord *co = (calcoutRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
return streamPrintf (record, format, co->oval);
|
||||
return streamPrintf(record, format, co->oval);
|
||||
}
|
||||
case DBF_ULONG:
|
||||
case DBF_ENUM:
|
||||
{
|
||||
return streamPrintf (record, format, (unsigned long)co->oval);
|
||||
return streamPrintf(record, format, (unsigned long)co->oval);
|
||||
}
|
||||
case DBF_LONG:
|
||||
{
|
||||
return streamPrintf (record, format, (long)co->oval);
|
||||
return streamPrintf(record, format, (long)co->oval);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
calcoutRecord *co = (calcoutRecord *) record;
|
||||
calcoutRecord *co = (calcoutRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &co->out, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &co->out, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
int64inRecord *i64i = (int64inRecord *) record;
|
||||
int64inRecord *i64i = (int64inRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
@ -32,7 +32,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ENUM:
|
||||
{
|
||||
long val;
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
if (format->type == DBF_LONG)
|
||||
i64i->val = val;
|
||||
else
|
||||
@ -43,25 +43,25 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
int64inRecord *i64i = (int64inRecord *) record;
|
||||
int64inRecord *i64i = (int64inRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_ENUM:
|
||||
case DBF_LONG:
|
||||
return streamPrintf (record, format, (long)i64i->val);
|
||||
return streamPrintf(record, format, (long)i64i->val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
int64inRecord *i64i = (int64inRecord *) record;
|
||||
int64inRecord *i64i = (int64inRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &i64i->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &i64i->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
int64outRecord *i64o = (int64outRecord *) record;
|
||||
int64outRecord *i64o = (int64outRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
@ -34,7 +34,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ENUM:
|
||||
{
|
||||
long val;
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
if (format->type == DBF_LONG)
|
||||
i64o->val = val;
|
||||
else
|
||||
@ -45,25 +45,25 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
int64outRecord *i64o = (int64outRecord *) record;
|
||||
int64outRecord *i64o = (int64outRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_ENUM:
|
||||
case DBF_LONG:
|
||||
return streamPrintf (record, format, (long)i64o->val);
|
||||
return streamPrintf(record, format, (long)i64o->val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
int64outRecord *i64o = (int64outRecord *) record;
|
||||
int64outRecord *i64o = (int64outRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &i64o->out, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &i64o->out, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -22,9 +22,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
longinRecord *li = (longinRecord *) record;
|
||||
longinRecord *li = (longinRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
@ -33,7 +33,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ENUM:
|
||||
{
|
||||
long val;
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
li->val = val;
|
||||
return OK;
|
||||
}
|
||||
@ -41,26 +41,26 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
longinRecord *li = (longinRecord *) record;
|
||||
longinRecord *li = (longinRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_ENUM:
|
||||
return streamPrintf (record, format, (unsigned long)li->val);
|
||||
return streamPrintf(record, format, (unsigned long)li->val);
|
||||
case DBF_LONG:
|
||||
return streamPrintf (record, format, (long)li->val);
|
||||
return streamPrintf(record, format, (long)li->val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
longinRecord *li = (longinRecord *) record;
|
||||
longinRecord *li = (longinRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &li->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &li->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
longoutRecord *lo = (longoutRecord *) record;
|
||||
longoutRecord *lo = (longoutRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
@ -34,7 +34,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ENUM:
|
||||
{
|
||||
long val;
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
lo->val = val;
|
||||
return OK;
|
||||
}
|
||||
@ -42,26 +42,26 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
longoutRecord *lo = (longoutRecord *) record;
|
||||
longoutRecord *lo = (longoutRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_ENUM:
|
||||
return streamPrintf (record, format, (unsigned long)lo->val);
|
||||
return streamPrintf(record, format, (unsigned long)lo->val);
|
||||
case DBF_LONG:
|
||||
return streamPrintf (record, format, (long)lo->val);
|
||||
return streamPrintf(record, format, (long)lo->val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
longoutRecord *lo = (longoutRecord *) record;
|
||||
longoutRecord *lo = (longoutRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &lo->out, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &lo->out, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -23,14 +23,14 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *) record;
|
||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *)record;
|
||||
unsigned long val;
|
||||
|
||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
if (mbbiD->mask)
|
||||
{
|
||||
val &= mbbiD->mask;
|
||||
@ -47,26 +47,26 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *) record;
|
||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *)record;
|
||||
unsigned long val;
|
||||
|
||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||
{
|
||||
if (mbbiD->mask) val = mbbiD->rval & mbbiD->mask;
|
||||
else val = mbbiD->val;
|
||||
return streamPrintf (record, format, val);
|
||||
return streamPrintf(record, format, val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *) record;
|
||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *)record;
|
||||
|
||||
mbbiD->mask <<= mbbiD->shft;
|
||||
return streamInitRecord (record, &mbbiD->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &mbbiD->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbbiRecord *mbbi = (mbbiRecord *) record;
|
||||
mbbiRecord *mbbi = (mbbiRecord *)record;
|
||||
unsigned long val;
|
||||
int i;
|
||||
|
||||
@ -35,7 +35,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
/* read VAL or RBV? Look if any value is defined */
|
||||
if (mbbi->sdef) for (i=0; i<16; i++)
|
||||
{
|
||||
@ -51,14 +51,14 @@ static long readData (dbCommon *record, format_t *format)
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
mbbi->val = val;
|
||||
return DO_NOT_CONVERT;
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
char buffer[sizeof(mbbi->zrst)];
|
||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
||||
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||
return ERROR;
|
||||
for (val = 0; val < 16; val++)
|
||||
{
|
||||
@ -73,9 +73,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbbiRecord *mbbi = (mbbiRecord *) record;
|
||||
mbbiRecord *mbbi = (mbbiRecord *)record;
|
||||
long val;
|
||||
int i;
|
||||
|
||||
@ -94,28 +94,28 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return streamPrintf (record, format, val);
|
||||
return streamPrintf(record, format, val);
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
return streamPrintf (record, format, (long)mbbi->val);
|
||||
return streamPrintf(record, format, (long)mbbi->val);
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
if (mbbi->val >= 16) return ERROR;
|
||||
return streamPrintf (record, format,
|
||||
return streamPrintf(record, format,
|
||||
mbbi->zrst + sizeof(mbbi->zrst) * mbbi->val);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
mbbiRecord *mbbi = (mbbiRecord *) record;
|
||||
mbbiRecord *mbbi = (mbbiRecord *)record;
|
||||
|
||||
mbbi->mask <<= mbbi->shft;
|
||||
return streamInitRecord (record, &mbbi->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &mbbi->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -24,14 +24,14 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
|
||||
mbboDirectRecord *mbboD = (mbboDirectRecord *)record;
|
||||
unsigned long val;
|
||||
|
||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
if (mbboD->mask)
|
||||
{
|
||||
val &= mbboD->mask;
|
||||
@ -49,23 +49,23 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
|
||||
mbboDirectRecord *mbboD = (mbboDirectRecord *)record;
|
||||
long val;
|
||||
|
||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||
{
|
||||
if (mbboD->mask) val = mbboD->rval & mbboD->mask;
|
||||
else val = mbboD->val;
|
||||
return streamPrintf (record, format, val);
|
||||
return streamPrintf(record, format, val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
|
||||
mbboDirectRecord *mbboD = (mbboDirectRecord *)record;
|
||||
|
||||
mbboD->mask <<= mbboD->shft;
|
||||
|
||||
@ -74,7 +74,7 @@ static long initRecord (dbCommon *record)
|
||||
Thus first write may send a wrong value.
|
||||
*/
|
||||
mbboD->sevr = 0;
|
||||
return streamInitRecord (record, &mbboD->out, readData, writeData);
|
||||
return streamInitRecord(record, &mbboD->out, readData, writeData);
|
||||
}
|
||||
|
||||
/* Unfortunately the bug also corrupts the next write to VAL after an I/O error.
|
||||
|
@ -24,9 +24,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbboRecord *mbbo = (mbboRecord *) record;
|
||||
mbboRecord *mbbo = (mbboRecord *)record;
|
||||
unsigned long val;
|
||||
int i;
|
||||
|
||||
@ -35,7 +35,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
/* read VAL or RBV? Look if any value is defined */
|
||||
if (mbbo->sdef) for (i=0; i<16; i++)
|
||||
{
|
||||
@ -52,14 +52,14 @@ static long readData (dbCommon *record, format_t *format)
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &val)) return ERROR;
|
||||
if (streamScanf(record, format, &val)) return ERROR;
|
||||
mbbo->val = val;
|
||||
return DO_NOT_CONVERT;
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
char buffer[sizeof(mbbo->zrst)];
|
||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
||||
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||
return ERROR;
|
||||
for (val = 0; val < 16; val++)
|
||||
{
|
||||
@ -74,9 +74,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
mbboRecord *mbbo = (mbboRecord *) record;
|
||||
mbboRecord *mbbo = (mbboRecord *)record;
|
||||
unsigned long val;
|
||||
int i;
|
||||
|
||||
@ -97,28 +97,28 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return streamPrintf (record, format, val);
|
||||
return streamPrintf(record, format, val);
|
||||
}
|
||||
case DBF_ENUM:
|
||||
{
|
||||
return streamPrintf (record, format, (long)mbbo->val);
|
||||
return streamPrintf(record, format, (long)mbbo->val);
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
if (mbbo->val >= 16) return ERROR;
|
||||
return streamPrintf (record, format,
|
||||
return streamPrintf(record, format,
|
||||
mbbo->zrst + sizeof(mbbo->zrst) * mbbo->val);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
mbboRecord *mbbo = (mbboRecord *) record;
|
||||
mbboRecord *mbbo = (mbboRecord *)record;
|
||||
|
||||
mbbo->mask <<= mbbo->shft;
|
||||
return streamInitRecord (record, &mbbo->out, readData, writeData);
|
||||
return streamInitRecord(record, &mbbo->out, readData, writeData);
|
||||
}
|
||||
|
||||
struct {
|
||||
|
@ -31,62 +31,62 @@
|
||||
}
|
||||
*/
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
scalcoutRecord *sco = (scalcoutRecord *) record;
|
||||
scalcoutRecord *sco = (scalcoutRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
return streamScanf (record, format, &sco->val);
|
||||
return streamScanf(record, format, &sco->val);
|
||||
}
|
||||
case DBF_LONG:
|
||||
case DBF_ENUM:
|
||||
{
|
||||
long lval;
|
||||
|
||||
if (streamScanf (record, format, &lval)) return ERROR;
|
||||
if (streamScanf(record, format, &lval)) return ERROR;
|
||||
sco->val = lval;
|
||||
return OK;
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
return (streamScanfN (record, format,
|
||||
return (streamScanfN(record, format,
|
||||
sco->sval, sizeof(sco->val)));
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
scalcoutRecord *sco = (scalcoutRecord *) record;
|
||||
scalcoutRecord *sco = (scalcoutRecord *)record;
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
return streamPrintf (record, format, sco->oval);
|
||||
return streamPrintf(record, format, sco->oval);
|
||||
}
|
||||
case DBF_LONG:
|
||||
case DBF_ENUM:
|
||||
{
|
||||
return streamPrintf (record, format, (long)sco->oval);
|
||||
return streamPrintf(record, format, (long)sco->oval);
|
||||
}
|
||||
case DBF_STRING:
|
||||
{
|
||||
return streamPrintf (record, format, sco->osv);
|
||||
return streamPrintf(record, format, sco->osv);
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
scalcoutRecord *sco = (scalcoutRecord *) record;
|
||||
scalcoutRecord *sco = (scalcoutRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &sco->out, readData, writeData);
|
||||
return streamInitRecord(record, &sco->out, readData, writeData);
|
||||
}
|
||||
|
||||
struct {
|
||||
|
@ -22,33 +22,33 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
stringinRecord *si = (stringinRecord *) record;
|
||||
stringinRecord *si = (stringinRecord *)record;
|
||||
|
||||
if (format->type == DBF_STRING)
|
||||
{
|
||||
return streamScanfN (record, format, si->val, sizeof(si->val));
|
||||
return streamScanfN(record, format, si->val, sizeof(si->val));
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
stringinRecord *si = (stringinRecord *) record;
|
||||
stringinRecord *si = (stringinRecord *)record;
|
||||
|
||||
if (format->type == DBF_STRING)
|
||||
{
|
||||
return streamPrintf (record, format, si->val);
|
||||
return streamPrintf(record, format, si->val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
stringinRecord *si = (stringinRecord *) record;
|
||||
stringinRecord *si = (stringinRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &si->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &si->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -22,33 +22,33 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
stringoutRecord *so = (stringoutRecord *) record;
|
||||
stringoutRecord *so = (stringoutRecord *)record;
|
||||
|
||||
if (format->type == DBF_STRING)
|
||||
{
|
||||
return streamScanfN (record, format, so->val, sizeof(so->val));
|
||||
return streamScanfN(record, format, so->val, sizeof(so->val));
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
stringoutRecord *so = (stringoutRecord *) record;
|
||||
stringoutRecord *so = (stringoutRecord *)record;
|
||||
|
||||
if (format->type == DBF_STRING)
|
||||
{
|
||||
return streamPrintf (record, format, so->val);
|
||||
return streamPrintf(record, format, so->val);
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
stringoutRecord *so = (stringoutRecord *) record;
|
||||
stringoutRecord *so = (stringoutRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &so->out, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &so->out, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,9 @@
|
||||
#include "epicsExport.h"
|
||||
#include "devStream.h"
|
||||
|
||||
static long readData (dbCommon *record, format_t *format)
|
||||
static long readData(dbCommon *record, format_t *format)
|
||||
{
|
||||
waveformRecord *wf = (waveformRecord *) record;
|
||||
waveformRecord *wf = (waveformRecord *)record;
|
||||
double dval;
|
||||
long lval;
|
||||
|
||||
@ -37,7 +37,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
{
|
||||
case DBF_DOUBLE:
|
||||
{
|
||||
if (streamScanf (record, format, &dval) != OK)
|
||||
if (streamScanf(record, format, &dval) != OK)
|
||||
{
|
||||
return wf->nord ? OK : ERROR;
|
||||
}
|
||||
@ -50,7 +50,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
((epicsFloat32 *)wf->bptr)[wf->nord] = (epicsFloat32)dval;
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from double to %s\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -61,7 +61,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
case DBF_LONG:
|
||||
case DBF_ENUM:
|
||||
{
|
||||
if (streamScanf (record, format, &lval) != OK)
|
||||
if (streamScanf(record, format, &lval) != OK)
|
||||
{
|
||||
return wf->nord ? OK : ERROR;
|
||||
}
|
||||
@ -93,7 +93,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
((epicsInt8 *)wf->bptr)[wf->nord] = (epicsInt8)lval;
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from long to %s\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -105,7 +105,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
switch (wf->ftvl)
|
||||
{
|
||||
case DBF_STRING:
|
||||
if (streamScanfN (record, format,
|
||||
if (streamScanfN(record, format,
|
||||
(char *)wf->bptr + wf->nord * MAX_STRING_SIZE,
|
||||
MAX_STRING_SIZE) != OK)
|
||||
{
|
||||
@ -114,9 +114,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
break;
|
||||
case DBF_CHAR:
|
||||
case DBF_UCHAR:
|
||||
memset (wf->bptr, 0, wf->nelm);
|
||||
memset(wf->bptr, 0, wf->nelm);
|
||||
wf->nord = 0;
|
||||
if (streamScanfN (record, format,
|
||||
if (streamScanfN(record, format,
|
||||
(char *)wf->bptr, wf->nelm) != OK)
|
||||
{
|
||||
return ERROR;
|
||||
@ -128,7 +128,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
wf->nord = lval+1;
|
||||
return OK;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"readData %s: can't convert from string to %s\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -137,7 +137,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
}
|
||||
default:
|
||||
{
|
||||
errlogSevPrintf (errlogMajor,
|
||||
errlogSevPrintf(errlogMajor,
|
||||
"readData %s: can't convert from %s to %s\n",
|
||||
record->name, pamapdbfType[format->type].strvalue,
|
||||
pamapdbfType[wf->ftvl].strvalue);
|
||||
@ -148,9 +148,9 @@ static long readData (dbCommon *record, format_t *format)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static long writeData (dbCommon *record, format_t *format)
|
||||
static long writeData(dbCommon *record, format_t *format)
|
||||
{
|
||||
waveformRecord *wf = (waveformRecord *) record;
|
||||
waveformRecord *wf = (waveformRecord *)record;
|
||||
double dval;
|
||||
long lval;
|
||||
unsigned long nowd;
|
||||
@ -197,12 +197,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
dval = ((epicsUInt8 *)wf->bptr)[nowd];
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to double\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||
return ERROR;
|
||||
}
|
||||
if (streamPrintf (record, format, dval))
|
||||
if (streamPrintf(record, format, dval))
|
||||
return ERROR;
|
||||
break;
|
||||
}
|
||||
@ -240,12 +240,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
lval = ((epicsUInt8 *)wf->bptr)[nowd];
|
||||
break;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to long\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||
return ERROR;
|
||||
}
|
||||
if (streamPrintf (record, format, lval))
|
||||
if (streamPrintf(record, format, lval))
|
||||
return ERROR;
|
||||
break;
|
||||
}
|
||||
@ -254,7 +254,7 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
switch (wf->ftvl)
|
||||
{
|
||||
case DBF_STRING:
|
||||
if (streamPrintf (record, format,
|
||||
if (streamPrintf(record, format,
|
||||
((char *)wf->bptr) + nowd * MAX_STRING_SIZE))
|
||||
return ERROR;
|
||||
break;
|
||||
@ -269,12 +269,12 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
{
|
||||
((char *)wf->bptr)[wf->nelm-1] = 0;
|
||||
}
|
||||
if (streamPrintf (record, format,
|
||||
if (streamPrintf(record, format,
|
||||
((char *)wf->bptr)))
|
||||
return ERROR;
|
||||
return OK;
|
||||
default:
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to string\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||
return ERROR;
|
||||
@ -283,7 +283,7 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
}
|
||||
default:
|
||||
{
|
||||
errlogSevPrintf (errlogFatal,
|
||||
errlogSevPrintf(errlogFatal,
|
||||
"writeData %s: can't convert from %s to %s\n",
|
||||
record->name, pamapdbfType[wf->ftvl].strvalue,
|
||||
pamapdbfType[format->type].strvalue);
|
||||
@ -294,11 +294,11 @@ static long writeData (dbCommon *record, format_t *format)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static long initRecord (dbCommon *record)
|
||||
static long initRecord(dbCommon *record)
|
||||
{
|
||||
waveformRecord *wf = (waveformRecord *) record;
|
||||
waveformRecord *wf = (waveformRecord *)record;
|
||||
|
||||
return streamInitRecord (record, &wf->inp, readData, writeData) == ERROR ?
|
||||
return streamInitRecord(record, &wf->inp, readData, writeData) == ERROR ?
|
||||
ERROR : OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user