[FL-2870] Printf function attributes (#1841)
* Furi strings: printf attribute * Logs: printf attribute * Plugins: adapt * Plugins: accommodate * Unit tests: accommodate Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -221,13 +221,13 @@ static void infrared_test_run_encoder(InfraredProtocol protocol, uint32_t test_i
|
||||
const char* protocol_name = infrared_get_protocol_name(protocol);
|
||||
mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file");
|
||||
|
||||
furi_string_printf(buf, "encoder_input%d", test_index);
|
||||
furi_string_printf(buf, "encoder_input%ld", test_index);
|
||||
mu_assert(
|
||||
infrared_test_load_messages(
|
||||
test->ff, furi_string_get_cstr(buf), &input_messages, &input_messages_count),
|
||||
"Failed to load messages from file");
|
||||
|
||||
furi_string_printf(buf, "encoder_expected%d", test_index);
|
||||
furi_string_printf(buf, "encoder_expected%ld", test_index);
|
||||
mu_assert(
|
||||
infrared_test_load_raw_signal(
|
||||
test->ff, furi_string_get_cstr(buf), &expected_timings, &expected_timings_count),
|
||||
@@ -277,7 +277,7 @@ static void infrared_test_run_encoder_decoder(InfraredProtocol protocol, uint32_
|
||||
const char* protocol_name = infrared_get_protocol_name(protocol);
|
||||
mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file");
|
||||
|
||||
furi_string_printf(buf, "encoder_decoder_input%d", test_index);
|
||||
furi_string_printf(buf, "encoder_decoder_input%ld", test_index);
|
||||
mu_assert(
|
||||
infrared_test_load_messages(
|
||||
test->ff, furi_string_get_cstr(buf), &input_messages, &input_messages_count),
|
||||
@@ -336,13 +336,13 @@ static void infrared_test_run_decoder(InfraredProtocol protocol, uint32_t test_i
|
||||
infrared_test_prepare_file(infrared_get_protocol_name(protocol)),
|
||||
"Failed to prepare test file");
|
||||
|
||||
furi_string_printf(buf, "decoder_input%d", test_index);
|
||||
furi_string_printf(buf, "decoder_input%ld", test_index);
|
||||
mu_assert(
|
||||
infrared_test_load_raw_signal(
|
||||
test->ff, furi_string_get_cstr(buf), &timings, &timings_count),
|
||||
"Failed to load raw signal from file");
|
||||
|
||||
furi_string_printf(buf, "decoder_expected%d", test_index);
|
||||
furi_string_printf(buf, "decoder_expected%ld", test_index);
|
||||
mu_assert(
|
||||
infrared_test_load_messages(
|
||||
test->ff, furi_string_get_cstr(buf), &messages, &messages_count),
|
||||
|
||||
@@ -112,7 +112,7 @@ static bool nfc_test_digital_signal_test_encode(
|
||||
// Check timings
|
||||
if(time > encode_max_time) {
|
||||
FURI_LOG_E(
|
||||
TAG, "Encoding time: %d us while accepted value: %d us", time, encode_max_time);
|
||||
TAG, "Encoding time: %ld us while accepted value: %ld us", time, encode_max_time);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ static bool nfc_test_digital_signal_test_encode(
|
||||
ref_timings_sum += ref[i];
|
||||
if(timings_diff > timing_tolerance) {
|
||||
FURI_LOG_E(
|
||||
TAG, "Too big differece in %d timings. Ref: %d, DUT: %d", i, ref[i], dut[i]);
|
||||
TAG, "Too big differece in %d timings. Ref: %ld, DUT: %ld", i, ref[i], dut[i]);
|
||||
timing_check_success = false;
|
||||
break;
|
||||
}
|
||||
@@ -143,16 +143,16 @@ static bool nfc_test_digital_signal_test_encode(
|
||||
if(sum_diff > timings_sum_tolerance) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Too big difference in timings sum. Ref: %d, DUT: %d",
|
||||
"Too big difference in timings sum. Ref: %ld, DUT: %ld",
|
||||
ref_timings_sum,
|
||||
dut_timings_sum);
|
||||
break;
|
||||
}
|
||||
|
||||
FURI_LOG_I(TAG, "Encoding time: %d us. Acceptable time: %d us", time, encode_max_time);
|
||||
FURI_LOG_I(TAG, "Encoding time: %ld us. Acceptable time: %ld us", time, encode_max_time);
|
||||
FURI_LOG_I(
|
||||
TAG,
|
||||
"Timings sum difference: %d [1/64MHZ]. Acceptable difference: %d [1/64MHz]",
|
||||
"Timings sum difference: %ld [1/64MHZ]. Acceptable difference: %ld [1/64MHz]",
|
||||
sum_diff,
|
||||
timings_sum_tolerance);
|
||||
success = true;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
uint16_t archive_favorites_count(void* context);
|
||||
bool archive_favorites_read(void* context);
|
||||
bool archive_favorites_delete(const char* format, ...);
|
||||
bool archive_is_favorite(const char* format, ...);
|
||||
bool archive_favorites_delete(const char* format, ...) _ATTRIBUTE((__format__(__printf__, 1, 2)));
|
||||
bool archive_is_favorite(const char* format, ...) _ATTRIBUTE((__format__(__printf__, 1, 2)));
|
||||
bool archive_favorites_rename(const char* src, const char* dst);
|
||||
void archive_add_to_favorites(const char* file_path);
|
||||
void archive_favorites_save(void* context);
|
||||
|
||||
@@ -86,5 +86,7 @@ ARRAY_DEF(
|
||||
|
||||
void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder, bool is_app);
|
||||
bool archive_get_items(void* context, const char* path);
|
||||
void archive_file_append(const char* path, const char* format, ...);
|
||||
void archive_delete_file(void* context, const char* format, ...);
|
||||
void archive_file_append(const char* path, const char* format, ...)
|
||||
_ATTRIBUTE((__format__(__printf__, 2, 3)));
|
||||
void archive_delete_file(void* context, const char* format, ...)
|
||||
_ATTRIBUTE((__format__(__printf__, 2, 3)));
|
||||
|
||||
@@ -323,7 +323,7 @@ static bool ducky_set_usb_id(BadUsbScript* bad_usb, const char* line) {
|
||||
}
|
||||
FURI_LOG_D(
|
||||
WORKER_TAG,
|
||||
"set id: %04X:%04X mfr:%s product:%s",
|
||||
"set id: %04lX:%04lX mfr:%s product:%s",
|
||||
bad_usb->hid_cfg.vid,
|
||||
bad_usb->hid_cfg.pid,
|
||||
bad_usb->hid_cfg.manuf,
|
||||
@@ -388,7 +388,7 @@ static int32_t ducky_script_execute_next(BadUsbScript* bad_usb, File* script_fil
|
||||
return 0;
|
||||
} else if(delay_val < 0) { // Script error
|
||||
bad_usb->st.error_line = bad_usb->st.line_cur - 1;
|
||||
FURI_LOG_E(WORKER_TAG, "Unknown command at line %lu", bad_usb->st.line_cur - 1);
|
||||
FURI_LOG_E(WORKER_TAG, "Unknown command at line %u", bad_usb->st.line_cur - 1);
|
||||
return SCRIPT_STATE_ERROR;
|
||||
} else {
|
||||
return (delay_val + bad_usb->defdelay);
|
||||
@@ -420,7 +420,7 @@ static int32_t ducky_script_execute_next(BadUsbScript* bad_usb, File* script_fil
|
||||
delay_val = ducky_parse_line(bad_usb, bad_usb->line);
|
||||
if(delay_val < 0) {
|
||||
bad_usb->st.error_line = bad_usb->st.line_cur;
|
||||
FURI_LOG_E(WORKER_TAG, "Unknown command at line %lu", bad_usb->st.line_cur);
|
||||
FURI_LOG_E(WORKER_TAG, "Unknown command at line %u", bad_usb->st.line_cur);
|
||||
return SCRIPT_STATE_ERROR;
|
||||
} else {
|
||||
return (delay_val + bad_usb->defdelay);
|
||||
|
||||
@@ -91,7 +91,7 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
|
||||
furi_string_reset(disp_str);
|
||||
canvas_draw_icon(canvas, 117, 22, &I_Percent_10x14);
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
furi_string_printf(disp_str, "delay %us", model->state.delay_remain);
|
||||
furi_string_printf(disp_str, "delay %lus", model->state.delay_remain);
|
||||
canvas_draw_str_aligned(
|
||||
canvas, 127, 46, AlignRight, AlignBottom, furi_string_get_cstr(disp_str));
|
||||
furi_string_reset(disp_str);
|
||||
|
||||
@@ -31,7 +31,7 @@ bool elf_resolve_from_hashtable(const char* name, Elf32_Addr* address) {
|
||||
|
||||
auto find_res = std::lower_bound(elf_api_table.cbegin(), elf_api_table.cend(), key);
|
||||
if((find_res == elf_api_table.cend() || (find_res->hash != gnu_sym_hash))) {
|
||||
FURI_LOG_W(TAG, "Cant find symbol '%s' (hash %x)!", name, gnu_sym_hash);
|
||||
FURI_LOG_W(TAG, "Cant find symbol '%s' (hash %lx)!", name, gnu_sym_hash);
|
||||
result = false;
|
||||
} else {
|
||||
result = true;
|
||||
|
||||
@@ -92,14 +92,14 @@ static void infrared_find_vacant_remote_name(FuriString* name, const char* path)
|
||||
uint32_t i = 1;
|
||||
do {
|
||||
furi_string_printf(
|
||||
path_temp, "%s%u%s", furi_string_get_cstr(base_path), ++i, INFRARED_APP_EXTENSION);
|
||||
path_temp, "%s%lu%s", furi_string_get_cstr(base_path), ++i, INFRARED_APP_EXTENSION);
|
||||
status = storage_common_stat(storage, furi_string_get_cstr(path_temp), NULL);
|
||||
} while(status == FSE_OK);
|
||||
|
||||
furi_string_free(path_temp);
|
||||
|
||||
if(status == FSE_NOT_EXIST) {
|
||||
furi_string_cat_printf(name, "%u", i);
|
||||
furi_string_cat_printf(name, "%lu", i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ static bool infrared_signal_is_raw_valid(InfraredRawSignal* raw) {
|
||||
if((raw->frequency > INFRARED_MAX_FREQUENCY) || (raw->frequency < INFRARED_MIN_FREQUENCY)) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Frequency is out of range (%lX - %lX): %lX",
|
||||
"Frequency is out of range (%X - %X): %lX",
|
||||
INFRARED_MIN_FREQUENCY,
|
||||
INFRARED_MAX_FREQUENCY,
|
||||
raw->frequency);
|
||||
@@ -74,7 +74,7 @@ static bool infrared_signal_is_raw_valid(InfraredRawSignal* raw) {
|
||||
} else if((raw->timings_size <= 0) || (raw->timings_size > MAX_TIMINGS_AMOUNT)) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Timings amount is out of range (0 - %lX): %lX",
|
||||
"Timings amount is out of range (0 - %X): %X",
|
||||
MAX_TIMINGS_AMOUNT,
|
||||
raw->timings_size);
|
||||
return false;
|
||||
|
||||
@@ -27,7 +27,7 @@ void nfc_scene_mf_classic_keys_list_prepare(Nfc* nfc, MfClassicDict* dict) {
|
||||
char* current_key = (char*)malloc(sizeof(char) * 13);
|
||||
strncpy(current_key, furi_string_get_cstr(temp_key), 12);
|
||||
MfClassicUserKeys_push_back(nfc->mfc_key_strs, current_key);
|
||||
FURI_LOG_D("ListKeys", "Key %d: %s", index, current_key);
|
||||
FURI_LOG_D("ListKeys", "Key %ld: %s", index, current_key);
|
||||
submenu_add_item(
|
||||
submenu, current_key, index++, nfc_scene_mf_classic_keys_list_submenu_callback, nfc);
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ void nfc_scene_mf_desfire_read_success_on_enter(void* context) {
|
||||
|
||||
uint32_t bytes_total = 1 << (data->version.sw_storage >> 1);
|
||||
uint32_t bytes_free = data->free_memory ? data->free_memory->bytes : 0;
|
||||
furi_string_cat_printf(temp_str, "\n%d", bytes_total);
|
||||
furi_string_cat_printf(temp_str, "\n%ld", bytes_total);
|
||||
if(data->version.sw_storage & 1) {
|
||||
furi_string_push_back(temp_str, '+');
|
||||
}
|
||||
furi_string_cat_printf(temp_str, " bytes, %d bytes free\n", bytes_free);
|
||||
furi_string_cat_printf(temp_str, " bytes, %ld bytes free\n", bytes_free);
|
||||
|
||||
uint16_t n_apps = 0;
|
||||
uint16_t n_files = 0;
|
||||
|
||||
@@ -59,11 +59,11 @@ void nfc_scene_nfc_data_info_on_enter(void* context) {
|
||||
MifareDesfireData* data = &dev_data->mf_df_data;
|
||||
uint32_t bytes_total = 1 << (data->version.sw_storage >> 1);
|
||||
uint32_t bytes_free = data->free_memory ? data->free_memory->bytes : 0;
|
||||
furi_string_cat_printf(temp_str, "\n%d", bytes_total);
|
||||
furi_string_cat_printf(temp_str, "\n%ld", bytes_total);
|
||||
if(data->version.sw_storage & 1) {
|
||||
furi_string_push_back(temp_str, '+');
|
||||
}
|
||||
furi_string_cat_printf(temp_str, " bytes, %d bytes free\n", bytes_free);
|
||||
furi_string_cat_printf(temp_str, " bytes, %ld bytes free\n", bytes_free);
|
||||
|
||||
uint16_t n_apps = 0;
|
||||
uint16_t n_files = 0;
|
||||
|
||||
@@ -149,7 +149,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||
|
||||
FURI_LOG_T(
|
||||
TAG,
|
||||
"RSSI: avg %f, max %f at %u, min %f",
|
||||
"RSSI: avg %f, max %f at %lu, min %f",
|
||||
(double)(rssi_avg / rssi_avg_samples),
|
||||
(double)frequency_rssi.rssi_coarse,
|
||||
frequency_rssi.frequency_coarse,
|
||||
@@ -180,7 +180,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||
|
||||
rssi = furi_hal_subghz_get_rssi();
|
||||
|
||||
FURI_LOG_T(TAG, "#:%u:%f", frequency, (double)rssi);
|
||||
FURI_LOG_T(TAG, "#:%lu:%f", frequency, (double)rssi);
|
||||
|
||||
if(frequency_rssi.rssi_fine < rssi) {
|
||||
frequency_rssi.rssi_fine = rssi;
|
||||
@@ -193,7 +193,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||
// Deliver results fine
|
||||
if(frequency_rssi.rssi_fine > SUBGHZ_FREQUENCY_ANALYZER_THRESHOLD) {
|
||||
FURI_LOG_D(
|
||||
TAG, "=:%u:%f", frequency_rssi.frequency_fine, (double)frequency_rssi.rssi_fine);
|
||||
TAG, "=:%lu:%f", frequency_rssi.frequency_fine, (double)frequency_rssi.rssi_fine);
|
||||
|
||||
instance->sample_hold_counter = 20;
|
||||
rssi_temp = frequency_rssi.rssi_fine;
|
||||
@@ -217,7 +217,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||
(instance->sample_hold_counter < 10)) {
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"~:%u:%f",
|
||||
"~:%lu:%f",
|
||||
frequency_rssi.frequency_coarse,
|
||||
(double)frequency_rssi.rssi_coarse);
|
||||
|
||||
|
||||
@@ -151,8 +151,8 @@ void subghz_cli_command_tx(Cli* cli, FuriString* args, void* context) {
|
||||
"Protocol: Princeton\n"
|
||||
"Bit: 24\n"
|
||||
"Key: 00 00 00 00 00 %02X %02X %02X\n"
|
||||
"TE: %d\n"
|
||||
"Repeat: %d\n",
|
||||
"TE: %ld\n"
|
||||
"Repeat: %ld\n",
|
||||
(uint8_t)((key >> 16) & 0xFF),
|
||||
(uint8_t)((key >> 8) & 0xFF),
|
||||
(uint8_t)(key & 0xFF),
|
||||
@@ -794,7 +794,7 @@ static bool subghz_on_system_start_istream_decode_band(
|
||||
|
||||
FURI_LOG_I(
|
||||
"SubGhzOnStart",
|
||||
"Add allowed band: start %dHz, stop %dHz, power_limit %ddBm, duty_cycle %d%%",
|
||||
"Add allowed band: start %ldHz, stop %ldHz, power_limit %ddBm, duty_cycle %d%%",
|
||||
band.start,
|
||||
band.end,
|
||||
band.power_limit,
|
||||
|
||||
@@ -60,7 +60,7 @@ void subghz_get_frequency_modulation(SubGhz* subghz, FuriString* frequency, Furi
|
||||
subghz->txrx->preset->frequency / 10000 % 100);
|
||||
}
|
||||
if(modulation != NULL) {
|
||||
furi_string_printf(modulation, "%0.2s", furi_string_get_cstr(subghz->txrx->preset->name));
|
||||
furi_string_printf(modulation, "%2s", furi_string_get_cstr(subghz->txrx->preset->name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c
|
||||
if(!is_valid) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Invalid note: %u%c%c%u.%u",
|
||||
"Invalid note: %lu%c%c%lu.%lu",
|
||||
duration,
|
||||
note_char == '\0' ? '_' : note_char,
|
||||
sharp_char == '\0' ? '_' : sharp_char,
|
||||
@@ -281,7 +281,7 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c
|
||||
if(music_player_worker_add_note(instance, semitone, duration, dots)) {
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"Added note: %c%c%u.%u = %u %u",
|
||||
"Added note: %c%c%lu.%lu = %u %lu",
|
||||
note_char == '\0' ? '_' : note_char,
|
||||
sharp_char == '\0' ? '_' : sharp_char,
|
||||
octave,
|
||||
@@ -291,7 +291,7 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c
|
||||
} else {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Invalid note: %c%c%u.%u = %u %u",
|
||||
"Invalid note: %c%c%lu.%lu = %u %lu",
|
||||
note_char == '\0' ? '_' : note_char,
|
||||
sharp_char == '\0' ? '_' : sharp_char,
|
||||
octave,
|
||||
|
||||
@@ -77,7 +77,7 @@ static bool bt_pin_code_verify_event_handler(Bt* bt, uint32_t pin) {
|
||||
notification_message(bt->notification, &sequence_display_backlight_on);
|
||||
FuriString* pin_str;
|
||||
dialog_message_set_icon(bt->dialog_message, &I_BLE_Pairing_128x64, 0, 0);
|
||||
pin_str = furi_string_alloc_printf("Verify code\n%06d", pin);
|
||||
pin_str = furi_string_alloc_printf("Verify code\n%06ld", pin);
|
||||
dialog_message_set_text(
|
||||
bt->dialog_message, furi_string_get_cstr(pin_str), 64, 4, AlignCenter, AlignTop);
|
||||
dialog_message_set_buttons(bt->dialog_message, "Cancel", "OK", NULL);
|
||||
@@ -277,7 +277,7 @@ static bool bt_on_gap_event_callback(GapEvent event, void* context) {
|
||||
static void bt_on_key_storage_change_callback(uint8_t* addr, uint16_t size, void* context) {
|
||||
furi_assert(context);
|
||||
Bt* bt = context;
|
||||
FURI_LOG_I(TAG, "Changed addr start: %08lX, size changed: %d", addr, size);
|
||||
FURI_LOG_I(TAG, "Changed addr start: %p, size changed: %d", addr, size);
|
||||
BtMessage message = {.type = BtMessageTypeKeysStorageUpdated};
|
||||
furi_check(
|
||||
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||
|
||||
@@ -304,7 +304,7 @@ static bool animation_storage_load_frames(
|
||||
if(file_info.size > max_filesize) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Filesize %d, max: %d (width %d, height %d)",
|
||||
"Filesize %lld, max: %d (width %d, height %d)",
|
||||
file_info.size,
|
||||
max_filesize,
|
||||
width,
|
||||
@@ -329,7 +329,7 @@ static bool animation_storage_load_frames(
|
||||
if(!frames_ok) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"Load \'%s\' failed, %dx%d, size: %d",
|
||||
"Load \'%s\' failed, %dx%d, size: %lld",
|
||||
furi_string_get_cstr(filename),
|
||||
width,
|
||||
height,
|
||||
|
||||
@@ -171,7 +171,7 @@ void dolphin_state_on_deed(DolphinState* dolphin_state, DolphinDeed deed) {
|
||||
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"icounter %d, butthurt %d",
|
||||
"icounter %ld, butthurt %ld",
|
||||
dolphin_state->data.icounter,
|
||||
dolphin_state->data.butthurt);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void gui_input(Gui* gui, InputEvent* input_event) {
|
||||
"non-complementary input, discarding key: %s type: %s, sequence: %p",
|
||||
input_get_key_name(input_event->key),
|
||||
input_get_type_name(input_event->type),
|
||||
input_event->sequence);
|
||||
(void*)input_event->sequence);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ void gui_input(Gui* gui, InputEvent* input_event) {
|
||||
view_port,
|
||||
input_get_key_name(input_event->key),
|
||||
input_get_type_name(input_event->type),
|
||||
input_event->sequence);
|
||||
(void*)input_event->sequence);
|
||||
view_port_input(gui->ongoing_input_view_port, input_event);
|
||||
} else {
|
||||
FURI_LOG_D(
|
||||
@@ -300,7 +300,7 @@ void gui_input(Gui* gui, InputEvent* input_event) {
|
||||
view_port,
|
||||
input_get_key_name(input_event->key),
|
||||
input_get_type_name(input_event->type),
|
||||
input_event->sequence);
|
||||
(void*)input_event->sequence);
|
||||
}
|
||||
|
||||
gui_unlock(gui);
|
||||
|
||||
@@ -291,7 +291,7 @@ static int32_t browser_worker(void* context) {
|
||||
browser_folder_init(browser, path, filename, &items_cnt, &file_idx);
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"Enter folder: %s items: %u idx: %d",
|
||||
"Enter folder: %s items: %lu idx: %ld",
|
||||
furi_string_get_cstr(path),
|
||||
items_cnt,
|
||||
file_idx);
|
||||
@@ -313,7 +313,7 @@ static int32_t browser_worker(void* context) {
|
||||
}
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"Exit to: %s items: %u idx: %d",
|
||||
"Exit to: %s items: %lu idx: %ld",
|
||||
furi_string_get_cstr(path),
|
||||
items_cnt,
|
||||
file_idx);
|
||||
@@ -330,7 +330,7 @@ static int32_t browser_worker(void* context) {
|
||||
browser_folder_init(browser, path, filename, &items_cnt, &file_idx);
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"Refresh folder: %s items: %u idx: %d",
|
||||
"Refresh folder: %s items: %lu idx: %ld",
|
||||
furi_string_get_cstr(path),
|
||||
items_cnt,
|
||||
browser->item_sel_idx);
|
||||
@@ -340,7 +340,8 @@ static int32_t browser_worker(void* context) {
|
||||
}
|
||||
|
||||
if(flags & WorkerEvtLoad) {
|
||||
FURI_LOG_D(TAG, "Load offset: %u cnt: %u", browser->load_offset, browser->load_count);
|
||||
FURI_LOG_D(
|
||||
TAG, "Load offset: %lu cnt: %lu", browser->load_offset, browser->load_count);
|
||||
browser_folder_load(browser, path, browser->load_offset, browser->load_count);
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ void view_dispatcher_handle_input(ViewDispatcher* view_dispatcher, InputEvent* e
|
||||
"non-complementary input, discarding key: %s, type: %s, sequence: %p",
|
||||
input_get_key_name(event->key),
|
||||
input_get_type_name(event->type),
|
||||
event->sequence);
|
||||
(void*)event->sequence);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ void view_dispatcher_handle_input(ViewDispatcher* view_dispatcher, InputEvent* e
|
||||
view_dispatcher->current_view,
|
||||
input_get_key_name(event->key),
|
||||
input_get_type_name(event->type),
|
||||
event->sequence);
|
||||
(void*)event->sequence);
|
||||
view_input(view_dispatcher->ongoing_input_view, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ static void rpc_system_app_start_process(const PB_Main* request, void* context)
|
||||
furi_assert(!rpc_app->last_id);
|
||||
furi_assert(!rpc_app->last_data);
|
||||
|
||||
FURI_LOG_D(TAG, "StartProcess: id %d", request->command_id);
|
||||
FURI_LOG_D(TAG, "StartProcess: id %ld", request->command_id);
|
||||
|
||||
PB_CommandStatus result = PB_CommandStatus_ERROR_APP_CANT_START;
|
||||
|
||||
@@ -63,7 +63,7 @@ static void rpc_system_app_start_process(const PB_Main* request, void* context)
|
||||
|
||||
furi_record_close(RECORD_LOADER);
|
||||
|
||||
FURI_LOG_D(TAG, "StartProcess: response id %d, result %d", request->command_id, result);
|
||||
FURI_LOG_D(TAG, "StartProcess: response id %ld, result %d", request->command_id, result);
|
||||
rpc_send_and_release_empty(session, request->command_id, result);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ static void rpc_system_app_exit_request(const PB_Main* request, void* context) {
|
||||
PB_CommandStatus status;
|
||||
|
||||
if(rpc_app->app_callback) {
|
||||
FURI_LOG_D(TAG, "ExitRequest: id %d", request->command_id);
|
||||
FURI_LOG_D(TAG, "ExitRequest: id %ld", request->command_id);
|
||||
furi_assert(!rpc_app->last_id);
|
||||
furi_assert(!rpc_app->last_data);
|
||||
rpc_app->last_id = request->command_id;
|
||||
@@ -116,7 +116,7 @@ static void rpc_system_app_exit_request(const PB_Main* request, void* context) {
|
||||
} else {
|
||||
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
|
||||
FURI_LOG_E(
|
||||
TAG, "ExitRequest: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
|
||||
TAG, "ExitRequest: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
|
||||
rpc_send_and_release_empty(session, request->command_id, status);
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ static void rpc_system_app_load_file(const PB_Main* request, void* context) {
|
||||
|
||||
PB_CommandStatus status;
|
||||
if(rpc_app->app_callback) {
|
||||
FURI_LOG_D(TAG, "LoadFile: id %d", request->command_id);
|
||||
FURI_LOG_D(TAG, "LoadFile: id %ld", request->command_id);
|
||||
furi_assert(!rpc_app->last_id);
|
||||
furi_assert(!rpc_app->last_data);
|
||||
rpc_app->last_id = request->command_id;
|
||||
@@ -141,7 +141,7 @@ static void rpc_system_app_load_file(const PB_Main* request, void* context) {
|
||||
} else {
|
||||
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
|
||||
FURI_LOG_E(
|
||||
TAG, "LoadFile: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
|
||||
TAG, "LoadFile: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
|
||||
rpc_send_and_release_empty(session, request->command_id, status);
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ static void rpc_system_app_button_press(const PB_Main* request, void* context) {
|
||||
} else {
|
||||
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
|
||||
FURI_LOG_E(
|
||||
TAG, "ButtonPress: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
|
||||
TAG, "ButtonPress: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
|
||||
rpc_send_and_release_empty(session, request->command_id, status);
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ static void rpc_system_app_button_release(const PB_Main* request, void* context)
|
||||
} else {
|
||||
status = PB_CommandStatus_ERROR_APP_NOT_RUNNING;
|
||||
FURI_LOG_E(
|
||||
TAG, "ButtonRelease: APP_NOT_RUNNING, id %d, status: %d", request->command_id, status);
|
||||
TAG, "ButtonRelease: APP_NOT_RUNNING, id %ld, status: %d", request->command_id, status);
|
||||
rpc_send_and_release_empty(session, request->command_id, status);
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ void rpc_system_app_confirm(RpcAppSystem* rpc_app, RpcAppSystemEvent event, bool
|
||||
free(rpc_app->last_data);
|
||||
rpc_app->last_data = NULL;
|
||||
}
|
||||
FURI_LOG_D(TAG, "AppConfirm: event %d last_id %d status %d", event, last_id, status);
|
||||
FURI_LOG_D(TAG, "AppConfirm: event %d last_id %ld status %d", event, last_id, status);
|
||||
rpc_send_and_release_empty(session, last_id, status);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -44,7 +44,7 @@ void rpc_cli_command_start_session(Cli* cli, FuriString* args, void* context) {
|
||||
Rpc* rpc = context;
|
||||
|
||||
uint32_t mem_before = memmgr_get_free_heap();
|
||||
FURI_LOG_D(TAG, "Free memory %d", mem_before);
|
||||
FURI_LOG_D(TAG, "Free memory %ld", mem_before);
|
||||
|
||||
furi_hal_usb_lock();
|
||||
RpcSession* rpc_session = rpc_session_open(rpc);
|
||||
|
||||
@@ -158,9 +158,9 @@ void rpc_debug_print_message(const PB_Main* message) {
|
||||
case PB_Main_storage_info_response_tag: {
|
||||
furi_string_cat_printf(str, "\tinfo_response {\r\n");
|
||||
furi_string_cat_printf(
|
||||
str, "\t\ttotal_space: %lu\r\n", message->content.storage_info_response.total_space);
|
||||
str, "\t\ttotal_space: %llu\r\n", message->content.storage_info_response.total_space);
|
||||
furi_string_cat_printf(
|
||||
str, "\t\tfree_space: %lu\r\n", message->content.storage_info_response.free_space);
|
||||
str, "\t\tfree_space: %llu\r\n", message->content.storage_info_response.free_space);
|
||||
break;
|
||||
}
|
||||
case PB_Main_storage_stat_request_tag: {
|
||||
|
||||
@@ -119,7 +119,11 @@ bool storage_file_open(
|
||||
furi_event_flag_free(event);
|
||||
|
||||
FURI_LOG_T(
|
||||
TAG, "File %p - %p open (%s)", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE, path);
|
||||
TAG,
|
||||
"File %p - %p open (%s)",
|
||||
(void*)((uint32_t)file - SRAM_BASE),
|
||||
(void*)(file->file_id - SRAM_BASE),
|
||||
path);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -132,7 +136,11 @@ bool storage_file_close(File* file) {
|
||||
S_API_MESSAGE(StorageCommandFileClose);
|
||||
S_API_EPILOGUE;
|
||||
|
||||
FURI_LOG_T(TAG, "File %p - %p closed", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE);
|
||||
FURI_LOG_T(
|
||||
TAG,
|
||||
"File %p - %p closed",
|
||||
(void*)((uint32_t)file - SRAM_BASE),
|
||||
(void*)(file->file_id - SRAM_BASE));
|
||||
file->type = FileTypeClosed;
|
||||
|
||||
return S_RETURN_BOOL;
|
||||
@@ -291,7 +299,11 @@ bool storage_dir_open(File* file, const char* path) {
|
||||
furi_event_flag_free(event);
|
||||
|
||||
FURI_LOG_T(
|
||||
TAG, "Dir %p - %p open (%s)", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE, path);
|
||||
TAG,
|
||||
"Dir %p - %p open (%s)",
|
||||
(void*)((uint32_t)file - SRAM_BASE),
|
||||
(void*)(file->file_id - SRAM_BASE),
|
||||
path);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -303,7 +315,11 @@ bool storage_dir_close(File* file) {
|
||||
S_API_MESSAGE(StorageCommandDirClose);
|
||||
S_API_EPILOGUE;
|
||||
|
||||
FURI_LOG_T(TAG, "Dir %p - %p closed", (uint32_t)file - SRAM_BASE, file->file_id - SRAM_BASE);
|
||||
FURI_LOG_T(
|
||||
TAG,
|
||||
"Dir %p - %p closed",
|
||||
(void*)((uint32_t)file - SRAM_BASE),
|
||||
(void*)(file->file_id - SRAM_BASE));
|
||||
|
||||
file->type = FileTypeClosed;
|
||||
|
||||
@@ -675,7 +691,7 @@ File* storage_file_alloc(Storage* storage) {
|
||||
file->type = FileTypeClosed;
|
||||
file->storage = storage;
|
||||
|
||||
FURI_LOG_T(TAG, "File/Dir %p alloc", (uint32_t)file - SRAM_BASE);
|
||||
FURI_LOG_T(TAG, "File/Dir %p alloc", (void*)((uint32_t)file - SRAM_BASE));
|
||||
|
||||
return file;
|
||||
}
|
||||
@@ -697,7 +713,7 @@ void storage_file_free(File* file) {
|
||||
}
|
||||
}
|
||||
|
||||
FURI_LOG_T(TAG, "File/Dir %p free", (uint32_t)file - SRAM_BASE);
|
||||
FURI_LOG_T(TAG, "File/Dir %p free", (void*)((uint32_t)file - SRAM_BASE));
|
||||
free(file);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,12 +77,12 @@ static int storage_int_device_read(
|
||||
|
||||
FURI_LOG_T(
|
||||
TAG,
|
||||
"Device read: block %d, off %d, buffer: %p, size %d, translated address: %p",
|
||||
"Device read: block %ld, off %ld, buffer: %p, size %ld, translated address: %p",
|
||||
block,
|
||||
off,
|
||||
buffer,
|
||||
size,
|
||||
address);
|
||||
(void*)address);
|
||||
|
||||
memcpy(buffer, (void*)address, size);
|
||||
|
||||
@@ -100,12 +100,12 @@ static int storage_int_device_prog(
|
||||
|
||||
FURI_LOG_T(
|
||||
TAG,
|
||||
"Device prog: block %d, off %d, buffer: %p, size %d, translated address: %p",
|
||||
"Device prog: block %ld, off %ld, buffer: %p, size %ld, translated address: %p",
|
||||
block,
|
||||
off,
|
||||
buffer,
|
||||
size,
|
||||
address);
|
||||
(void*)address);
|
||||
|
||||
int ret = 0;
|
||||
while(size > 0) {
|
||||
@@ -122,7 +122,7 @@ static int storage_int_device_erase(const struct lfs_config* c, lfs_block_t bloc
|
||||
LFSData* lfs_data = c->context;
|
||||
size_t page = lfs_data->start_page + block;
|
||||
|
||||
FURI_LOG_D(TAG, "Device erase: page %d, translated page: %x", block, page);
|
||||
FURI_LOG_D(TAG, "Device erase: page %ld, translated page: %x", block, page);
|
||||
|
||||
furi_hal_flash_erase(page);
|
||||
return 0;
|
||||
@@ -740,8 +740,8 @@ void storage_int_init(StorageData* storage) {
|
||||
LFSData* lfs_data = storage_int_lfs_data_alloc();
|
||||
FURI_LOG_I(
|
||||
TAG,
|
||||
"Config: start %p, read %d, write %d, page size: %d, page count: %d, cycles: %d",
|
||||
lfs_data->start_address,
|
||||
"Config: start %p, read %ld, write %ld, page size: %ld, page count: %ld, cycles: %ld",
|
||||
(void*)lfs_data->start_address,
|
||||
lfs_data->config.read_size,
|
||||
lfs_data->config.prog_size,
|
||||
lfs_data->config.block_size,
|
||||
|
||||
@@ -271,7 +271,7 @@ bool update_task_validate_optionbytes(UpdateTask* update_task) {
|
||||
match = false;
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"OB MISMATCH: #%d: real %08X != %08X (exp.), full %08X",
|
||||
"OB MISMATCH: #%d: real %08lX != %08lX (exp.), full %08lX",
|
||||
idx,
|
||||
device_ob_value_masked,
|
||||
ref_value,
|
||||
@@ -289,7 +289,7 @@ bool update_task_validate_optionbytes(UpdateTask* update_task) {
|
||||
(manifest->ob_reference.obs[idx].values.base &
|
||||
manifest->ob_write_mask.obs[idx].values.base);
|
||||
|
||||
FURI_LOG_W(TAG, "Fixing up OB byte #%d to %08X", idx, patched_value);
|
||||
FURI_LOG_W(TAG, "Fixing up OB byte #%d to %08lX", idx, patched_value);
|
||||
ob_dirty = true;
|
||||
|
||||
bool is_fixed = furi_hal_flash_ob_set_word(idx, patched_value) &&
|
||||
@@ -301,7 +301,7 @@ bool update_task_validate_optionbytes(UpdateTask* update_task) {
|
||||
* reference value */
|
||||
FURI_LOG_W(
|
||||
TAG,
|
||||
"OB #%d is FUBAR (fixed&masked %08X, not %08X)",
|
||||
"OB #%d is FUBAR (fixed&masked %08lX, not %08lX)",
|
||||
idx,
|
||||
patched_value,
|
||||
ref_value);
|
||||
@@ -310,7 +310,7 @@ bool update_task_validate_optionbytes(UpdateTask* update_task) {
|
||||
} else {
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"OB MATCH: #%d: real %08X == %08X (exp.)",
|
||||
"OB MATCH: #%d: real %08lX == %08lX (exp.)",
|
||||
idx,
|
||||
device_ob_value_masked,
|
||||
ref_value);
|
||||
|
||||
Reference in New Issue
Block a user