unsigned/size_t/shared ptrs

This commit is contained in:
Matej Sekoranja
2012-06-15 14:47:16 +02:00
parent 7307529f7f
commit 4b5bc38835
31 changed files with 742 additions and 543 deletions
+5 -4
View File
@@ -141,7 +141,7 @@ namespace epics {
}
}
void BlockingUDPTransport::startMessage(int8 command, int ensureCapacity) {
void BlockingUDPTransport::startMessage(int8 command, size_t ensureCapacity) {
_lastMessageStartPosition = _sendBuffer->getPosition();
_sendBuffer->putByte(CA_MAGIC);
_sendBuffer->putByte(CA_VERSION);
@@ -276,11 +276,12 @@ namespace epics {
// command ID and paylaod
int8 command = receiveBuffer->getByte();
int payloadSize = receiveBuffer->getInt();
int nextRequestPosition = receiveBuffer->getPosition() + payloadSize;
// TODO check this cast (size_t must be 32-bit)
size_t payloadSize = receiveBuffer->getInt();
size_t nextRequestPosition = receiveBuffer->getPosition() + payloadSize;
// payload size check
if(unlikely(nextRequestPosition>(int)receiveBuffer->getLimit())) return false;
if(unlikely(nextRequestPosition>receiveBuffer->getLimit())) return false;
// handle
_responseHandler->handleResponse(&fromAddress, thisTransport,