[FL-2520] FW build with -Wextra (#1185)

* Fixing compiler warnings with -Wextra
* More warnings suppression, WIP
* Even more warning fixes
* Added new lines at end of text files.
* Padding fix
* Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline
* Fixes for Secplus v1
* -additional warnings
* +-Wredundant-decls fixes
* FuriHal: print stack overflow task name in console
* FuriHal: add missing include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
hedger
2022-05-06 16:37:10 +03:00
committed by GitHub
parent 1ca98170d9
commit 4d6b170769
461 changed files with 940 additions and 519 deletions

View File

@@ -92,4 +92,4 @@ bool args_read_hex_bytes(string_t args, uint8_t* bytes, size_t bytes_count) {
}
return result;
}
}

View File

@@ -78,4 +78,4 @@ bool args_char_to_hex(char hi_nibble, char low_nibble, uint8_t* byte);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value) {
} else {
return false;
}
}
}

View File

@@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -79,4 +79,4 @@ static inline uint32_t level_duration_get_duration(LevelDuration level_duration)
return (level_duration >= 0) ? level_duration : -level_duration;
}
#endif
#endif

View File

@@ -28,4 +28,4 @@ bool manchester_advance(
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -51,4 +51,4 @@ bool manchester_encoder_advance(
ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state) {
state->step = 0;
return (state->prev_bit << 1) + state->prev_bit;
}
}

View File

@@ -29,4 +29,4 @@ ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state)
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -296,4 +296,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]) {
md5_finish(&ctx, output);
memset(&ctx, 0, sizeof(md5_context));
}
}

View File

@@ -80,4 +80,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -33,8 +33,8 @@ void set_random_name(char* name, uint8_t max_name_size) {
"opening",
"crack",
};
uint8_t prefix_i = rand() % SIZEOF_ARRAY(prefix);
uint8_t suffix_i = rand() % SIZEOF_ARRAY(suffix);
uint8_t prefix_i = rand() % COUNT_OF(prefix);
uint8_t suffix_i = rand() % COUNT_OF(suffix);
sniprintf(name, max_name_size, "%s_%s", prefix[prefix_i], suffix[suffix_i]);
// Set first symbol to upper case

View File

@@ -228,4 +228,4 @@ static bool file_stream_delete_and_insert(
string_clear(scratch_name);
return result;
}
}

View File

@@ -44,4 +44,4 @@ FS_Error file_stream_get_error(Stream* stream);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -217,7 +217,7 @@ bool stream_delete_and_insert_vaformat(
string_init_vprintf(data, format, args);
StreamWriteData write_data = {
.data = (uint8_t*)string_get_cstr(data), .size = string_size(data)};
bool result = stream_delete_and_insert(stream, 0, stream_write_struct, &write_data);
bool result = stream_delete_and_insert(stream, delete_size, stream_write_struct, &write_data);
string_clear(data);
return result;
@@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream) {
printf("\r\n");
printf("DATA END\r\n");
stream_seek(stream, tell, StreamOffsetFromStart);
}
}

View File

@@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,7 +7,7 @@
extern "C" {
#endif
#define STREAM_CACHE_SIZE 512
#define STREAM_CACHE_SIZE 512u
typedef struct StreamVTable StreamVTable;

View File

@@ -176,4 +176,4 @@ static size_t string_stream_write_char(StringStream* stream, char c) {
stream->index++;
return 1;
}
}

View File

@@ -15,4 +15,4 @@ Stream* string_stream_alloc();
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -345,4 +345,4 @@ bool tar_archive_add_dir(TarArchive* archive, const char* fs_full_path, const ch
free(name);
storage_file_free(directory);
return success;
}
}

View File

@@ -63,4 +63,4 @@ bool tar_archive_finalize(TarArchive* archive);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -55,4 +55,4 @@ uint8_t version_get_target(const Version* v) {
bool version_get_dirty_flag(const Version* v) {
return v ? v->build_is_dirty : version.build_is_dirty;
}
}

View File

@@ -84,4 +84,4 @@ bool version_get_dirty_flag(const Version* v);
#ifdef __cplusplus
}
#endif
#endif