From 35a12e1e1d82c6aaa8d8735dc3cfd165ae49bfd2 Mon Sep 17 00:00:00 2001 From: liu weikai Date: Sat, 27 Jun 2026 02:12:14 +0800 Subject: [PATCH] style: apply clang-format 14 --- .../src/meshcore/meshcore_phone_core.cpp | 4 +++- .../core_phone/tests/test_phone_core_smoke.cpp | 6 +++--- .../ui_shared/src/ui/app_catalog_builder.cpp | 2 +- .../src/ui/i18n/resource_pack_registry.cpp | 18 +++++++++--------- .../src/ui/screens/gps/gps_page_runtime.cpp | 12 ++++++------ .../chat/infra/meshcore/meshcore_adapter.cpp | 2 +- .../src/chat/infra/meshtastic/mt_adapter.cpp | 2 +- .../src/chat/infra/meshtastic/node_store.cpp | 2 +- .../src/chat/infra/rnode/rnode_adapter.cpp | 2 +- .../src/mesh/esp_meshtastic_adapter_bridge.cpp | 2 +- .../src/ui/runtime/pack_repository.cpp | 6 +++--- 11 files changed, 30 insertions(+), 28 deletions(-) diff --git a/modules/core_phone/src/meshcore/meshcore_phone_core.cpp b/modules/core_phone/src/meshcore/meshcore_phone_core.cpp index 69047c92..6014a4a6 100644 --- a/modules/core_phone/src/meshcore/meshcore_phone_core.cpp +++ b/modules/core_phone/src/meshcore/meshcore_phone_core.cpp @@ -192,7 +192,9 @@ void MeshCorePhoneCore::operator delete(void* ptr, std::size_t) noexcept #endif MeshCorePhoneCore::MeshCorePhoneCore(IPhoneAppFacade& app, const std::string& device_name, MeshCorePhoneHooks* hooks) - : app_(app), device_name_(device_name), hooks_(hooks) {} + : app_(app), device_name_(device_name), hooks_(hooks) +{ +} void MeshCorePhoneCore::reset() { diff --git a/modules/core_phone/tests/test_phone_core_smoke.cpp b/modules/core_phone/tests/test_phone_core_smoke.cpp index 256bde7c..c960253a 100644 --- a/modules/core_phone/tests/test_phone_core_smoke.cpp +++ b/modules/core_phone/tests/test_phone_core_smoke.cpp @@ -158,9 +158,9 @@ bool encodeAdminSetPrimaryCustomChannelToRadio(uint8_t* out, } bool encodeAdminSetManualLoraConfigToRadio(uint8_t* out, - size_t out_len, - size_t& written, - uint32_t packet_id) + size_t out_len, + size_t& written, + uint32_t packet_id) { meshtastic_AdminMessage admin = meshtastic_AdminMessage_init_zero; admin.which_payload_variant = meshtastic_AdminMessage_set_config_tag; diff --git a/modules/ui_shared/src/ui/app_catalog_builder.cpp b/modules/ui_shared/src/ui/app_catalog_builder.cpp index ad37d185..ff9c2b26 100644 --- a/modules/ui_shared/src/ui/app_catalog_builder.cpp +++ b/modules/ui_shared/src/ui/app_catalog_builder.cpp @@ -22,8 +22,8 @@ #endif #include "ui/screens/settings/settings_page_shell.h" #if !defined(TRAIL_MATE_ENABLE_SSTV) || TRAIL_MATE_ENABLE_SSTV -#include "ui/screens/sstv/sstv_page_shell.h" #include "ui/screens/sstv/sstv_page_runtime.h" +#include "ui/screens/sstv/sstv_page_shell.h" #endif #if !defined(GAT562_NO_TEAM) || !GAT562_NO_TEAM #include "ui/screens/team/team_page_shell.h" diff --git a/modules/ui_shared/src/ui/i18n/resource_pack_registry.cpp b/modules/ui_shared/src/ui/i18n/resource_pack_registry.cpp index 9eb0c705..5fd79304 100644 --- a/modules/ui_shared/src/ui/i18n/resource_pack_registry.cpp +++ b/modules/ui_shared/src/ui/i18n/resource_pack_registry.cpp @@ -546,7 +546,8 @@ bool parse_manifest_file(const std::string& path, Manifest& out) { out.clear(); - const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) { + const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) + { trim_in_place(line); if (!line.empty() && line[0] != '#' && line[0] != ';') @@ -562,8 +563,7 @@ bool parse_manifest_file(const std::string& path, Manifest& out) } } } - return true; - }); + return true; }); return read_ok && !out.empty(); } @@ -824,7 +824,8 @@ bool parse_ranges_file(const std::string& path, std::vector& out { out.clear(); - const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) { + const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) + { std::size_t token_start = 0; while (token_start <= line.size()) { @@ -842,8 +843,7 @@ bool parse_ranges_file(const std::string& path, std::vector& out } token_start = token_end + 1U; } - return true; - }); + return true; }); normalize_ranges(out); return read_ok && !out.empty(); @@ -2141,7 +2141,8 @@ bool parse_locale_strings(const std::string& path, { out.clear(); - const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) { + const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) + { if (!line.empty() && line[0] != '#') { const std::size_t sep = line.find('\t'); @@ -2155,8 +2156,7 @@ bool parse_locale_strings(const std::string& path, } } } - return true; - }); + return true; }); std::sort(out.begin(), out.end(), diff --git a/modules/ui_shared/src/ui/screens/gps/gps_page_runtime.cpp b/modules/ui_shared/src/ui/screens/gps/gps_page_runtime.cpp index 438adf8c..be5cd710 100644 --- a/modules/ui_shared/src/ui/screens/gps/gps_page_runtime.cpp +++ b/modules/ui_shared/src/ui/screens/gps/gps_page_runtime.cpp @@ -1088,7 +1088,8 @@ bool load_gpx_track_points(const char* path, std::vector& out } out.reserve(kMaxTrackOverlayPoints); - const bool read_ok = read_track_file_lines(path, [&out](const std::string& line) { + const bool read_ok = read_track_file_lines(path, [&out](const std::string& line) + { if (line.find("& out { append_track_point(out, lat, lon); } - } - }); + } }); return read_ok && !out.empty(); } @@ -1111,7 +1111,8 @@ bool load_csv_track_points(const char* path, std::vector& out } out.reserve(kMaxTrackOverlayPoints); - const bool read_ok = read_track_file_lines(path, [&out](std::string line) { + const bool read_ok = read_track_file_lines(path, [&out](std::string line) + { line = trim_copy(std::move(line)); if (!line.empty()) { @@ -1135,8 +1136,7 @@ bool load_csv_track_points(const char* path, std::vector& out } } } - } - }); + } }); return read_ok && !out.empty(); } diff --git a/platform/esp/arduino_common/src/chat/infra/meshcore/meshcore_adapter.cpp b/platform/esp/arduino_common/src/chat/infra/meshcore/meshcore_adapter.cpp index 1bfbd351..1c142a6e 100644 --- a/platform/esp/arduino_common/src/chat/infra/meshcore/meshcore_adapter.cpp +++ b/platform/esp/arduino_common/src/chat/infra/meshcore/meshcore_adapter.cpp @@ -16,7 +16,6 @@ #include "sys/event_bus.h" #include #include -#include #include #include #include @@ -26,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/platform/esp/arduino_common/src/chat/infra/meshtastic/mt_adapter.cpp b/platform/esp/arduino_common/src/chat/infra/meshtastic/mt_adapter.cpp index 92bee069..5ec2d07b 100644 --- a/platform/esp/arduino_common/src/chat/infra/meshtastic/mt_adapter.cpp +++ b/platform/esp/arduino_common/src/chat/infra/meshtastic/mt_adapter.cpp @@ -15,12 +15,12 @@ #include "sys/event_bus.h" #include "team/protocol/team_portnum.h" #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/platform/esp/arduino_common/src/chat/infra/meshtastic/node_store.cpp b/platform/esp/arduino_common/src/chat/infra/meshtastic/node_store.cpp index 4cb9ec96..69c9fad9 100644 --- a/platform/esp/arduino_common/src/chat/infra/meshtastic/node_store.cpp +++ b/platform/esp/arduino_common/src/chat/infra/meshtastic/node_store.cpp @@ -14,8 +14,8 @@ #include #include #include -#include #include +#include #include namespace chat diff --git a/platform/esp/arduino_common/src/chat/infra/rnode/rnode_adapter.cpp b/platform/esp/arduino_common/src/chat/infra/rnode/rnode_adapter.cpp index 0ee251a2..9f0a00fd 100644 --- a/platform/esp/arduino_common/src/chat/infra/rnode/rnode_adapter.cpp +++ b/platform/esp/arduino_common/src/chat/infra/rnode/rnode_adapter.cpp @@ -8,11 +8,11 @@ #include "chat/time_utils.h" #include "platform/esp/arduino_common/app_tasks.h" #include -#include #include #include #include #include +#include #include namespace chat diff --git a/platform/esp/arduino_common/src/mesh/esp_meshtastic_adapter_bridge.cpp b/platform/esp/arduino_common/src/mesh/esp_meshtastic_adapter_bridge.cpp index 3f5af7de..78160056 100644 --- a/platform/esp/arduino_common/src/mesh/esp_meshtastic_adapter_bridge.cpp +++ b/platform/esp/arduino_common/src/mesh/esp_meshtastic_adapter_bridge.cpp @@ -3,9 +3,9 @@ #include "platform/esp/arduino_common/app_tasks.h" #include -#include #include #include +#include #include namespace platform::esp::arduino_common::mesh diff --git a/platform/esp/arduino_common/src/ui/runtime/pack_repository.cpp b/platform/esp/arduino_common/src/ui/runtime/pack_repository.cpp index 41bd99c5..9e3c70c5 100644 --- a/platform/esp/arduino_common/src/ui/runtime/pack_repository.cpp +++ b/platform/esp/arduino_common/src/ui/runtime/pack_repository.cpp @@ -1784,10 +1784,10 @@ bool sha256_file(const std::string& logical_path, std::string& out_hex) mbedtls_sha256_context ctx; mbedtls_sha256_init(&ctx); mbedtls_sha256_starts(&ctx, 0); - const bool ok = read_file_chunks(logical_path, [&ctx](const std::uint8_t* data, std::size_t len) { + const bool ok = read_file_chunks(logical_path, [&ctx](const std::uint8_t* data, std::size_t len) + { mbedtls_sha256_update(&ctx, data, len); - return true; - }); + return true; }); if (!ok) { mbedtls_sha256_free(&ctx);