From 98597b98d7a67a2ac78458e9ef868156e5d710ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 20 Dec 2022 11:43:02 +0100 Subject: [PATCH] use memset for zeroing --- mission/controller/AcsController.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f9ea5926..1f215ded 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -219,10 +219,9 @@ void AcsController::performDetumble() { { PoolReadGuard pg(&actuatorCmdData); if (pg.getReadResult() == returnvalue::OK) { - int32_t zeroVec[4] = {0, 0, 0, 0}; - std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(double)); + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); actuatorCmdData.rwTargetTorque.setValid(false); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t)); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); actuatorCmdData.rwTargetSpeed.setValid(false); std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); actuatorCmdData.mtqTargetDipole.setValid(true);