Instrumentation of Ternary Operator in function call with WMC tool
While instrumenting the latest version of the External Renderer code, the instrumented code does not compile due to the following errors:
In file included from lib_rend/lib_rend.c:50:
lib_rend/lib_rend.c: In function ‘renderMcCustomLsToBinauralRoom’:
lib_rend/lib_rend.c:3608:71: error: type mismatch in conditional expression
3608 | $("[]") renderBufferChannel_( headRotEnabled ?_ tmpRotBuffer :_ mcInput->base.inputBuffer,
| ^
lib_rend/lib_rend.c:3608:87: error: type mismatch in conditional expression
3608 | $("[]") renderBufferChannel_( headRotEnabled ?_ tmpRotBuffer :_ mcInput->base.inputBuffer,
| ^
lib_rend/lib_rend.c: In function ‘renderSbaToBinauralRoom’:
lib_rend/lib_rend.c:3886:71: error: type mismatch in conditional expression
3886 | $("[]") renderBufferChannel_( headRotEnabled ?_ tmpRotBuffer :_ sbaInput->base.inputBuffer,
| ^
lib_rend/lib_rend.c:3886:87: error: type mismatch in conditional expression
3886 | $("[]") renderBufferChannel_( headRotEnabled ?_ tmpRotBuffer :_ sbaInput->base.inputBuffer,
These can be found in the original code at lines 3495 and 3773 of commit 2bbf2bfa
Something similar is performed in the same file on line 3052 and 3053 but do not cause issues:
$("M->..->.->.->.->.Ne") if_ ( ( error = getEfapGains_( *ismInput->base.ctx.pEfapOutWrapper,
( headRotData->headRotEnabled ) ?_ rotatedPos.azimuth :_ ismInput->previousPos.azimuth,
( headRotData->headRotEnabled ) ?_ rotatedPos.elevation :_ ismInput->previousPos.elevation,
previousPanGains ) ) != IVAS_ERR_OK )
It seems to be related to the #define _
to deactivate ternary operators.
@malenovsky , could you have a look, please?
Edited by Archit Tamarapu