From d2b31c1770f611dfb7baebafc97d5bb0ff35f979 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Wed, 16 Aug 2017 11:30:00 +0100 Subject: [PATCH] Fixed some comparion sign warnings --- src/main/fc/cli.c | 2 +- src/main/fc/config.h | 2 +- src/main/io/osd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index 100fc4fbd1..7021dbd4dd 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -1924,7 +1924,7 @@ static void printName(uint8_t dumpMask, const pilotConfig_t *pilotConfig) static void cliName(char *cmdline) { - const int len = strlen(cmdline); + const unsigned int len = strlen(cmdline); if (len > 0) { memset(pilotConfigMutable()->name, 0, ARRAYLEN(pilotConfig()->name)); if (strncmp(cmdline, emptyName, len)) { diff --git a/src/main/fc/config.h b/src/main/fc/config.h index cc40301f04..40d7fe1a13 100644 --- a/src/main/fc/config.h +++ b/src/main/fc/config.h @@ -58,7 +58,7 @@ typedef enum { FEATURE_DYNAMIC_FILTER = 1 << 29, } features_e; -#define MAX_NAME_LENGTH 16 +#define MAX_NAME_LENGTH 16u typedef struct pilotConfig_s { char name[MAX_NAME_LENGTH + 1]; } pilotConfig_t; diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 777217e9f2..827150ef4e 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -452,7 +452,7 @@ static void osdDrawSingleElement(uint8_t item) if (strlen(pilotConfig()->name) == 0) strcpy(buff, "CRAFT_NAME"); else { - for (int i = 0; i < MAX_NAME_LENGTH; i++) { + for (unsigned int i = 0; i < MAX_NAME_LENGTH; i++) { buff[i] = toupper((unsigned char)pilotConfig()->name[i]); if (pilotConfig()->name[i] == 0) break;