mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-13 13:29:50 +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,4 +1,5 @@
|
||||
#include "datetime.h"
|
||||
#include <furi.h>
|
||||
|
||||
#define TAG "DateTime"
|
||||
|
||||
@@ -37,6 +38,8 @@ bool datetime_validate_datetime(DateTime* datetime) {
|
||||
}
|
||||
|
||||
uint32_t datetime_datetime_to_timestamp(DateTime* datetime) {
|
||||
furi_check(datetime);
|
||||
|
||||
uint32_t timestamp = 0;
|
||||
uint8_t years = 0;
|
||||
uint8_t leap_years = 0;
|
||||
@@ -67,6 +70,7 @@ uint32_t datetime_datetime_to_timestamp(DateTime* datetime) {
|
||||
}
|
||||
|
||||
void datetime_timestamp_to_datetime(uint32_t timestamp, DateTime* datetime) {
|
||||
furi_check(datetime);
|
||||
uint32_t days = timestamp / SECONDS_PER_DAY;
|
||||
uint32_t seconds_in_day = timestamp % SECONDS_PER_DAY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user