From 9e23f5d5dbefb2693aea3a463043817097a13fe9 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 19 Dec 2024 16:40:55 +0100 Subject: [PATCH] fix sudden increase of complexity due to incorrect type (long instead of unsigned int) in the BASOP counter reset function --- lib_debug/wmc_auto.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_debug/wmc_auto.c b/lib_debug/wmc_auto.c index 1ab20a2ee8..31a9073aff 100644 --- a/lib_debug/wmc_auto.c +++ b/lib_debug/wmc_auto.c @@ -2199,19 +2199,19 @@ long DeltaWeightedOperation( void ) } /* Resets the current BASOP WMOPS counter */ -void Reset_BASOP_WMOPS_counter( void ) +void Reset_BASOP_WMOPS_counter( unsigned int counterId ) { int i; - long *ptr; + unsigned int *ptr; - /* clear the current BASOP operation counter before new frame begins */ - ptr = (long *) &multiCounter[currCounter]; - for ( i = 0; i < (int) ( sizeof( multiCounter[currCounter] ) / sizeof( long ) ); i++ ) + /* reset the current BASOP operation counter */ + ptr = (unsigned int *) &multiCounter[counterId]; + for ( i = 0; i < (int) (sizeof(BASIC_OP) / sizeof(unsigned int)); i++ ) { *ptr++ = 0; } - wmops[currCounter].LastWOper = 0; + wmops[counterId].LastWOper = 0; return; } -- GitLab