clean up some whitespace
This commit is contained in:
@ -22,7 +22,7 @@ endif
|
||||
# Do you have synApps and want support for scalcout?
|
||||
# Then define CALC or SYNAPPS in your RELEASE file
|
||||
# pointing to the 'calc' module of synApps.
|
||||
# Older 'calc' versions have a cross reference on
|
||||
# Older 'calc' versions have a cross reference on
|
||||
# 'sscan' and/or 'genSub', so you may have to build them first.
|
||||
# Up to version 2-6 (synApps 5-1) the 'calc' module needs a fix.
|
||||
# See doc/scalcout.html for details.
|
||||
@ -71,7 +71,7 @@ ifneq ($(words $(PCRE) $(PCRE_LIB) $(PCRE_INCLUDE)),0)
|
||||
FORMATS += Regexp
|
||||
endif
|
||||
|
||||
# Want a loadable module?
|
||||
# Want a loadable module?
|
||||
# For Tornado 2.0.2, a fix is needed in the
|
||||
# registerRecordDeviceDriver.pl script in base:
|
||||
# at the end replace the line "IoccrfReg iocshReg;"
|
||||
|
@ -130,7 +130,7 @@ public:
|
||||
|
||||
StreamBuffer& append(const StreamBuffer& s)
|
||||
{return append(s.buffer+s.offs, s.len);}
|
||||
|
||||
|
||||
// operator += alias for append
|
||||
StreamBuffer& operator+=(char c)
|
||||
{return append(c);}
|
||||
@ -224,7 +224,7 @@ public:
|
||||
// expand: create copy of StreamBuffer where all nonprintable characters
|
||||
// are replaced by <xx> with xx being the hex code of the characters
|
||||
StreamBuffer expand(ssize_t start, ssize_t length) const;
|
||||
|
||||
|
||||
StreamBuffer expand(ssize_t start=0) const
|
||||
{return expand(start, len);}
|
||||
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
|
||||
protected:
|
||||
StreamBusInterface(Client* client);
|
||||
|
||||
|
||||
// map client functions into StreamBusInterface namespace
|
||||
void lockCallback(StreamIoStatus status)
|
||||
{ client->lockCallback(status); }
|
||||
@ -178,7 +178,7 @@ protected:
|
||||
StreamBusInterfaceRegistrarBase(const char* name);
|
||||
virtual ~StreamBusInterfaceRegistrarBase();
|
||||
};
|
||||
|
||||
|
||||
template <class C>
|
||||
class StreamBusInterfaceRegistrar : protected StreamBusInterfaceRegistrarBase
|
||||
{
|
||||
|
@ -244,7 +244,7 @@ compile(StreamProtocolParser::Protocol* protocol)
|
||||
pollPeriod = 1000;
|
||||
inTerminatorDefined = false;
|
||||
outTerminatorDefined = false;
|
||||
|
||||
|
||||
unsigned short ignoreExtraInput = false;
|
||||
if (!protocol->getEnumVariable("extrainput", ignoreExtraInput,
|
||||
extraInputNames))
|
||||
@ -383,7 +383,7 @@ compileCommand(StreamProtocolParser::Protocol* protocol,
|
||||
buffer.append(disconnect_cmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
error(getLineNumber(command), protocol->filename(),
|
||||
"Unknown command name '%s'\n", command);
|
||||
return false;
|
||||
@ -636,7 +636,7 @@ formatOutput()
|
||||
const char* fieldName = NULL;
|
||||
const char* formatstring;
|
||||
int formatstringlen;
|
||||
|
||||
|
||||
outputLine.clear();
|
||||
while ((command = *commandIndex++) != StreamProtocolParser::eos)
|
||||
{
|
||||
@ -670,7 +670,7 @@ normal_format:
|
||||
}
|
||||
formatstringlen = commandIndex-formatstring;
|
||||
commandIndex++;
|
||||
|
||||
|
||||
StreamFormat fmt = extract<StreamFormat>(commandIndex);
|
||||
fmt.info = commandIndex; // point to info string
|
||||
commandIndex += fmt.infolen;
|
||||
@ -1016,12 +1016,12 @@ readCallback(StreamIoStatus status,
|
||||
if (inputBuffer) unparsedInput = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// prepare to parse the input
|
||||
const char *commandStart = commandIndex;
|
||||
long end = -1;
|
||||
long termlen = 0;
|
||||
|
||||
|
||||
if (inTerminator)
|
||||
{
|
||||
// look for terminator
|
||||
@ -1175,9 +1175,9 @@ matchInput()
|
||||
char command;
|
||||
const char* fieldName = NULL;
|
||||
StreamBuffer formatstring;
|
||||
|
||||
|
||||
consumedInput = 0;
|
||||
|
||||
|
||||
while ((command = *commandIndex++) != StreamProtocolParser::eos)
|
||||
{
|
||||
switch (command)
|
||||
@ -1202,7 +1202,7 @@ normal_format:
|
||||
// formatstring <eos> StreamFormat [info]
|
||||
formatstring.clear();
|
||||
commandIndex = StreamProtocolParser::printString(formatstring, commandIndex);
|
||||
|
||||
|
||||
StreamFormat fmt = extract<StreamFormat>(commandIndex);
|
||||
fmt.info = commandIndex; // point to info string
|
||||
commandIndex += fmt.infolen;
|
||||
@ -1279,7 +1279,7 @@ normal_format:
|
||||
#ifndef NO_TEMPORARY
|
||||
debug("StreamCore::matchInput(%s): compare \"%s\" with \"%s\"\n",
|
||||
name(), inputLine.expand(consumedInput,
|
||||
outputLine.length())(), outputLine.expand()());
|
||||
outputLine.length())(), outputLine.expand()());
|
||||
#endif
|
||||
if (inputLine.length() - consumedInput < outputLine.length())
|
||||
{
|
||||
@ -1287,7 +1287,7 @@ normal_format:
|
||||
{
|
||||
error("%s: Input \"%s%s\" too short."
|
||||
" No match for format \"%%%s\" (\"%s\")\n",
|
||||
name(),
|
||||
name(),
|
||||
inputLine.length() > 20 ? "..." : "",
|
||||
inputLine.expand(-20)(),
|
||||
formatstring(),
|
||||
@ -1349,7 +1349,7 @@ normal_format:
|
||||
if (!(flags & AsyncMode) && onMismatch[0] != in_cmd)
|
||||
{
|
||||
error("%s: Input \"%s%s\" too short.\n",
|
||||
name(),
|
||||
name(),
|
||||
inputLine.length() > 20 ? "..." : "",
|
||||
inputLine.expand(-20)());
|
||||
#ifndef NO_TEMPORARY
|
||||
@ -1396,7 +1396,7 @@ normal_format:
|
||||
name(), surplus, surplus==1 ? "" : "s",
|
||||
inputLine.expand(consumedInput, 20)(),
|
||||
surplus > 20 ? "..." : "");
|
||||
|
||||
|
||||
if (consumedInput>20)
|
||||
error("%s: after %ld byte%s \"...%s\"\n",
|
||||
name(), consumedInput,
|
||||
|
@ -192,8 +192,8 @@ long streamReloadSub()
|
||||
|
||||
long streamReload(const char* recordname)
|
||||
{
|
||||
DBENTRY dbentry;
|
||||
dbCommon* record;
|
||||
DBENTRY dbentry;
|
||||
dbCommon* record;
|
||||
long status;
|
||||
|
||||
if(!pdbbase) {
|
||||
@ -748,7 +748,7 @@ process()
|
||||
{
|
||||
debug("Stream::process(%s) error status=%s (%d)\n",
|
||||
name(),
|
||||
status >= 0 && status < ALARM_NSTATUS ?
|
||||
status >= 0 && status < ALARM_NSTATUS ?
|
||||
epicsAlarmConditionStrings[status] : "ERROR",
|
||||
status);
|
||||
(void) recGblSetSevr(record, status, INVALID_ALARM);
|
||||
@ -826,7 +826,7 @@ scan(format_t *format, void* value, size_t maxStringSize)
|
||||
error("INTERNAL ERROR (%s): Illegal format type\n", name());
|
||||
return false;
|
||||
}
|
||||
if (currentValueLength < 0)
|
||||
if (currentValueLength < 0)
|
||||
{
|
||||
currentValueLength = 0;
|
||||
return false;
|
||||
@ -1027,12 +1027,12 @@ formatValue(const StreamFormat& format, const void* fieldaddress)
|
||||
// from field of this or other record.
|
||||
StreamBuffer fieldBuffer;
|
||||
DBADDR* pdbaddr = (DBADDR*)fieldaddress;
|
||||
|
||||
|
||||
/* Handle time stamps special. %T converter takes double. */
|
||||
if (strcmp(((dbFldDes*)pdbaddr->pfldDes)->name, "TIME") == 0)
|
||||
{
|
||||
double time;
|
||||
|
||||
|
||||
if (format.type != double_format)
|
||||
{
|
||||
error ("%s: can only read double values from TIME field\n",
|
||||
@ -1071,7 +1071,7 @@ formatValue(const StreamFormat& format, const void* fieldaddress)
|
||||
fmt.type = DBF_CHAR;
|
||||
size = nelem;
|
||||
}
|
||||
|
||||
|
||||
char* buffer = fieldBuffer.clear().reserve(size);
|
||||
|
||||
if (dbGet(pdbaddr, fmt.type, buffer,
|
||||
|
@ -42,7 +42,7 @@ __attribute__((__format__(__printf__,1,2)));
|
||||
|
||||
inline void StreamVError(const char* fmt, va_list args)
|
||||
{
|
||||
StreamVError(0, NULL, fmt, args);
|
||||
StreamVError(0, NULL, fmt, args);
|
||||
}
|
||||
|
||||
class StreamDebugClass
|
||||
|
@ -118,7 +118,7 @@ private:
|
||||
bool parseAssignment(const char* variable, Protocol&);
|
||||
bool parseValue(StreamBuffer& buffer, bool lazy = false);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
~StreamProtocolParser(); // get rid of cygnus-2.7.2 compiler warning
|
||||
|
||||
public:
|
||||
|
@ -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,30 +25,30 @@
|
||||
#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)
|
||||
{
|
||||
/* allow integers with more than 32 bits */
|
||||
if (format->type == DBF_ULONG)
|
||||
val = (unsigned long)rval;
|
||||
else
|
||||
else
|
||||
val = rval;
|
||||
break;
|
||||
}
|
||||
@ -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)
|
||||
@ -47,7 +47,7 @@ static long readData (dbCommon *record, format_t *format)
|
||||
/* allow integers with more than 32 bits */
|
||||
if (format->type == DBF_ULONG)
|
||||
val = (unsigned long)rval;
|
||||
else
|
||||
else
|
||||
val = rval;
|
||||
break;
|
||||
}
|
||||
@ -61,46 +61,46 @@ 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;
|
||||
|
||||
|
||||
switch (format->type)
|
||||
{
|
||||
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,18 +21,18 @@
|
||||
#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)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
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,18 +23,18 @@
|
||||
#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)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
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,18 +22,18 @@
|
||||
#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)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
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,18 +23,18 @@
|
||||
#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)
|
||||
{
|
||||
case DBF_ULONG:
|
||||
case DBF_LONG:
|
||||
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,32 +49,32 @@ 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;
|
||||
|
||||
|
||||
/* Workaround for bug in mbboDirect record:
|
||||
Put to VAL overwrites value to 0 if SEVR is INVALID_ALARM
|
||||
Thus first write may send a wrong value.
|
||||
*/
|
||||
mbboD->sevr = 0;
|
||||
return streamInitRecord (record, &mbboD->out, readData, writeData);
|
||||
mbboD->sevr = 0;
|
||||
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 {
|
||||
|
@ -25,68 +25,68 @@
|
||||
scalcout record has a bug: it never calls init_record
|
||||
of the device support.
|
||||
Fix: sCalcoutRecord.c, end of init_record() add
|
||||
|
||||
|
||||
if(pscalcoutDSET->init_record ) {
|
||||
return (*pscalcoutDSET->init_record)(pcalc);
|
||||
return (*pscalcoutDSET->init_record)(pcalc);
|
||||
}
|
||||
*/
|
||||
|
||||
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