mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-28 01:58:11 -07:00
merge manually formatted stuff too
This commit is contained in:
+2
-2
@@ -4,10 +4,10 @@
|
||||
bool hex_char_to_hex_nibble(char c, uint8_t* nibble) {
|
||||
furi_check(nibble);
|
||||
|
||||
if((c >= '0' && c <= '9')) {
|
||||
if(c >= '0' && c <= '9') {
|
||||
*nibble = c - '0';
|
||||
return true;
|
||||
} else if((c >= 'A' && c <= 'F')) {
|
||||
} else if(c >= 'A' && c <= 'F') {
|
||||
*nibble = c - 'A' + 10;
|
||||
return true;
|
||||
} else if(c >= 'a' && c <= 'f') {
|
||||
|
||||
@@ -68,11 +68,11 @@ static inline LevelDuration level_duration_reset() {
|
||||
}
|
||||
|
||||
static inline bool level_duration_is_reset(LevelDuration level_duration) {
|
||||
return (level_duration == LEVEL_DURATION_RESET);
|
||||
return level_duration == LEVEL_DURATION_RESET;
|
||||
}
|
||||
|
||||
static inline bool level_duration_get_level(LevelDuration level_duration) {
|
||||
return (level_duration > 0);
|
||||
return level_duration > 0;
|
||||
}
|
||||
|
||||
static inline uint32_t level_duration_get_duration(LevelDuration level_duration) {
|
||||
|
||||
@@ -144,7 +144,7 @@ static bool stream_write_struct(Stream* stream, const void* context) {
|
||||
furi_check(stream);
|
||||
furi_check(context);
|
||||
const StreamWriteData* write_data = context;
|
||||
return (stream_write(stream, write_data->data, write_data->size) == write_data->size);
|
||||
return stream_write(stream, write_data->data, write_data->size) == write_data->size;
|
||||
}
|
||||
|
||||
bool stream_read_line(Stream* stream, FuriString* str_result) {
|
||||
|
||||
@@ -51,7 +51,7 @@ static void string_stream_free(StringStream* stream) {
|
||||
}
|
||||
|
||||
static bool string_stream_eof(StringStream* stream) {
|
||||
return (string_stream_tell(stream) >= string_stream_size(stream));
|
||||
return string_stream_tell(stream) >= string_stream_size(stream);
|
||||
}
|
||||
|
||||
static void string_stream_clean(StringStream* stream) {
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
#include <toolbox/path.h>
|
||||
#include <toolbox/compress.h>
|
||||
|
||||
#define TAG "TarArch"
|
||||
#define TAG "TarArch"
|
||||
|
||||
#define MAX_NAME_LEN 255
|
||||
#define FILE_BLOCK_SIZE 512
|
||||
|
||||
@@ -245,12 +246,12 @@ bool tar_archive_get_read_progress(TarArchive* archive, int32_t* processed, int3
|
||||
|
||||
bool tar_archive_dir_add_element(TarArchive* archive, const char* dirpath) {
|
||||
furi_check(archive);
|
||||
return (mtar_write_dir_header(&archive->tar, dirpath) == MTAR_ESUCCESS);
|
||||
return mtar_write_dir_header(&archive->tar, dirpath) == MTAR_ESUCCESS;
|
||||
}
|
||||
|
||||
bool tar_archive_finalize(TarArchive* archive) {
|
||||
furi_check(archive);
|
||||
return (mtar_finalize(&archive->tar) == MTAR_ESUCCESS);
|
||||
return mtar_finalize(&archive->tar) == MTAR_ESUCCESS;
|
||||
}
|
||||
|
||||
bool tar_archive_store_data(
|
||||
@@ -260,16 +261,15 @@ bool tar_archive_store_data(
|
||||
const int32_t data_len) {
|
||||
furi_check(archive);
|
||||
|
||||
return (
|
||||
tar_archive_file_add_header(archive, path, data_len) &&
|
||||
tar_archive_file_add_data_block(archive, data, data_len) &&
|
||||
tar_archive_file_finalize(archive));
|
||||
return tar_archive_file_add_header(archive, path, data_len) &&
|
||||
tar_archive_file_add_data_block(archive, data, data_len) &&
|
||||
tar_archive_file_finalize(archive);
|
||||
}
|
||||
|
||||
bool tar_archive_file_add_header(TarArchive* archive, const char* path, const int32_t data_len) {
|
||||
furi_check(archive);
|
||||
|
||||
return (mtar_write_file_header(&archive->tar, path, data_len) == MTAR_ESUCCESS);
|
||||
return mtar_write_file_header(&archive->tar, path, data_len) == MTAR_ESUCCESS;
|
||||
}
|
||||
|
||||
bool tar_archive_file_add_data_block(
|
||||
@@ -278,12 +278,12 @@ bool tar_archive_file_add_data_block(
|
||||
const int32_t block_len) {
|
||||
furi_check(archive);
|
||||
|
||||
return (mtar_write_data(&archive->tar, data_block, block_len) == block_len);
|
||||
return mtar_write_data(&archive->tar, data_block, block_len) == block_len;
|
||||
}
|
||||
|
||||
bool tar_archive_file_finalize(TarArchive* archive) {
|
||||
furi_check(archive);
|
||||
return (mtar_end_data(&archive->tar) == MTAR_ESUCCESS);
|
||||
return mtar_end_data(&archive->tar) == MTAR_ESUCCESS;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -396,7 +396,7 @@ bool tar_archive_unpack_to(
|
||||
|
||||
FURI_LOG_I(TAG, "Restoring '%s'", destination);
|
||||
|
||||
return (mtar_foreach(&archive->tar, archive_extract_foreach_cb, ¶m) == MTAR_ESUCCESS);
|
||||
return mtar_foreach(&archive->tar, archive_extract_foreach_cb, ¶m) == MTAR_ESUCCESS;
|
||||
}
|
||||
|
||||
bool tar_archive_add_file(
|
||||
|
||||
Reference in New Issue
Block a user