From f9706f45c41bdce9cfa05e700519ad707f936de5 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Thu, 30 Apr 2026 19:13:03 +0800 Subject: [PATCH] tp -fix cppcheck invalidPrintfArgType_uint regressions term_cond and motion_type are signed int (declared in tc_types.h); %u format specifier requires unsigned int. Restore %d that was previously fixed in commit b55ad81b22 but accidentally reverted by PR #3683 (commit 402828cd04, stale-base rebase clobber). Added inline comments noting the field signedness so future rebases do not silently flip these specifiers back to %u. Fixes cppcheck warnings: emc/tp/tp.c:1709:9: invalidPrintfArgType_uint emc/tp/tp.c:1724:5: invalidPrintfArgType_uint (x2) --- src/emc/tp/tp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emc/tp/tp.c b/src/emc/tp/tp.c index c286207f51c..cd458abc9e3 100644 --- a/src/emc/tp/tp.c +++ b/src/emc/tp/tp.c @@ -1706,7 +1706,8 @@ STATIC blend_type_t tpCheckBlendArcType( //If exact stop, we don't compute the arc if (prev_tc->term_cond != TC_TERM_COND_PARABOLIC) { - tp_debug_print("Wrong term cond = %u\n", prev_tc->term_cond); + // term_cond is signed int; use %d (cppcheck invalidPrintfArgType_uint) + tp_debug_print("Wrong term cond = %d\n", prev_tc->term_cond); return BLEND_NONE; } @@ -1721,7 +1722,8 @@ STATIC blend_type_t tpCheckBlendArcType( return BLEND_NONE; } - tp_debug_print("Motion types: prev_tc = %u, tc = %u\n", + // motion_type is signed int; use %d (cppcheck invalidPrintfArgType_uint) + tp_debug_print("Motion types: prev_tc = %d, tc = %d\n", prev_tc->motion_type,tc->motion_type); //If not linear blends, we can't easily compute an arc if ((prev_tc->motion_type == TC_LINEAR) && (tc->motion_type == TC_LINEAR)) {