Api Symbols: replace asserts with checks (#3507)

* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
あく
2024-03-19 23:43:52 +09:00
committed by GitHub
parent a09ec4d976
commit acc39a4bc0
571 changed files with 3565 additions and 2704 deletions

View File

@@ -27,7 +27,7 @@ struct CompressIcon {
uint8_t decoded_buff[COMPRESS_ICON_DECODED_BUFF_SIZE];
};
CompressIcon* compress_icon_alloc() {
CompressIcon* compress_icon_alloc(void) {
CompressIcon* instance = malloc(sizeof(CompressIcon));
instance->decoder = heatshrink_decoder_alloc(
COMPRESS_ICON_ENCODED_BUFF_SIZE,
@@ -40,15 +40,15 @@ CompressIcon* compress_icon_alloc() {
}
void compress_icon_free(CompressIcon* instance) {
furi_assert(instance);
furi_check(instance);
heatshrink_decoder_free(instance->decoder);
free(instance);
}
void compress_icon_decode(CompressIcon* instance, const uint8_t* icon_data, uint8_t** decoded_buff) {
furi_assert(instance);
furi_assert(icon_data);
furi_assert(decoded_buff);
furi_check(instance);
furi_check(icon_data);
furi_check(decoded_buff);
CompressHeader* header = (CompressHeader*)icon_data;
if(header->is_compressed) {
@@ -64,7 +64,7 @@ void compress_icon_decode(CompressIcon* instance, const uint8_t* icon_data, uint
instance->decoded_buff,
sizeof(instance->decoded_buff),
&data_processed);
furi_assert((res == HSDR_POLL_EMPTY) || (res == HSDR_POLL_MORE));
furi_check((res == HSDR_POLL_EMPTY) || (res == HSDR_POLL_MORE));
if(res != HSDR_POLL_MORE) {
break;
}
@@ -98,7 +98,7 @@ Compress* compress_alloc(uint16_t compress_buff_size) {
}
void compress_free(Compress* compress) {
furi_assert(compress);
furi_check(compress);
heatshrink_encoder_free(compress->encoder);
heatshrink_decoder_free(compress->decoder);