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;
|
||||
|
||||
triggerShapeSynchPointIndex = 0;
|
||||
memset(expectedEventCount, 0, sizeof(expectedEventCount));
|
||||
setArrayValues(expectedEventCount, 0);
|
||||
wave.reset();
|
||||
wave.waveCount = TRIGGER_INPUT_PIN_COUNT;
|
||||
wave.phaseCount = 0;
|
||||
previousAngle = 0;
|
||||
memset(isRiseEvent, 0, sizeof(isRiseEvent));
|
||||
setArrayValues(isRiseEvent, 0);
|
||||
#if EFI_UNIT_TEST
|
||||
memset(&triggerSignalIndeces, 0, sizeof(triggerSignalIndeces));
|
||||
memset(triggerSignalIndeces, 0, sizeof(triggerSignalIndeces));
|
||||
memset(&triggerSignalStates, 0, sizeof(triggerSignalStates));
|
||||
knownOperationMode = true;
|
||||
#endif // EFI_UNIT_TEST
|
||||
|
|
|
@ -27,8 +27,8 @@ public:
|
|||
void movePreSynchTimestamps();
|
||||
|
||||
void resetInstantRpm() {
|
||||
memset(timeOfLastEvent, 0, sizeof(timeOfLastEvent));
|
||||
memset(spinningEvents, 0, sizeof(spinningEvents));
|
||||
setArrayValues(timeOfLastEvent, 0);
|
||||
setArrayValues(spinningEvents, 0);
|
||||
spinningEventIndex = 0;
|
||||
prevInstantRpmValue = 0;
|
||||
m_instantRpm = 0;
|
||||
|
|
|
@ -46,7 +46,7 @@ TriggerCentral::TriggerCentral() :
|
|||
vvtPosition(),
|
||||
triggerState("TRG")
|
||||
{
|
||||
memset(&hwEventCounters, 0, sizeof(hwEventCounters));
|
||||
setArrayValues(hwEventCounters, 0);
|
||||
triggerState.resetState();
|
||||
noiseFilter.resetAccumSignalData();
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void TriggerDecoderBase::resetState() {
|
|||
setShaftSynchronized(false);
|
||||
toothed_previous_time = 0;
|
||||
|
||||
memset(toothDurations, 0, sizeof(toothDurations));
|
||||
setArrayValues(toothDurations, 0);
|
||||
|
||||
crankSynchronizationCounter = 0;
|
||||
totalTriggerErrorCounter = 0;
|
||||
|
|
Loading…
Reference in New Issue