Compare commits

...

8 Commits
2.8.2 ... 2.8.4

Author SHA1 Message Date
53ea75dc80 use macro instead of magic value 2018-09-12 09:48:55 +02:00
b1f4c2a7d9 improve debug message 2018-09-11 18:27:52 +02:00
d87e9cedd2 reset proc to 0 in case it had been 2 to trigger @init 2018-09-11 18:19:58 +02:00
32d93d9028 Merge pull request #15 from darcato/master
Fix typos
2018-09-11 15:10:06 +02:00
3d30827798 Typos on DFB_ULONG 2018-09-11 15:01:33 +02:00
b688f14c22 Merge pull request #14 from icshwi/master
minor modifications related delete and char size
2018-09-10 15:16:10 +02:00
f5da2ea6b3 Do not limit to 80 chars when the link can be 256 by @krisztianloki 2018-08-29 22:27:07 +02:00
4edd2f2eff Fixed new[] / delete mismatch by @krisztianloki 2018-08-29 22:08:23 +02:00
3 changed files with 18 additions and 13 deletions

View File

@ -73,7 +73,7 @@ public:
{init(NULL, size);}
~StreamBuffer()
{if (buffer != local) delete buffer;}
{if (buffer != local) delete [] buffer;}
// operator (): get char* pointing to index
const char* operator()(ssize_t index=0) const

View File

@ -534,11 +534,11 @@ long streamInitRecord(dbCommon* record, const struct link *ioLink,
streamIoFunction readData, streamIoFunction writeData)
{
long status;
char filename[80];
char protocol[80];
char busname[80];
char filename[256];
char protocol[256];
char busname[256];
int addr = -1;
char busparam[80];
char busparam[256];
memset(busparam, 0 ,sizeof(busparam));
debug("streamInitRecord(%s): SEVR=%d\n", record->name, record->sevr);
@ -831,7 +831,7 @@ initRecord(const char* filename, const char* protocol,
return ERROR;
}
debug("Stream::initRecord %s: initialized. %s\n",
name(), convert==2 ?
name(), convert == DO_NOT_CONVERT ?
"convert" : "don't convert");
return convert;
}
@ -843,6 +843,7 @@ process()
debug("Stream::process(%s)\n", name());
if (record->pact || record->scan == SCAN_IO_EVENT)
{
record->proc = 0;
if (status != NO_ALARM)
{
debug("Stream::process(%s) error status=%s (%d)\n",
@ -854,7 +855,7 @@ process()
return false;
}
debug("Stream::process(%s) ready. %s\n",
name(), convert==2 ?
name(), convert == DO_NOT_CONVERT ?
"convert" : "don't convert");
return true;
}
@ -868,11 +869,15 @@ process()
debug("Stream::process(%s) start\n", name());
status = NO_ALARM;
convert = OK;
if (!startProtocol(record->proc==2 ? StreamCore::StartInit : StreamCore::StartNormal))
if (!startProtocol(record->proc == 2 ? StreamCore::StartInit : StreamCore::StartNormal))
{
debug("Stream::process(%s): could not start %sprotocol, status=%d\n",
name(), record->proc==2 ? "@init " : "", status);
debug("Stream::process(%s): could not start %sprotocol, status=%s (%d)\n",
name(), record->proc == 2 ? "@init " : "",
status >= 0 && status < ALARM_NSTATUS ?
epicsAlarmConditionStrings[status] : "ERROR",
status);
(void) recGblSetSevr(record, status ? status : UDF_ALARM, INVALID_ALARM);
record->proc = 0;
return false;
}
debug("Stream::process(%s): protocol started\n", name());

View File

@ -42,7 +42,7 @@ static long readData(dbCommon *record, format_t *format)
return OK;
}
case DBF_LONG:
case DBF_UONG:
case DBF_ULONG:
case DBF_ENUM:
{
long lval;
@ -72,7 +72,7 @@ static long writeData(dbCommon *record, format_t *format)
return streamPrintf(record, format, sco->oval);
}
case DBF_LONG:
case DBF_UONG:
case DBF_ULONG:
case DBF_ENUM:
{
return streamPrintf(record, format, (long)sco->oval);