memset is neither intent-expressive nor type safe
This commit is contained in:
parent
83102d2e8e
commit
272226104d
|
@ -71,14 +71,14 @@ void TriggerWaveform::initialize(operation_mode_e p_operationMode, SyncEdge p_sy
|
||||||
useOnlyPrimaryForSync = false;
|
useOnlyPrimaryForSync = false;
|
||||||
|
|
||||||
triggerShapeSynchPointIndex = 0;
|
triggerShapeSynchPointIndex = 0;
|
||||||
memset(expectedEventCount, 0, sizeof(expectedEventCount));
|
setArrayValues(expectedEventCount, 0);
|
||||||
wave.reset();
|
wave.reset();
|
||||||
wave.waveCount = TRIGGER_INPUT_PIN_COUNT;
|
wave.waveCount = TRIGGER_INPUT_PIN_COUNT;
|
||||||
wave.phaseCount = 0;
|
wave.phaseCount = 0;
|
||||||
previousAngle = 0;
|
previousAngle = 0;
|
||||||
memset(isRiseEvent, 0, sizeof(isRiseEvent));
|
setArrayValues(isRiseEvent, 0);
|
||||||
#if EFI_UNIT_TEST
|
#if EFI_UNIT_TEST
|
||||||
memset(&triggerSignalIndeces, 0, sizeof(triggerSignalIndeces));
|
memset(triggerSignalIndeces, 0, sizeof(triggerSignalIndeces));
|
||||||
memset(&triggerSignalStates, 0, sizeof(triggerSignalStates));
|
memset(&triggerSignalStates, 0, sizeof(triggerSignalStates));
|
||||||
knownOperationMode = true;
|
knownOperationMode = true;
|
||||||
#endif // EFI_UNIT_TEST
|
#endif // EFI_UNIT_TEST
|
||||||
|
|
|
@ -27,8 +27,8 @@ public:
|
||||||
void movePreSynchTimestamps();
|
void movePreSynchTimestamps();
|
||||||
|
|
||||||
void resetInstantRpm() {
|
void resetInstantRpm() {
|
||||||
memset(timeOfLastEvent, 0, sizeof(timeOfLastEvent));
|
setArrayValues(timeOfLastEvent, 0);
|
||||||
memset(spinningEvents, 0, sizeof(spinningEvents));
|
setArrayValues(spinningEvents, 0);
|
||||||
spinningEventIndex = 0;
|
spinningEventIndex = 0;
|
||||||
prevInstantRpmValue = 0;
|
prevInstantRpmValue = 0;
|
||||||
m_instantRpm = 0;
|
m_instantRpm = 0;
|
||||||
|
|
|
@ -46,7 +46,7 @@ TriggerCentral::TriggerCentral() :
|
||||||
vvtPosition(),
|
vvtPosition(),
|
||||||
triggerState("TRG")
|
triggerState("TRG")
|
||||||
{
|
{
|
||||||
memset(&hwEventCounters, 0, sizeof(hwEventCounters));
|
setArrayValues(hwEventCounters, 0);
|
||||||
triggerState.resetState();
|
triggerState.resetState();
|
||||||
noiseFilter.resetAccumSignalData();
|
noiseFilter.resetAccumSignalData();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ void TriggerDecoderBase::resetState() {
|
||||||
setShaftSynchronized(false);
|
setShaftSynchronized(false);
|
||||||
toothed_previous_time = 0;
|
toothed_previous_time = 0;
|
||||||
|
|
||||||
memset(toothDurations, 0, sizeof(toothDurations));
|
setArrayValues(toothDurations, 0);
|
||||||
|
|
||||||
crankSynchronizationCounter = 0;
|
crankSynchronizationCounter = 0;
|
||||||
totalTriggerErrorCounter = 0;
|
totalTriggerErrorCounter = 0;
|
||||||
|
|
Loading…
Reference in New Issue