clang warnings again #2055

This commit is contained in:
rusefillc 2020-12-11 10:33:00 -05:00
parent c56799172e
commit 9b4a1fff7b
6 changed files with 9 additions and 10 deletions

View File

@ -23,7 +23,7 @@
#include <time.h>
#include "nmea.h"
long hex2int(char *a, int len) {
static long hex2int(char *a, int len) {
int i;
long val = 0;
@ -35,7 +35,7 @@ long hex2int(char *a, int len) {
return val;
}
int str2int(char *a, int len) {
static int str2int(char *a, int len) {
int i = 0, k = 0;
while (i<len) {
k = (k<<3)+(k<<1)+(*a)-'0';
@ -45,7 +45,7 @@ int str2int(char *a, int len) {
return k;
}
float gps_deg_dec(float deg_point) {
static float gps_deg_dec(float deg_point) {
float ddeg;
float sec = modff(deg_point, &ddeg) * 60;
int deg = (int) (ddeg / 100);
@ -59,7 +59,7 @@ float gps_deg_dec(float deg_point) {
}
// Convert lat e lon to decimals (from deg)
void gps_convert_deg_to_dec(float *latitude, char ns, float *longitude, char we) {
static void gps_convert_deg_to_dec(float *latitude, char ns, float *longitude, char we) {
float lat = (ns == 'N') ? *latitude : -1 * (*latitude);
float lon = (we == 'E') ? *longitude : -1 * (*longitude);
@ -68,7 +68,7 @@ void gps_convert_deg_to_dec(float *latitude, char ns, float *longitude, char we)
}
// in string collect all char till comma and convert to float
int str_till_comma(char *a, char *dStr) {
static int str_till_comma(char *a, char *dStr) {
int i = 0, sLen = strlen(a);
if (sLen > GPS_MAX_STRING)

View File

@ -77,7 +77,6 @@
/*
* Stack debugging
* See also getMaxUsedStack()
*/
EXTERNC int getRemainingStack(thread_t *otp);
int CountFreeStackSpace(const void* wabase);

View File

@ -568,7 +568,7 @@ void exportAllTriggers() {
fprintf(fp, "# duty %.2f %.2f\n", shape->expectedDutyCycle[0], shape->expectedDutyCycle[1]);
for (int i = 0; i < shape->getLength(); i++) {
for (size_t i = 0; i < shape->getLength(); i++) {
int triggerDefinitionCoordinate = (shape->getTriggerWaveformSynchPointIndex() + i) % shape->getSize();

View File

@ -50,7 +50,7 @@ typedef unsigned int time_t;
* project-wide default thread stack size
* See also PORT_INT_REQUIRED_STACK
* See getRemainingStack()
* See getMaxUsedStack() and CountFreeStackSpace()
* See CountFreeStackSpace()
* See "threadsinfo" command cmd_threads
*/
#ifndef UTILITY_THREAD_STACK_SIZE

View File

@ -42,7 +42,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
Sensor::setMockValue(SensorType::Clt, 70);
Sensor::setMockValue(SensorType::Iat, 30);
for (const auto [s, v] : sensorValues) {
for (const auto& [s, v] : sensorValues) {
Sensor::setMockValue(s, v);
}

View File

@ -11,7 +11,7 @@
class MockEtb : public IEtbController {
public:
// IEtbController mocks
MOCK_METHOD(void, reset, (), ());
MOCK_METHOD(void, reset, (), (override));
MOCK_METHOD(void, update, (), (override));
MOCK_METHOD(bool, init, (etb_function_e function, DcMotor* motor, pid_s* pidParameters, const ValueProvider3D* pedalMap, bool initializeThrottles), (override));
MOCK_METHOD(void, setIdlePosition, (percent_t pos), (override));