mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 05:06:30 +04:00
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:
@@ -1,8 +1,11 @@
|
||||
#include "application_manifest.h"
|
||||
|
||||
#include <furi_hal_version.h>
|
||||
#include <furi.h>
|
||||
|
||||
bool flipper_application_manifest_is_valid(const FlipperApplicationManifest* manifest) {
|
||||
furi_check(manifest);
|
||||
|
||||
if((manifest->base.manifest_magic != FAP_MANIFEST_MAGIC) ||
|
||||
(manifest->base.manifest_version != FAP_MANIFEST_SUPPORTED_VERSION)) {
|
||||
return false;
|
||||
@@ -14,6 +17,9 @@ bool flipper_application_manifest_is_valid(const FlipperApplicationManifest* man
|
||||
bool flipper_application_manifest_is_too_old(
|
||||
const FlipperApplicationManifest* manifest,
|
||||
const ElfApiInterface* api_interface) {
|
||||
furi_check(manifest);
|
||||
furi_check(api_interface);
|
||||
|
||||
if(manifest->base.api_version.major < api_interface->api_version_major /* ||
|
||||
manifest->base.api_version.minor > app->api_interface->api_version_minor */) {
|
||||
return false;
|
||||
@@ -25,6 +31,9 @@ bool flipper_application_manifest_is_too_old(
|
||||
bool flipper_application_manifest_is_too_new(
|
||||
const FlipperApplicationManifest* manifest,
|
||||
const ElfApiInterface* api_interface) {
|
||||
furi_check(manifest);
|
||||
furi_check(api_interface);
|
||||
|
||||
if(manifest->base.api_version.major > api_interface->api_version_major /* ||
|
||||
manifest->base.api_version.minor > app->api_interface->api_version_minor */) {
|
||||
return false;
|
||||
@@ -34,6 +43,8 @@ bool flipper_application_manifest_is_too_new(
|
||||
}
|
||||
|
||||
bool flipper_application_manifest_is_target_compatible(const FlipperApplicationManifest* manifest) {
|
||||
furi_check(manifest);
|
||||
|
||||
const Version* version = furi_hal_version_get_firmware_version();
|
||||
return version_get_target(version) == manifest->base.hardware_target_id;
|
||||
}
|
||||
Reference in New Issue
Block a user