mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-18 05:45:28 +03:00
Enable -Wstrict-prototypes
Also, fix all warnings shown when it's enabled
This commit is contained in:
parent
90a592e974
commit
ae01b3453a
12 changed files with 19 additions and 14 deletions
1
Makefile
1
Makefile
|
@ -223,6 +223,7 @@ CFLAGS += $(ARCH_FLAGS) \
|
|||
$(DEBUG_FLAGS) \
|
||||
-std=gnu99 \
|
||||
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
|
||||
-Wstrict-prototypes \
|
||||
-Werror=switch \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
|
|
|
@ -26,4 +26,4 @@
|
|||
extern CMS_Menu cmsx_menuVtxSmartAudio;
|
||||
|
||||
void saCmsUpdate(void);
|
||||
void saCmsResetOpmodel();
|
||||
void saCmsResetOpmodel(void);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#define RX_SPI_MAX_PAYLOAD_SIZE 32
|
||||
|
||||
void rxSpiDeviceInit();
|
||||
void rxSpiDeviceInit(void);
|
||||
uint8_t rxSpiTransferByte(uint8_t data);
|
||||
uint8_t rxSpiWriteByte(uint8_t data);
|
||||
uint8_t rxSpiWriteCommand(uint8_t command, uint8_t data);
|
||||
|
|
|
@ -39,6 +39,6 @@ void tryArm(void);
|
|||
disarmReason_t getDisarmReason(void);
|
||||
|
||||
bool isCalibrating(void);
|
||||
float getFlightTime();
|
||||
float getFlightTime(void);
|
||||
|
||||
void fcReboot(bool bootLoader);
|
|
@ -11,7 +11,7 @@ typedef struct statsConfig_s {
|
|||
uint8_t stats_enabled;
|
||||
} statsConfig_t;
|
||||
|
||||
uint32_t getFlyingEnergy();
|
||||
uint32_t getFlyingEnergy(void);
|
||||
void statsOnArm(void);
|
||||
void statsOnDisarm(void);
|
||||
|
||||
|
|
|
@ -140,8 +140,8 @@ typedef struct pidAutotuneConfig_s {
|
|||
PG_DECLARE_PROFILE(pidProfile_t, pidProfile);
|
||||
PG_DECLARE(pidAutotuneConfig_t, pidAutotuneConfig);
|
||||
|
||||
static inline const pidBank_t * pidBank() { return STATE(FIXED_WING) ? &pidProfile()->bank_fw : &pidProfile()->bank_mc; }
|
||||
static inline pidBank_t * pidBankMutable() { return STATE(FIXED_WING) ? &pidProfileMutable()->bank_fw : &pidProfileMutable()->bank_mc; }
|
||||
static inline const pidBank_t * pidBank(void) { return STATE(FIXED_WING) ? &pidProfile()->bank_fw : &pidProfile()->bank_mc; }
|
||||
static inline pidBank_t * pidBankMutable(void) { return STATE(FIXED_WING) ? &pidProfileMutable()->bank_fw : &pidProfileMutable()->bank_mc; }
|
||||
|
||||
extern int16_t axisPID[];
|
||||
extern int32_t axisPID_P[], axisPID_I[], axisPID_D[], axisPID_Setpoint[];
|
||||
|
|
|
@ -30,7 +30,7 @@ pwmDriverDriver_t pwmDrivers[PWM_DRIVER_IMPLEMENTATION_COUNT] = {
|
|||
}
|
||||
};
|
||||
|
||||
bool isPwmDriverEnabled() {
|
||||
bool isPwmDriverEnabled(void) {
|
||||
return driverEnabled;
|
||||
}
|
||||
|
||||
|
|
|
@ -382,7 +382,7 @@ void resetWaypointList(void);
|
|||
bool loadNonVolatileWaypointList(void);
|
||||
bool saveNonVolatileWaypointList(void);
|
||||
|
||||
float RTHAltitude();
|
||||
float RTHAltitude(void);
|
||||
|
||||
/* Geodetic functions */
|
||||
typedef enum {
|
||||
|
@ -438,7 +438,7 @@ bool isNavLaunchEnabled(void);
|
|||
bool isFixedWingLaunchDetected(void);
|
||||
bool isFixedWingLaunchFinishedOrAborted(void);
|
||||
|
||||
float calculateAverageSpeed();
|
||||
float calculateAverageSpeed(void);
|
||||
|
||||
const navigationPIDControllers_t* getNavigationPIDControllers(void);
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ static int profile_compare(profile_comp_t *a, profile_comp_t *b) {
|
|||
}
|
||||
|
||||
// Find profile matching plugged battery for profile_autoselect
|
||||
static int8_t profileDetect() {
|
||||
static int8_t profileDetect(void) {
|
||||
profile_comp_t profile_comp_array[MAX_BATTERY_PROFILE_COUNT];
|
||||
|
||||
// Prepare profile sort
|
||||
|
|
|
@ -148,6 +148,6 @@ void powerMeterUpdate(timeUs_t timeDelta);
|
|||
|
||||
uint8_t calculateBatteryPercentage(void);
|
||||
float calculateThrottleCompensationFactor(void);
|
||||
int32_t calculateAveragePower();
|
||||
int32_t calculateAverageEfficiency();
|
||||
int32_t calculateAveragePower(void);
|
||||
int32_t calculateAverageEfficiency(void);
|
||||
int32_t heatLossesCompensatedPower(int32_t power);
|
||||
|
|
|
@ -67,7 +67,7 @@ PG_DECLARE(gyroConfig_t, gyroConfig);
|
|||
bool gyroInit(void);
|
||||
void gyroInitFilters(void);
|
||||
void gyroGetMeasuredRotationRate(fpVector3_t *imuMeasuredRotationBF);
|
||||
void gyroUpdate();
|
||||
void gyroUpdate(void);
|
||||
void gyroStartCalibration(void);
|
||||
bool gyroIsCalibrationComplete(void);
|
||||
bool gyroReadTemperature(void);
|
||||
|
|
|
@ -61,6 +61,10 @@ class Compiler
|
|||
if flag == "" || flag == "-MMD" || flag == "-MP" || flag.start_with?("-save-temps")
|
||||
next
|
||||
end
|
||||
# -Wstrict-prototypes is not valid for C++
|
||||
if flag == "-Wstrict-prototypes"
|
||||
next
|
||||
end
|
||||
if flag.start_with? "-std="
|
||||
flag = "-std=c++11"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue