chore(ui/sim): 修 cppcheck 两项风格提示(未用变量 / 可缩作用域)

来源:合并后主树全量 ci_local 复跑,manual 阶段 cppcheck(提交期
不跑)抓出两处——sim_publish_data_frames 遗留未用变量 i;待机屏
sb_value_str 变量 n 作用域可缩进挂单位 if 块内。
验证:cppcheck 定向两文件 Passed;双端构建同码同数
(Code=256588 RO=32036 RW=2088 ZI=152584);菜单 8 态与内容页
74 张(含 rtlive A≠B 30 字节差)全过。
This commit is contained in:
2026-11-13 16:02:08 +08:00
parent a98d4e06e8
commit 099a50a49e
3 changed files with 5 additions and 7 deletions
+1 -2
View File
@@ -153,7 +153,6 @@ static uint8_t sb_frame_ready(void) {
*/ */
static void sb_value_str(uint32_t a_idx, char *a_buf, uint32_t a_len) { static void sb_value_str(uint32_t a_idx, char *a_buf, uint32_t a_len) {
const ui_data_yc_t *p; const ui_data_yc_t *p;
uint32_t n;
if ((a_idx >= SB_CH_COUNT) || (sb_frame_ready() == 0u) || if ((a_idx >= SB_CH_COUNT) || (sb_frame_ready() == 0u) ||
(s_ch_yc[a_idx] >= (uint8_t)UI_DATA_YC_N)) { (s_ch_yc[a_idx] >= (uint8_t)UI_DATA_YC_N)) {
@@ -168,7 +167,7 @@ static void sb_value_str(uint32_t a_idx, char *a_buf, uint32_t a_len) {
ui_w_editor_fmt_scaled((p->val > 0.0f) ? (int32_t)((p->val * 1000.0f) + 0.5f) : 0, ui_w_editor_fmt_scaled((p->val > 0.0f) ? (int32_t)((p->val * 1000.0f) + 0.5f) : 0,
SB_DECIMALS, a_buf, a_len); SB_DECIMALS, a_buf, a_len);
if (s_rt.eng != (uint8_t)UI_DATA_ENG_PIN) { if (s_rt.eng != (uint8_t)UI_DATA_ENG_PIN) {
n = (uint32_t)strlen(a_buf); uint32_t n = (uint32_t)strlen(a_buf);
if ((n + 1u) < a_len) { if ((n + 1u) < a_len) {
a_buf[n] = (a_idx < 3u) ? 'V' : 'A'; a_buf[n] = (a_idx < 3u) ? 'V' : 'A';
a_buf[n + 1u] = (char)0; a_buf[n + 1u] = (char)0;
+4 -4
View File
@@ -1,15 +1,15 @@
{ {
"built_at": "2026-11-13T14:51:49+08:00", "built_at": "2026-11-13T16:02:07+08:00",
"fingerprint": "7bca71501bd2582cd221f9cfea5d4db5d196d3d40a583ff119dfd26841355379", "fingerprint": "f6c08bfe7cee85ff075041fcbdf57f41bb43bd99c6d58fa70bc9fd341d435176",
"fingerprint_files": 1479, "fingerprint_files": 1479,
"fingerprint_source": "git-index", "fingerprint_source": "git-index",
"gated_regions": [ "gated_regions": [
"RW_IRAM1", "RW_IRAM1",
"RW_CCM" "RW_CCM"
], ],
"git_head": "a5142c6d9d11b751d5ff1390bd815f5202bcdabb", "git_head": "a98d4e06e8fa47dcd15ba5d1364651d1769e4b1b",
"map": "MDK-ARM/STM32F407-Demo/STM32F407-Demo.map", "map": "MDK-ARM/STM32F407-Demo/STM32F407-Demo.map",
"map_mtime": 1794551787, "map_mtime": 1794556900,
"pct": { "pct": {
"ER_IROM1": 27.53, "ER_IROM1": 27.53,
"RW_CCM": 87.89, "RW_CCM": 87.89,
-1
View File
@@ -1102,7 +1102,6 @@ static void sim_publish_rt_live(uint32_t n) {
static void sim_publish_data_frames(void) { static void sim_publish_data_frames(void) {
ui_data_rt_t rt; ui_data_rt_t rt;
ui_data_info_t info; ui_data_info_t info;
uint8_t i;
ui_data_init(); ui_data_init();