compile warnings: signed vs unsigned and unused (#4713)

This commit is contained in:
Andrey G 2022-10-30 16:47:53 +03:00 committed by GitHub
parent d897316f1b
commit cc9b1517ac
15 changed files with 15 additions and 23 deletions

View File

@ -24,7 +24,6 @@ static Pid alternatorPid(&persistentState.persistentConfiguration.engineConfigur
static percent_t currentAltDuty;
static bool currentPlainOnOffState = false;
static bool shouldResetPid = false;
static void pidReset() {

View File

@ -15,7 +15,7 @@ static void setDefaultAlternatorParameters() {
/* Cylinder to bank mapping */
void setLeftRightBanksNeedBetterName() {
for (int i = 0;i<engineConfiguration->specs.cylindersCount;i++) {
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
engineConfiguration->cylinderBankSelect[i] = i % 2;
}
}

View File

@ -3,7 +3,7 @@
#include "odometer.h"
static odometer_state odometerCopies[2];
//static odometer_state odometerCopies[2];
void setCrc(odometer_state *state) {
state->crc = crc32(state, 4);

View File

@ -39,8 +39,6 @@ int isIgnitionTimingError(void) {
}
static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *output) {
efitick_t nowNt = getTimeNowNt();
#if SPARK_EXTREME_LOGGING
efiPrintf("spark goes low %d %s %d current=%d cnt=%d id=%d", getRevolutionCounter(), output->name, (int)getTimeNowUs(),
output->currentLogicValue, output->outOfOrder, event->sparkId);

View File

@ -12,7 +12,7 @@ CanFilter* getFilterForId(size_t busIndex, int Id) {
auto& filter = filters[i];
if (filter.accept(Id)) {
if (filter.Bus == ANY_BUS || filter.Bus == busIndex) {
if (filter.Bus == ANY_BUS || filter.Bus == (int)busIndex) {
return &filter;
}
}

View File

@ -35,7 +35,7 @@ bool AemXSeriesWideband::acceptFrame(const CANRxFrame& frame) const {
}
void AemXSeriesWideband::decodeFrame(const CANRxFrame& frame, efitick_t nowNt) {
int32_t id = CAN_ID(frame);
uint32_t id = CAN_ID(frame);
// accept frame has already guaranteed that this message belongs to us
// We just have to check if it's AEM or rusEFI

View File

@ -172,7 +172,7 @@ void SensorChecker::onSlowCallback() {
// only bother checking these if we have GPIO chips actually capable of reporting an error
#if BOARD_EXT_GPIOCHIPS > 0 && EFI_PROD_CODE
// Check injectors
for (int i = 0; i < efi::size(enginePins.injectors); i++) {
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
InjectorOutputPin& pin = enginePins.injectors[i];
// Skip not-configured pins
@ -191,7 +191,7 @@ void SensorChecker::onSlowCallback() {
}
// Check ignition
for (int i = 0; i < efi::size(enginePins.injectors); i++) {
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
IgnitionOutputPin& pin = enginePins.coils[i];
// Skip not-configured pins

View File

@ -185,7 +185,7 @@ float AngleBasedEventOld::getAngleFromNow(float /*currentPhase*/) const {
return position.angleOffsetFromTriggerEvent;
}
bool AngleBasedEventNew::shouldSchedule(uint32_t trgEventIndex, float currentPhase, float nextPhase) const {
bool AngleBasedEventNew::shouldSchedule(uint32_t /*trgEventIndex*/, float currentPhase, float nextPhase) const {
return isPhaseInRange(this->enginePhase, currentPhase, nextPhase);
}

View File

@ -15,7 +15,7 @@
void TransmissionControllerBase::init() {
}
void TransmissionControllerBase::update(gear_e gear) {
void TransmissionControllerBase::update(gear_e /*gear*/) {
postState();
}

View File

@ -130,7 +130,7 @@ void initializeVvt3A92(TriggerWaveform *s) {
s->setSecondTriggerSynchronizationGap(0.11); // redundancy
}
void initializeVvt6G75(TriggerWaveform *s) {
void initializeVvt6G75(TriggerWaveform /* *s */) {
// s->shapeWithoutTdc = true;
// s->isSynchronizationNeeded = false;
}

View File

@ -279,8 +279,6 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
#endif /* EFI_TOOTH_LOGGER */
}
const auto& vvtShape = tc->vvtShape[camIndex];
bool isImportantFront = (engineConfiguration->vvtCamSensorUseRise ^ (front == TriggerValue::FALL));
bool isVvtWithRealDecoder = vvtWithRealDecoder(engineConfiguration->vvtMode[camIndex]);
if (!isVvtWithRealDecoder && !isImportantFront) {

View File

@ -241,7 +241,7 @@ void PrimaryTriggerDecoder::movePreSynchTimestamps() {
// at appropriate locations
auto triggerSize = getTriggerCentral()->triggerShape.getLength();
int eventsToCopy = minI(spinningEventIndex, triggerSize);
size_t eventsToCopy = minI(spinningEventIndex, triggerSize);
size_t firstSrc;
size_t firstDst;
@ -649,9 +649,6 @@ expected<TriggerDecodeResult> TriggerDecoderBase::decodeTriggerEvent(
if (verbose || (someSortOfTriggerError() && !silentTriggerError)) {
const char * prefix = verbose ? "[vrb]" : "[err]";
int rpm = Sensor::getOrZero(SensorType::Rpm);
floatms_t engineCycleDuration = getEngineCycleDuration(rpm);
for (int i = 0;i<triggerShape.gapTrackingLength;i++) {
float ratioFrom = triggerShape.syncronizationRatioFrom[i];
if (cisnan(ratioFrom)) {

View File

@ -208,7 +208,7 @@ public:
*/
uint32_t timeOfLastEvent[PWM_PHASE_MAX_COUNT];
int spinningEventIndex = 0;
size_t spinningEventIndex = 0;
// we might need up to one full trigger cycle of events - which on 60-2 means storage for ~120
// todo: change the implementation to reuse 'timeOfLastEvent'

View File

@ -114,7 +114,7 @@ void WaveReader::onFallEvent() {
periodEventTimeUs = nowUs;
}
void logicAnalyzerCallback(void* arg, efitick_t stamp) {
void logicAnalyzerCallback(void* arg, efitick_t /*stamp*/) {
WaveReader* instance = reinterpret_cast<WaveReader*>(arg);
bool rise = palReadLine(instance->line) == PAL_HIGH;
@ -126,7 +126,7 @@ void logicAnalyzerCallback(void* arg, efitick_t stamp) {
}
}
static void initWave(int index) {
static void initWave(size_t index) {
brain_pin_e brainPin = engineConfiguration->logicAnalyzerPins[index];
efiAssertVoid(CUSTOM_ERR_6655, index < efi::size(readers), "too many ICUs");
@ -242,7 +242,7 @@ void initWaveAnalyzer() {
}
void startLogicAnalyzerPins() {
for (int index = 0; index < LOGIC_ANALYZER_CHANNEL_COUNT; index++) {
for (size_t index = 0; index < LOGIC_ANALYZER_CHANNEL_COUNT; index++) {
initWave(index);
}
}

View File

@ -256,7 +256,7 @@ static void endIntegration(HIP9011 *hip) {
}
}
void onStartKnockSampling(uint8_t cylinderIndex, float samplingTimeSeconds, uint8_t channelIdx) {
void onStartKnockSampling(uint8_t /*cylinderIndex*/, float /*samplingTimeSeconds*/, uint8_t /*channelIdx*/) {
/* TODO: @dron0gus: not sure if we need the expectedCylinderNumber logic at all
Something like this might be right: