Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BatchDrake committed May 8, 2024
1 parent 6b37442 commit a46a522
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmake/cmake-pcfilegenerator
3 changes: 0 additions & 3 deletions src/sigutils/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#include <sigutils/block.h>
#include <sigutils/log.h>

static unsigned int class_storage;
static unsigned int class_count;

/****************************** su_stream API ********************************/
SU_CONSTRUCTOR(su_stream, SUSCOUNT size)
{
Expand Down
4 changes: 2 additions & 2 deletions src/sigutils/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ su_lib_set_wisdom_enabled(SUBOOL enabled)
}

g_su_measure_ffts = enabled;

return SU_TRUE;
}

SUBOOL
Expand Down Expand Up @@ -193,8 +195,6 @@ su_lib_gen_wisdom(void)
SUBOOL
su_lib_init_ex(const struct sigutils_log_config *logconfig)
{
unsigned int i = 0;

if (logconfig != NULL)
su_log_init(logconfig);

Expand Down
2 changes: 0 additions & 2 deletions src/sigutils/pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ SU_DESTRUCTOR(su_pll)

SU_CONSTRUCTOR(su_pll, SUFLOAT fhint, SUFLOAT fc)
{
SUFLOAT dinv;

memset(self, 0, sizeof(su_pll_t));

su_pll_set_cutoff(self, fc);
Expand Down
5 changes: 3 additions & 2 deletions src/sigutils/smoothpsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ SU_INSTANCER(
SUPRIVATE
SU_METHOD(su_smoothpsd, SUBOOL, exec_fft)
{
unsigned int i;
SUFLOAT wsizeinv = 1. / (self->params.fft_size * self->nominal_rate);

/* Execute FFT */
Expand All @@ -81,6 +80,8 @@ SU_METHOD(su_smoothpsd, SUBOOL, exec_fft)
volk_32fc_deinterleave_real_32f(self->realfft, self->fft, self->params.fft_size);
volk_32f_s32f_multiply_32f(self->realfft, self->realfft, wsizeinv, self->params.fft_size);
#else
unsigned int i;

for (i = 0; i < self->params.fft_size; ++i)
self->realfft[i] =
wsizeinv * SU_C_REAL(self->fft[i] * SU_C_CONJ(self->fft[i]));
Expand All @@ -98,7 +99,6 @@ SU_METHOD(su_smoothpsd, SUBOOL, exec_fft)
SU_METHOD(su_smoothpsd, SUBOOL, feed, const SUCOMPLEX *data, SUSCOUNT size)
{
unsigned int chunk;
unsigned int i;
SUBOOL mutex_acquired = SU_FALSE;
SUBOOL ok = SU_FALSE;

Expand Down Expand Up @@ -135,6 +135,7 @@ SU_METHOD(su_smoothpsd, SUBOOL, feed, const SUCOMPLEX *data, SUSCOUNT size)
volk_32fc_x2_multiply_32fc(self->fft, self->fft, self->window_func,
self->params.fft_size);
#else
unsigned int i;
for (i = 0; i < self->params.fft_size; ++i)
self->fft[i] *= self->window_func[i];
#endif
Expand Down
12 changes: 3 additions & 9 deletions src/sigutils/specttuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ SU_METHOD_CONST(
unsigned int window_size = self->params.window_size;
SUFLOAT rbw = 2 * PI / window_size;
SUFLOAT off = 0, ef;
const su_ncqo_t *old = NULL, *new = NULL;

ef = su_specttuner_channel_get_effective_freq(channel);
channel->center = 2 * SU_FLOOR(.5 * (ef + 1 * rbw) / (2 * PI) * window_size);
Expand All @@ -191,11 +190,6 @@ SU_METHOD_CONST(
}

if (channel->params.on_freq_changed != NULL) {
if (channel->params.precise) {
old = &channel->old_lo;
new = &channel->lo;
}

channel->params.on_freq_changed(
channel,
channel->params.privdata,
Expand Down Expand Up @@ -630,8 +624,6 @@ SU_INSTANCER(su_specttuner, const struct sigutils_specttuner_params *params)

SU_METHOD(su_specttuner, void, run_fft, su_specttuner_plan_t *plan)
{
unsigned int i;

/* Early windowing, copy windowed input */
if (self->params.early_windowing) {
if (self->state == SU_SPECTTUNER_STATE_EVEN) {
Expand All @@ -642,6 +634,7 @@ SU_METHOD(su_specttuner, void, run_fft, su_specttuner_plan_t *plan)
self->wfunc,
self->params.window_size);
#else
unsigned int i;
for (i = 0; i < self->params.window_size; ++i)
self->fft[i] = self->buffer[i] * self->wfunc[i];
#endif /* SU_USE_VOLK */
Expand All @@ -653,6 +646,7 @@ SU_METHOD(su_specttuner, void, run_fft, su_specttuner_plan_t *plan)
self->wfunc,
self->params.window_size);
#else
unsigned int i;
for (i = 0; i < self->params.window_size; ++i)
self->fft[i] = self->buffer[i + self->half_size] * self->wfunc[i];
#endif /* SU_USE_VOLK */
Expand All @@ -670,7 +664,7 @@ __su_specttuner_feed_bulk(
SUSCOUNT size)
{
SUSDIFF halfsz;
SUSDIFF p, i;
SUSDIFF p;

if (size + self->p > self->params.window_size)
size = self->params.window_size - self->p;
Expand Down

0 comments on commit a46a522

Please sign in to comment.