replaced tabs with spaces

This commit is contained in:
2020-04-15 10:54:36 +02:00
committed by mdavidsaver
parent ef4bf9120e
commit 40300a12cb
39 changed files with 151 additions and 151 deletions

View File

@ -87,7 +87,7 @@ std::size_t readSize(ByteBuffer* buffer) {
string deserializeString(ByteBuffer* buffer) {
std::size_t size = /*SerializeHelper::*/readSize(buffer);
if(size!=(size_t)-1) // TODO null strings check, to be removed in the future
if(size!=(size_t)-1) // TODO null strings check, to be removed in the future
{
// entire string is in buffer, simply create a string out of it (copy)
std::size_t pos = buffer->getPosition();
@ -339,8 +339,8 @@ bool discoverServers(double timeOut)
sendBuffer.putByte(PVA_MAGIC);
sendBuffer.putByte(PVA_CLIENT_PROTOCOL_REVISION);
sendBuffer.putByte((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00); // data + 7-bit endianess
sendBuffer.putByte((int8_t)CMD_SEARCH); // search
sendBuffer.putInt(4+1+3+16+2+1+2); // "zero" payload
sendBuffer.putByte((int8_t)CMD_SEARCH); // search
sendBuffer.putInt(4+1+3+16+2+1+2); // "zero" payload
sendBuffer.putInt(0); // sequenceId
sendBuffer.putByte((int8_t)0x81); // reply required // TODO unicast vs multicast; for now we mark ourselves as unicast
@ -351,8 +351,8 @@ bool discoverServers(double timeOut)
encodeAsIPv6Address(&sendBuffer, &responseAddress);
sendBuffer.putShort((int16_t)ntohs(responseAddress.ia.sin_port));
sendBuffer.putByte((int8_t)0x00); // protocol count
sendBuffer.putShort((int16_t)0); // name count
sendBuffer.putByte((int8_t)0x00); // protocol count
sendBuffer.putShort((int16_t)0); // name count
bool oneOK = false;
for (size_t i = 0; i < broadcastAddresses.size(); i++)
@ -503,16 +503,16 @@ void usage (void)
/*+**************************************************************************
*
* Function: main
* Function: main
*
* Description: pvlist main()
* Evaluate command line options, ...
* Description: pvlist main()
* Evaluate command line options, ...
*
* Arg(s) In: [options] [<server>]...
* Arg(s) In: [options] [<server>]...
*
* Arg(s) Out: none
* Arg(s) Out: none
*
* Return(s): Standard return code (0=success, 1=error)
* Return(s): Standard return code (0=success, 1=error)
*
**************************************************************************-*/

View File

@ -35,8 +35,8 @@ typedef std::tr1::shared_ptr<ValueAlarmDbd> ValueAlarmDbdPtr;
struct CaAlarm
{
dbr_short_t status;
dbr_short_t severity;
dbr_short_t status;
dbr_short_t severity;
CaAlarm() : status(0), severity(0) {}
};

View File

@ -26,7 +26,7 @@
#ifdef monitorEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef monitorEpicsExportSharedSymbols
# undef monitorEpicsExportSharedSymbols
#endif
#include <pv/requester.h>

View File

@ -22,7 +22,7 @@
#ifdef pvAccessEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef pvAccessEpicsExportSharedSymbols
# undef pvAccessEpicsExportSharedSymbols
#endif
#include <pv/pvaVersion.h>

View File

@ -16,7 +16,7 @@
#ifdef pipelineServerEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef pipelineServerEpicsExportSharedSymbols
# undef pipelineServerEpicsExportSharedSymbols
#endif
#include <pv/pvAccess.h>

View File

@ -19,7 +19,7 @@
#ifdef pipelineServiceEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef pipelineServiceEpicsExportSharedSymbols
# undef pipelineServiceEpicsExportSharedSymbols
#endif
#include <pv/pvAccess.h>

View File

@ -18,7 +18,7 @@
#ifdef pvaConstantsepicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef pvaConstantsepicsExportSharedSymbols
# undef pvaConstantsepicsExportSharedSymbols
#endif
#include <shareLib.h>

View File

@ -17,7 +17,7 @@
#ifdef pvaVersionEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef pvaVersionEpicsExportSharedSymbols
# undef pvaVersionEpicsExportSharedSymbols
#endif
#include <shareLib.h>
@ -38,12 +38,12 @@ class epicsShareClass Version {
public:
/**
* Default constructor.
* @param productName product name.
* @param implementationLangugage implementation language.
* @param majorVersion major version.
* @param minorVersion minor version.
* @param maintenanceVersion maintenance version.
* @param developmentFlag development indicator flag.
* @param productName product name.
* @param implementationLangugage implementation language.
* @param majorVersion major version.
* @param minorVersion minor version.
* @param maintenanceVersion maintenance version.
* @param developmentFlag development indicator flag.
*/
Version(std::string const & productName,
std::string const & implementationLangugage,

View File

@ -209,7 +209,7 @@ void ChannelSearchManager::initializeSendBuffer()
m_sendBuffer.putByte(PVA_CLIENT_PROTOCOL_REVISION);
m_sendBuffer.putByte((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00); // data + 7-bit endianess
m_sendBuffer.putByte(CMD_SEARCH);
m_sendBuffer.putInt(4+1+3+16+2+1); // "zero" payload
m_sendBuffer.putInt(4+1+3+16+2+1); // "zero" payload
m_sendBuffer.putInt(m_sequenceNumber);
// multicast vs unicast mask
@ -230,7 +230,7 @@ void ChannelSearchManager::initializeSendBuffer()
MockTransportSendControl control;
SerializeHelper::serializeString("tcp", &m_sendBuffer, &control);
m_sendBuffer.putShort((int16_t)0); // count
m_sendBuffer.putShort((int16_t)0); // count
}
void ChannelSearchManager::flushSendBuffer()

View File

@ -363,7 +363,7 @@ bool AbstractCodec::readToBuffer(
}
// assumption: remainingBytes < MAX_ENSURE_DATA_BUFFER_SIZE &&
// requiredBytes < (socketBuffer.capacity() - 1)
// requiredBytes < (socketBuffer.capacity() - 1)
//
// copy unread part to the beginning of the buffer
@ -427,7 +427,7 @@ void AbstractCodec::ensureData(std::size_t size) {
return;
// to large for buffer...
if (size > MAX_ENSURE_DATA_SIZE) {// half for SPLIT, half for SEGMENTED
if (size > MAX_ENSURE_DATA_SIZE) {// half for SPLIT, half for SEGMENTED
std::ostringstream msg;
msg << "requested for buffer size " << size
<< ", but maximum " << MAX_ENSURE_DATA_SIZE << " is allowed.";
@ -471,7 +471,7 @@ void AbstractCodec::ensureData(std::size_t size) {
{
// TODO check flags
//if (flags && SEGMENTED_FLAGS_MASK == 0)
// throw IllegalStateException("segmented message expected,
// throw IllegalStateException("segmented message expected,
//but current message flag does not indicate it");
@ -596,15 +596,15 @@ void AbstractCodec::startMessage(
std::size_t ensureCapacity,
epics::pvData::int32 payloadSize) {
_lastMessageStartPosition =
std::numeric_limits<size_t>::max(); // TODO revise this
std::numeric_limits<size_t>::max(); // TODO revise this
ensureBuffer(
PVA_MESSAGE_HEADER_SIZE + ensureCapacity + _nextMessagePayloadOffset);
_lastMessageStartPosition = _sendBuffer.getPosition();
_sendBuffer.putByte(PVA_MAGIC);
_sendBuffer.putByte(_clientServerFlag ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION);
_sendBuffer.putByte(
(_lastSegmentedMessageType | _byteOrderFlag | _clientServerFlag)); // data message
_sendBuffer.putByte(command); // command
(_lastSegmentedMessageType | _byteOrderFlag | _clientServerFlag)); // data message
_sendBuffer.putByte(command); // command
_sendBuffer.putInt(payloadSize);
// apply offset
@ -619,13 +619,13 @@ void AbstractCodec::putControlMessage(
epics::pvData::int32 data) {
_lastMessageStartPosition =
std::numeric_limits<size_t>::max(); // TODO revise this
std::numeric_limits<size_t>::max(); // TODO revise this
ensureBuffer(PVA_MESSAGE_HEADER_SIZE);
_sendBuffer.putByte(PVA_MAGIC);
_sendBuffer.putByte(_clientServerFlag ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION);
_sendBuffer.putByte((0x01 | _byteOrderFlag | _clientServerFlag)); // control message
_sendBuffer.putByte(command); // command
_sendBuffer.putInt(data); // data
_sendBuffer.putByte((0x01 | _byteOrderFlag | _clientServerFlag)); // control message
_sendBuffer.putByte(command); // command
_sendBuffer.putInt(data); // data
}
@ -687,8 +687,8 @@ void AbstractCodec::endMessage(bool hasMoreSegments) {
{
sendBuffer.put(PVAConstants.PVA_MAGIC);
sendBuffer.put(PVAConstants.PVA_VERSION);
sendBuffer.put((byte)(0x01 | byteOrderFlag)); // control data
sendBuffer.put((byte)0); // marker
sendBuffer.put((byte)(0x01 | byteOrderFlag)); // control data
sendBuffer.put((byte)0); // marker
sendBuffer.putInt((int)(totalBytesSent + position +
PVAConstants.PVA_MESSAGE_HEADER_SIZE));
nextMarkerPosition = position + markerPeriodBytes;
@ -845,9 +845,9 @@ void AbstractCodec::processSendQueue()
if (_sendBuffer.getPosition() > 0)
flush(true);
sendCompleted(); // do not schedule sending
sendCompleted(); // do not schedule sending
if (terminated()) // termination
if (terminated()) // termination
break;
// termination (we want to process even if shutdown)
_sendQueue.pop_front(sender);
@ -1528,8 +1528,8 @@ void BlockingServerTCPTransportCodec::send(ByteBuffer* buffer,
buffer->putByte(PVA_SERVER_PROTOCOL_REVISION);
buffer->putByte(
0x01 | 0x40 | ((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG)
? 0x80 : 0x00)); // control + server + endian
buffer->putByte(CMD_SET_ENDIANESS); // set byte order
? 0x80 : 0x00)); // control + server + endian
buffer->putByte(CMD_SET_ENDIANESS); // set byte order
buffer->putInt(0);

View File

@ -19,7 +19,7 @@
#ifdef beaconHandlerEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef beaconHandlerEpicsExportSharedSymbols
# undef beaconHandlerEpicsExportSharedSymbols
#endif
#include <pv/pvaDefs.h>

View File

@ -29,7 +29,7 @@
#ifdef blockingTCPEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef blockingTCPEpicsExportSharedSymbols
# undef blockingTCPEpicsExportSharedSymbols
#endif
#include <pv/pvaConstants.h>

View File

@ -24,7 +24,7 @@
#ifdef blockingUDPEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef blockingUDPEpicsExportSharedSymbols
# undef blockingUDPEpicsExportSharedSymbols
#endif
#include <shareLib.h>

View File

@ -16,7 +16,7 @@
#ifdef channelSearchManagerEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef channelSearchManagerEpicsExportSharedSymbols
# undef channelSearchManagerEpicsExportSharedSymbols
#endif
#include <pv/pvaDefs.h>
@ -43,8 +43,8 @@ public:
/**
* Search response from server (channel found).
* @param guid server GUID.
* @param minorRevision server minor PVA revision.
* @param serverAddress server address.
* @param minorRevision server minor PVA revision.
* @param serverAddress server address.
*/
// TODO make serverAddress an URI or similar
virtual void searchResponse(const ServerGUID & guid, int8_t minorRevision, osiSockAddr* serverAddress) = 0;
@ -81,10 +81,10 @@ public:
/**
* Search response from server (channel found).
* @param guid server GUID.
* @param cid client channel ID.
* @param seqNo search sequence number.
* @param minorRevision server minor PVA revision.
* @param serverAddress server address.
* @param cid client channel ID.
* @param seqNo search sequence number.
* @param minorRevision server minor PVA revision.
* @param serverAddress server address.
*/
void searchResponse(const ServerGUID & guid, pvAccessID cid, int32_t seqNo, int8_t minorRevision, osiSockAddr* serverAddress);
/**

View File

@ -26,7 +26,7 @@
#ifdef remoteEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef remoteEpicsExportSharedSymbols
# undef remoteEpicsExportSharedSymbols
#endif
#include <pv/pvaConstants.h>

View File

@ -88,7 +88,7 @@
#ifdef securityEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef securityEpicsExportSharedSymbols
# undef securityEpicsExportSharedSymbols
#endif
#include <pv/pvaDefs.h>

View File

@ -38,7 +38,7 @@ public:
* @param payloadBuffer data buffer.
* @param control deserialization control.
* @param existingStructure if deserialized Field matches <code>existingStrcuture</code> Field, then
* <code>existingStructure</code> instance is returned. <code>null</code> value is allowed.
* <code>existingStructure</code> instance is returned. <code>null</code> value is allowed.
* @return PVStructure instance, can be <code>null</code>.
*/
static epics::pvData::PVStructure::shared_pointer deserializeStructureAndCreatePVStructure(epics::pvData::ByteBuffer* payloadBuffer,

View File

@ -26,7 +26,7 @@
#ifdef transportRegistryEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef transportRegistryEpicsExportSharedSymbols
# undef transportRegistryEpicsExportSharedSymbols
#endif
#include <pv/remote.h>

View File

@ -16,7 +16,7 @@
#ifdef clientContextImplEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef clientContextImplEpicsExportSharedSymbols
# undef clientContextImplEpicsExportSharedSymbols
#endif
#include <pv/pvAccess.h>

View File

@ -17,7 +17,7 @@
#include <pv/valueBuilder.h>
#ifdef rpcClientEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef rpcClientEpicsExportSharedSymbols
# undef rpcClientEpicsExportSharedSymbols
#endif
#include <pv/rpcService.h>

View File

@ -16,7 +16,7 @@
#ifdef rpcServerEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef rpcServerEpicsExportSharedSymbols
# undef rpcServerEpicsExportSharedSymbols
#endif
#include <pv/pvAccess.h>

View File

@ -19,7 +19,7 @@
#ifdef rpcServiceEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef rpcServiceEpicsExportSharedSymbols
# undef rpcServiceEpicsExportSharedSymbols
#endif
#include <pv/pvAccess.h>

View File

@ -20,7 +20,7 @@
#ifdef beaconEmitterEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef beaconEmitterEpicsExportSharedSymbols
# undef beaconEmitterEpicsExportSharedSymbols
#endif
#include <pv/remote.h>
@ -49,10 +49,10 @@ public:
/**
* Constructor.
* @param protocol a protocol (transport) name to report.
* @param transport transport to be used to send beacons.
* @param transport transport to be used to send beacons.
* @param context PVA context.
*/
// BeaconEmitter(std::sting const & protocol,
// BeaconEmitter(std::sting const & protocol,
// Transport::shared_pointer const & transport, ServerContextImpl::shared_pointer const & context);
BeaconEmitter(std::string const & protocol,
Transport::shared_pointer const & transport, std::tr1::shared_ptr<ServerContextImpl>& context);

View File

@ -54,7 +54,7 @@ public:
* Constructor.
* @param context PVA context.
*/
// DefaultBeaconServerStatusProvider(ServerContext::shared_pointer const & context);
// DefaultBeaconServerStatusProvider(ServerContext::shared_pointer const & context);
DefaultBeaconServerStatusProvider(std::tr1::shared_ptr<ServerContext> const & context);
/**
* Destructor.

View File

@ -48,8 +48,8 @@ public:
/**
* Run server (process events).
* @param seconds time in seconds the server will process events (method will block), if <code>0</code>
* the method would block until <code>destroy()</code> is called.
* @param seconds time in seconds the server will process events (method will block), if <code>0</code>
* the method would block until <code>destroy()</code> is called.
* @throws BaseException if server is already destroyed.
*/
virtual void run(epics::pvData::uint32 seconds) = 0;

View File

@ -10,7 +10,7 @@
#ifdef serverContextImplEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef serverContextImplEpicsExportSharedSymbols
# undef serverContextImplEpicsExportSharedSymbols
#endif
#include <pv/blockingUDP.h>

View File

@ -1072,28 +1072,28 @@ void ServerGetHandler::handleResponse(osiSockAddr* responseFrom,
} \
catch (std::exception &e) { \
Status status(Status::STATUSTYPE_FATAL, e.what()); \
BaseChannelRequester::sendFailureMessage((int8)cmd, _transport, _ioid, (int8)QOS_INIT, status); \
destroy(); \
BaseChannelRequester::sendFailureMessage((int8)cmd, _transport, _ioid, (int8)QOS_INIT, status); \
destroy(); \
} \
catch (...) { \
Status status(Status::STATUSTYPE_FATAL, "unknown exception caught"); \
BaseChannelRequester::sendFailureMessage((int8)cmd, _transport, _ioid, (int8)QOS_INIT, status); \
destroy(); \
BaseChannelRequester::sendFailureMessage((int8)cmd, _transport, _ioid, (int8)QOS_INIT, status); \
destroy(); \
}
#define DESERIALIZE_EXCEPTION_GUARD(code) \
try { \
code; \
code; \
} \
catch (std::exception &e) { \
Status status(Status::STATUSTYPE_ERROR, e.what()); \
BaseChannelRequester::sendFailureMessage((int8)command, transport, ioid, qosCode, status); \
throw; \
BaseChannelRequester::sendFailureMessage((int8)command, transport, ioid, qosCode, status); \
throw; \
} \
catch (...) { \
Status status(Status::STATUSTYPE_ERROR, "unknown exception caught"); \
BaseChannelRequester::sendFailureMessage((int8)command, transport, ioid, qosCode, status); \
throw; \
BaseChannelRequester::sendFailureMessage((int8)command, transport, ioid, qosCode, status); \
throw; \
}
ServerChannelGetRequesterImpl::ServerChannelGetRequesterImpl(ServerContextImpl::shared_pointer const & context, ServerChannel::shared_pointer const & channel, const pvAccessID ioid, Transport::shared_pointer const & transport) :
@ -1835,8 +1835,8 @@ void ServerMonitorHandler::handleResponse(osiSockAddr* responseFrom,
/*
if (!request->startRequest(qosCode))
{
BaseChannelRequester::sendFailureMessage((int8)CMD_MONITOR, transport, ioid, qosCode, BaseChannelRequester::otherRequestPendingStatus);
return;
BaseChannelRequester::sendFailureMessage((int8)CMD_MONITOR, transport, ioid, qosCode, BaseChannelRequester::otherRequestPendingStatus);
return;
}
*/

View File

@ -361,13 +361,13 @@ int discoverInterfaces(IfaceNodeVector &list, SOCKET socket, const osiSockAddr *
int discoverInterfaces(IfaceNodeVector &list, SOCKET socket, const osiSockAddr *pMatchAddr)
{
int status;
int status;
INTERFACE_INFO *pIfinfo;
INTERFACE_INFO *pIfinfoList;
unsigned nelem;
int numifs;
DWORD cbBytesReturned;
int match;
unsigned nelem;
int numifs;
DWORD cbBytesReturned;
int match;
/* only valid for winsock 2 and above
TODO resolve dllimport compilation problem and uncomment this check

View File

@ -91,7 +91,7 @@ void IntrospectionRegistry::serialize(FieldConstPtr const & field, ByteBuffer* b
}
else {
control->ensureBuffer(3);
buffer->putByte(FULL_WITH_ID_TYPE_CODE); // could also be a mask
buffer->putByte(FULL_WITH_ID_TYPE_CODE); // could also be a mask
buffer->putShort(key);
}
}

View File

@ -16,7 +16,7 @@
#include <pv/pvType.h>
#ifdef hexDumpEpicsExportSharedSymbols
#ifdef hexDumpEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef hexDumpEpicsExportSharedSymbols
#endif

View File

@ -26,7 +26,7 @@
#ifdef introspectionRegistryEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef introspectionRegistryEpicsExportSharedSymbols
# undef introspectionRegistryEpicsExportSharedSymbols
#endif
// TODO check for memory leaks

View File

@ -18,7 +18,7 @@
#ifdef referenceCountingLockEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef referenceCountingLockEpicsExportSharedSymbols
# undef referenceCountingLockEpicsExportSharedSymbols
#endif
namespace epics {
@ -52,11 +52,11 @@ public:
* NOTE: Argument msecs is currently not supported due to
* Darwin OS not supporting pthread_mutex_timedlock. May be changed in the future.
*
* @param msecs the number of milleseconds to wait.
* An argument less than or equal to zero means not to wait at all.
* @param msecs the number of milleseconds to wait.
* An argument less than or equal to zero means not to wait at all.
*
* @return <code>true</code> if acquired, <code>false</code> otherwise.
* NOTE: currently this routine always returns true. Look above for explanation.
* @return <code>true</code> if acquired, <code>false</code> otherwise.
* NOTE: currently this routine always returns true. Look above for explanation.
*
*/
bool acquire(epics::pvData::int64 msecs);

View File

@ -20,7 +20,7 @@
#ifdef requesterEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef requesterEpicsExportSharedSymbols
# undef requesterEpicsExportSharedSymbols
#endif

View File

@ -14,71 +14,71 @@ using namespace epics::pvData;
ReferenceCountingLock::ReferenceCountingLock(): _references(1)
{
/* pthread_mutexattr_t mutexAttribute;
int32 retval = pthread_mutexattr_init(&mutexAttribute);
if(retval != 0)
{
//string errMsg = "Error: pthread_mutexattr_init failed: " + string(strerror(retval));
assert(false);
}
retval = pthread_mutexattr_settype(&mutexAttribute, PTHREAD_MUTEX_RECURSIVE);
if(retval == 0)
{
retval = pthread_mutex_init(_mutex, &mutexAttribute);
if(retval != 0)
{
//string errMsg = "Error: pthread_mutex_init failed: " + string(strerror(retval));
assert(false);
}
}
else
{
//string errMsg = "Error: pthread_mutexattr_settype failed: " + string(strerror(retval));
assert(false);
}
/* pthread_mutexattr_t mutexAttribute;
int32 retval = pthread_mutexattr_init(&mutexAttribute);
if(retval != 0)
{
//string errMsg = "Error: pthread_mutexattr_init failed: " + string(strerror(retval));
assert(false);
}
retval = pthread_mutexattr_settype(&mutexAttribute, PTHREAD_MUTEX_RECURSIVE);
if(retval == 0)
{
retval = pthread_mutex_init(_mutex, &mutexAttribute);
if(retval != 0)
{
//string errMsg = "Error: pthread_mutex_init failed: " + string(strerror(retval));
assert(false);
}
}
else
{
//string errMsg = "Error: pthread_mutexattr_settype failed: " + string(strerror(retval));
assert(false);
}
pthread_mutexattr_destroy(&mutexAttribute);*/
pthread_mutexattr_destroy(&mutexAttribute);*/
}
ReferenceCountingLock::~ReferenceCountingLock()
{
// pthread_mutex_destroy(_mutex);
// pthread_mutex_destroy(_mutex);
}
bool ReferenceCountingLock::acquire(int64 /*msecs*/)
{
_mutex.lock();
return true;
/* struct timespec deltatime;
if(msecs > 0)
{
deltatime.tv_sec = msecs / 1000;
deltatime.tv_nsec = (msecs % 1000) * 1000;
}
else
{
deltatime.tv_sec = 0;
deltatime.tv_nsec = 0;
}
/* struct timespec deltatime;
if(msecs > 0)
{
deltatime.tv_sec = msecs / 1000;
deltatime.tv_nsec = (msecs % 1000) * 1000;
}
else
{
deltatime.tv_sec = 0;
deltatime.tv_nsec = 0;
}
int32 retval = pthread_mutex_timedlock(_mutex, &deltatime);
if(retval == 0)
{
return true;
}
return false;
int32 retval = pthread_mutex_timedlock(_mutex, &deltatime);
if(retval == 0)
{
return true;
}
return false;
*/
}
void ReferenceCountingLock::release()
{
_mutex.unlock();
/* int retval = pthread_mutex_unlock(_mutex);
if(retval != 0)
{
//string errMsg = "Error: pthread_mutex_unlock failed: " + string(strerror(retval));
//TODO do something?
}*/
/* int retval = pthread_mutex_unlock(_mutex);
if(retval != 0)
{
//string errMsg = "Error: pthread_mutex_unlock failed: " + string(strerror(retval));
//TODO do something?
}*/
}
// TODO use atomic primitive impl.

View File

@ -54,7 +54,7 @@ const std::string ChannelAccessIFTest::TEST_ARRAY_CHANNEL_NAME = "testArray1";
template <typename T>
inline bool compareWithTol(const T v1, const T v2, const T tol)
{
return (std::fabs(v1 - v2) <= tol);
return (std::fabs(v1 - v2) <= tol);
}
int ChannelAccessIFTest::runAllTest() {

View File

@ -138,7 +138,7 @@ public:
std::size_t startPos = _readBuffer->getPosition();
//buffer.put(readBuffer);
//while (buffer.hasRemaining() && readBuffer.hasRemaining())
// buffer.put(readBuffer.get());
// buffer.put(readBuffer.get());
std::size_t bufferRemaining = buffer->getRemaining();
std::size_t readBufferRemaining =
@ -164,7 +164,7 @@ public:
int write(ByteBuffer *buffer) {
if (_disconnected)
return -1; // TODO: not by the JavaDoc API spec
return -1; // TODO: not by the JavaDoc API spec
if (_throwExceptionOnSend)
throw io_exception("text IO exception");
@ -1312,7 +1312,7 @@ private:
{
testDiag("BEGIN TEST %s:", CURRENT_FUNCTION);
for (int32_t firstMessagePayloadSize = 1; // cannot be zero
for (int32_t firstMessagePayloadSize = 1; // cannot be zero
firstMessagePayloadSize <= 3;
firstMessagePayloadSize++)
{
@ -1763,7 +1763,7 @@ private:
{
testDiag("BEGIN TEST %s:", CURRENT_FUNCTION);
for (int32_t firstMessagePayloadSize = 1; // cannot be zero
for (int32_t firstMessagePayloadSize = 1; // cannot be zero
firstMessagePayloadSize <= 3;
firstMessagePayloadSize++)
{
@ -1925,7 +1925,7 @@ private:
testDiag("BEGIN TEST %s:", CURRENT_FUNCTION);
for (int32_t firstMessagePayloadSize = 1; // cannot be zero
for (int32_t firstMessagePayloadSize = 1; // cannot be zero
firstMessagePayloadSize <= 3;
firstMessagePayloadSize++)
{
@ -2566,7 +2566,7 @@ private:
void writePollOne() {
testDiag("In %s", CURRENT_FUNCTION);
_codec.processWrite(); // this should return immediately
_codec.processWrite(); // this should return immediately
// now we fake reading
_codec._writeBuffer.flip();

View File

@ -204,7 +204,7 @@ public:
printf("%d %d %d %d %.3f\n", channels, arraySize, iterations, runs, sum/runs);
Lock guard(waitLoopPtrMutex);
waitLoopEvent->signal(); // all done
waitLoopEvent->signal(); // all done
}
}
else if (channelCount == 0)

View File

@ -196,7 +196,7 @@ public:
printf("%d %d %d %d %.3f\n", channels, arraySize, iterations, runs, sum/runs);
Lock guard(waitLoopPtrMutex);
waitLoopEvent->signal(); // all done
waitLoopEvent->signal(); // all done
}
}
else if (channelCount == 0)

View File

@ -2503,7 +2503,7 @@ private:
};
class MockServerChannelProvider : public ChannelProvider,
class MockServerChannelProvider : public ChannelProvider,
public std::tr1::enable_shared_from_this<MockServerChannelProvider>
{
public: