[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:
@@ -92,4 +92,4 @@ bool args_read_hex_bytes(string_t args, uint8_t* bytes, size_t bytes_count) {
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@@ -78,4 +78,4 @@ bool args_char_to_hex(char hi_nibble, char low_nibble, uint8_t* byte);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value) {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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
|
||||
|
@@ -28,4 +28,4 @@ bool manchester_advance(
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -29,4 +29,4 @@ ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -80,4 +80,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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
|
||||
|
@@ -228,4 +228,4 @@ static bool file_stream_delete_and_insert(
|
||||
string_clear(scratch_name);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@@ -44,4 +44,4 @@ FS_Error file_stream_get_error(Stream* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define STREAM_CACHE_SIZE 512
|
||||
#define STREAM_CACHE_SIZE 512u
|
||||
|
||||
typedef struct StreamVTable StreamVTable;
|
||||
|
||||
|
@@ -176,4 +176,4 @@ static size_t string_stream_write_char(StringStream* stream, char c) {
|
||||
stream->index++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@@ -15,4 +15,4 @@ Stream* string_stream_alloc();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -63,4 +63,4 @@ bool tar_archive_finalize(TarArchive* archive);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -84,4 +84,4 @@ bool version_get_dirty_flag(const Version* v);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user