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

@@ -5,6 +5,8 @@ void subghz_protocol_decoder_base_set_decoder_callback(
SubGhzProtocolDecoderBase* decoder_base,
SubGhzProtocolDecoderBaseRxCallback callback,
void* context) {
furi_check(decoder_base);
decoder_base->callback = callback;
decoder_base->context = context;
}
@@ -12,6 +14,9 @@ void subghz_protocol_decoder_base_set_decoder_callback(
bool subghz_protocol_decoder_base_get_string(
SubGhzProtocolDecoderBase* decoder_base,
FuriString* output) {
furi_check(decoder_base);
furi_check(output);
bool status = false;
if(decoder_base->protocol && decoder_base->protocol->decoder &&
@@ -27,6 +32,9 @@ SubGhzProtocolStatus subghz_protocol_decoder_base_serialize(
SubGhzProtocolDecoderBase* decoder_base,
FlipperFormat* flipper_format,
SubGhzRadioPreset* preset) {
furi_check(decoder_base);
furi_check(flipper_format);
SubGhzProtocolStatus status = SubGhzProtocolStatusError;
if(decoder_base->protocol && decoder_base->protocol->decoder &&
@@ -40,6 +48,8 @@ SubGhzProtocolStatus subghz_protocol_decoder_base_serialize(
SubGhzProtocolStatus subghz_protocol_decoder_base_deserialize(
SubGhzProtocolDecoderBase* decoder_base,
FlipperFormat* flipper_format) {
furi_check(decoder_base);
SubGhzProtocolStatus status = SubGhzProtocolStatusError;
if(decoder_base->protocol && decoder_base->protocol->decoder &&
@@ -51,6 +61,8 @@ SubGhzProtocolStatus subghz_protocol_decoder_base_deserialize(
}
uint8_t subghz_protocol_decoder_base_get_hash_data(SubGhzProtocolDecoderBase* decoder_base) {
furi_check(decoder_base);
uint8_t hash = 0;
if(decoder_base->protocol && decoder_base->protocol->decoder &&