Fixed indentation of a do-while loop in AsynDriverInterface.cc

This commit is contained in:
Benjamin Franksen
2017-11-27 19:00:00 +01:00
parent 836388cd22
commit f2ceb71c2b

View File

@ -667,25 +667,28 @@ writeHandler()
pasynUser->timeout = 0; pasynUser->timeout = 0;
if (!pasynGpib) if (!pasynGpib)
// discard any early input, but forward it to potential async records {
// thus do not use pasynOctet->flush() // discard any early input, but forward it to potential async records
// unfortunately we cannot do this with GPIB because addressing a device as talker // thus do not use pasynOctet->flush()
// when it has nothing to say is an error. Also timeout=0 does not help here (would need // unfortunately we cannot do this with GPIB because addressing a device as talker
// a change in asynGPIB), thus use flush() for GPIB. // when it has nothing to say is an error. Also timeout=0 does not help here
do { // (would need a change in asynGPIB), thus use flush() for GPIB.
char buffer [256]; do {
size_t received = 0; char buffer [256];
int eomReason = 0; size_t received = 0;
debug("AsynDriverInterface::writeHandler(%s): reading old input\n", int eomReason = 0;
clientName()); debug("AsynDriverInterface::writeHandler(%s): reading old input\n",
status = pasynOctet->read(pvtOctet, pasynUser, clientName());
buffer, sizeof(buffer), &received, &eomReason); status = pasynOctet->read(pvtOctet, pasynUser,
if (status == asynError || received == 0) break; buffer, sizeof(buffer), &received, &eomReason);
if (status == asynError || received == 0) break;
#ifndef NO_TEMPORARY #ifndef NO_TEMPORARY
if (received) debug("AsynDriverInterface::writeHandler(%s): flushing %ld bytes: \"%s\"\n", if (received) debug("AsynDriverInterface::writeHandler(%s): "
clientName(), (long)received, StreamBuffer(buffer, received).expand()()); "flushing %ld bytes: \"%s\"\n",
clientName(), (long)received, StreamBuffer(buffer, received).expand()());
#endif #endif
} while (status == asynSuccess); } while (status == asynSuccess);
}
else else
{ {
debug("AsynDriverInterface::writeHandler(%s): flushing old input\n", debug("AsynDriverInterface::writeHandler(%s): flushing old input\n",