current codes after applying clang-format is:
#ifndef CEEDLING_TEST
static
#endif
void
Measurement(const uint16_t *buff)
{
g_rmsValue1ms = Get1msRmsValue(buff);
g_rmsValue60ms = MovingAvgFilter(&g_MaFilter, g_rmsValue1ms);
}
expected:
#ifndef CEEDLING_TEST
static
#endif
void Measurement(const uint16_t *buff)
{
g_rmsValue1ms = Get1msRmsValue(buff);
g_rmsValue60ms = MovingAvgFilter(&g_MaFilter, g_rmsValue1ms);
}
Does someone knows which parameter is used to define the behavior like that?
I am not aware of the clang-format option for that.
I'd suggest a small change to your code. Instead of #ifdef
-ing the static
keyword, you could #ifdef
a macro, that decides whether the function is static. This not only resolves issue with clang-format, but also potentially saves you a lot of #ifdef CEEDLING_TEST
s and #endif
s.
#ifdef CEEDLING_TEST
#define MY_STATIC
#else
#define MY_STATIC static
#endif
MY_STATIC
void Measurement(const uint16_t* buff)
{
g_rmsValue1ms = Get1msRmsValue(buff);
g_rmsValue60ms = MovingAvgFilter(&g_MaFilter, g_rmsValue1ms);
}