mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 05:13:34 +08:00
logger:Use inttypes
This commit is contained in:
committed by
Julian Oes
parent
3b725e5525
commit
5faa116681
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2016 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2016, 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -1121,7 +1121,7 @@ int Logger::create_log_dir(LogType type, tm *tt, char *log_dir, int log_dir_len)
|
||||
/* look for the next dir that does not exist */
|
||||
while (!file_name.has_log_dir) {
|
||||
/* format log dir: e.g. /fs/microsd/log/sess001 */
|
||||
int n2 = snprintf(file_name.log_dir, sizeof(LogFileName::log_dir), "sess%03u", dir_number);
|
||||
int n2 = snprintf(file_name.log_dir, sizeof(LogFileName::log_dir), "sess%03" PRIu16, dir_number);
|
||||
|
||||
if (n2 >= (int)sizeof(LogFileName::log_dir)) {
|
||||
PX4_ERR("log path too long (%i)", n);
|
||||
@@ -1192,7 +1192,7 @@ int Logger::get_log_file_name(LogType type, char *file_name, size_t file_name_si
|
||||
/* look for the next file that does not exist */
|
||||
while (file_number <= MAX_NO_LOGFILE) {
|
||||
/* format log file path: e.g. /fs/microsd/log/sess001/log001.ulg */
|
||||
snprintf(log_file_name, sizeof(LogFileName::log_file_name), "log%03u%s.ulg", file_number, replay_suffix);
|
||||
snprintf(log_file_name, sizeof(LogFileName::log_file_name), "log%03" PRIu16 "%s.ulg", file_number, replay_suffix);
|
||||
snprintf(file_name + n, file_name_size - n, "/%s", log_file_name);
|
||||
|
||||
if (!util::file_exist(file_name)) {
|
||||
@@ -1682,7 +1682,7 @@ void Logger::write_info_multiple(LogType type, const char *name, const char *val
|
||||
write_message(type, buffer, msg_size);
|
||||
|
||||
} else {
|
||||
PX4_ERR("info_multiple str too long (%i), key=%s", msg.key_len, msg.key);
|
||||
PX4_ERR("info_multiple str too long (%" PRIu8 "), key=%s", msg.key_len, msg.key);
|
||||
}
|
||||
|
||||
_writer.unlock();
|
||||
@@ -1809,7 +1809,7 @@ void Logger::write_version(LogType type)
|
||||
|
||||
// data versioning: increase this on every larger data change (format/semantic)
|
||||
// 1: switch to FIFO drivers (disabled on-chip DLPF)
|
||||
write_info(type, "ver_data_format", 1);
|
||||
write_info(type, "ver_data_format", static_cast<uint32_t>(1));
|
||||
|
||||
#ifndef BOARD_HAS_NO_UUID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user