From 9dcf0c711854aff22789f0bdcb5375bde51e74bd Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Fri, 3 Jul 2020 15:50:29 +0200 Subject: [PATCH] size_t for DataPoolAdmin --- datapoolglob/DataPoolAdmin.cpp | 8 ++++---- datapoolglob/DataPoolAdmin.h | 6 +++--- datapoolglob/PoolRawAccess.cpp | 2 +- datapoolglob/PoolRawAccess.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/datapoolglob/DataPoolAdmin.cpp b/datapoolglob/DataPoolAdmin.cpp index edbac6eb..4d0e5530 100644 --- a/datapoolglob/DataPoolAdmin.cpp +++ b/datapoolglob/DataPoolAdmin.cpp @@ -26,7 +26,7 @@ MessageQueueId_t DataPoolAdmin::getCommandQueue() const { } ReturnValue_t DataPoolAdmin::executeAction(ActionId_t actionId, - MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size) { + MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { if (actionId != SET_VALIDITY) { return INVALID_ACTION_ID; } @@ -91,7 +91,7 @@ void DataPoolAdmin::handleCommand() { } ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address, - const uint8_t* data, uint32_t size, uint8_t** dataPointer) { + const uint8_t* data, size_t size, uint8_t** dataPointer) { uint32_t poolId = glob::dataPool.PIDToDataPoolId(address); uint8_t arrayIndex = glob::dataPool.PIDToArrayIndex(address); GlobDataSet testSet; @@ -129,7 +129,7 @@ ReturnValue_t DataPoolAdmin::handleMemoryLoad(uint32_t address, return ACTIVITY_COMPLETED; } -ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, uint32_t size, +ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, size_t size, uint8_t** dataPointer, uint8_t* copyHere) { uint32_t poolId = glob::dataPool.PIDToDataPoolId(address); uint8_t arrayIndex = glob::dataPool.PIDToArrayIndex(address); @@ -151,7 +151,7 @@ ReturnValue_t DataPoolAdmin::handleMemoryDump(uint32_t address, uint32_t size, PoolVariableIF::VAR_READ); status = rawSet.read(); if (status == RETURN_OK) { - uint32_t temp = 0; + size_t temp = 0; status = variable.getEntryEndianSafe(ptrToCopy, &temp, size); if (status != RETURN_OK) { return RETURN_FAILED; diff --git a/datapoolglob/DataPoolAdmin.h b/datapoolglob/DataPoolAdmin.h index 5f995893..653fdd8e 100644 --- a/datapoolglob/DataPoolAdmin.h +++ b/datapoolglob/DataPoolAdmin.h @@ -30,12 +30,12 @@ public: MessageQueueId_t getCommandQueue() const; ReturnValue_t handleMemoryLoad(uint32_t address, const uint8_t* data, - uint32_t size, uint8_t** dataPointer); - ReturnValue_t handleMemoryDump(uint32_t address, uint32_t size, + size_t size, uint8_t** dataPointer); + ReturnValue_t handleMemoryDump(uint32_t address, size_t size, uint8_t** dataPointer, uint8_t* copyHere); ReturnValue_t executeAction(ActionId_t actionId, - MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size); + MessageQueueId_t commandedBy, const uint8_t* data, size_t size); //not implemented as ParameterHelper is no used ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId, diff --git a/datapoolglob/PoolRawAccess.cpp b/datapoolglob/PoolRawAccess.cpp index 4355cd0f..783418cc 100644 --- a/datapoolglob/PoolRawAccess.cpp +++ b/datapoolglob/PoolRawAccess.cpp @@ -121,7 +121,7 @@ uint8_t* PoolRawAccess::getEntry() { } ReturnValue_t PoolRawAccess::getEntryEndianSafe(uint8_t* buffer, - uint32_t* writtenBytes, uint32_t max_size) { + size_t* writtenBytes, size_t max_size) { uint8_t* data_ptr = getEntry(); // debug << "PoolRawAccess::getEntry: Array position: " << // index * size_of_type << " Size of T: " << (int)size_of_type << diff --git a/datapoolglob/PoolRawAccess.h b/datapoolglob/PoolRawAccess.h index f58efdd0..22dc312d 100644 --- a/datapoolglob/PoolRawAccess.h +++ b/datapoolglob/PoolRawAccess.h @@ -57,8 +57,8 @@ public: * @return - @c RETURN_OK if entry could be acquired * - @c RETURN_FAILED else. */ - ReturnValue_t getEntryEndianSafe(uint8_t* buffer, uint32_t* size, - uint32_t max_size); + ReturnValue_t getEntryEndianSafe(uint8_t *buffer, size_t *size, + size_t maxSize); /** * @brief Serialize raw pool entry into provided buffer directly