Skip to content

Commit

Permalink
avoid int sign mismatch warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
diemoschwarz committed Feb 24, 2023
1 parent 9db5c6e commit e506823
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/signal/rta_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
int rta_window_hann_weights(rta_real_t * weights_vector,
const unsigned int weights_size)
{
int i;
unsigned int i;
int ret = 1; /* return value */
const rta_real_t step = 2. * M_PI / weights_size;

Expand All @@ -61,7 +61,7 @@ int rta_window_hann_weights_stride(
rta_real_t * weights_vector, const int w_stride,
const unsigned int weights_size)
{
int i;
unsigned int i;
int ret = 1; /* return value */
const rta_real_t step = 2. * M_PI / weights_size;

Expand All @@ -76,7 +76,7 @@ int rta_window_hann_weights_stride(
void rta_window_hann_apply_in_place(rta_real_t * input_vector,
const unsigned int input_size)
{
int i;
unsigned int i;
const rta_real_t step = 2. * M_PI / input_size;
for(i=0; i<input_size; i++)
{
Expand All @@ -90,7 +90,7 @@ void rta_window_hann_apply_in_place_stride(
rta_real_t * input_vector, const int i_stride,
const unsigned int input_size)
{
int i;
unsigned int i;
const rta_real_t step = 2. * M_PI / input_size;
for(i=0; i<input_size*i_stride; i+=i_stride)
{
Expand All @@ -106,7 +106,7 @@ int rta_window_hamming_weights(rta_real_t * weights_vector,
const unsigned int weights_size,
const rta_real_t coef)
{
int i;
unsigned int i;
int ret = 1; /* return value */
const rta_real_t step = 2. * M_PI / weights_size;
const rta_real_t scale = (1. - coef) * 0.5;
Expand All @@ -124,7 +124,7 @@ int rta_window_hamming_weights_stride(
const unsigned int weights_size,
const rta_real_t coef)
{
int i;
unsigned int i;
int ret = 1; /* return value */
const rta_real_t step = 2. * M_PI / weights_size;
const rta_real_t scale = (1. - coef) * 0.5;
Expand All @@ -141,7 +141,7 @@ void rta_window_hamming_apply_in_place(rta_real_t * input_vector,
const unsigned int input_size,
const rta_real_t coef)
{
int i;
unsigned int i;
const rta_real_t step = 2. * M_PI / input_size;
const rta_real_t scale = (1. - coef) * 0.5;

Expand All @@ -158,7 +158,7 @@ void rta_window_hamming_apply_in_place_stride(
const unsigned int input_size,
const rta_real_t coef)
{
int i;
unsigned int i;
const rta_real_t step = 2. * M_PI / input_size;
const rta_real_t scale = (1. - coef) * 0.5;

Expand All @@ -176,7 +176,7 @@ void rta_window_apply(rta_real_t * output_vector,
const rta_real_t * input_vector,
const rta_real_t * weights_vector)
{
int i;
unsigned int i;

for(i=0; i<output_size; i++)
{
Expand All @@ -192,7 +192,8 @@ void rta_window_apply_stride(
const rta_real_t * input_vector, const int i_stride,
const rta_real_t * weights_vector, const int w_stride)
{
int o,i,w;
unsigned int o;
int i,w;

for(o=0, i=0, w=0; o<output_size*o_stride; o+=o_stride, i+=i_stride, w+=w_stride)
{
Expand All @@ -207,7 +208,7 @@ void rta_window_apply_in_place(rta_real_t * input_vector,
const unsigned int input_size,
const rta_real_t * weights_vector)
{
int i;
unsigned int i;

for(i=0; i<input_size; i++)
{
Expand All @@ -222,7 +223,8 @@ void rta_window_apply_in_place_stride(
const unsigned int input_size,
const rta_real_t * weights_vector, const int w_stride)
{
int i,w;
unsigned int i;
int w;

for(i=0,w=0; i<input_size*i_stride; i+=i_stride, w+=w_stride)
{
Expand All @@ -237,7 +239,7 @@ void rta_window_rounded_apply(
const rta_real_t * input_vector,
const rta_real_t * weights_vector, const unsigned int weights_size)
{
int i;
unsigned int i;
const rta_real_t step = (rta_real_t) weights_size / (rta_real_t) output_size;

for(i=0; i<output_size; i++)
Expand All @@ -255,7 +257,7 @@ void rta_window_rounded_apply_stride(
const rta_real_t * weights_vector, const int w_stride,
const unsigned int weights_size)
{
int i;
unsigned int i;
const rta_real_t step = (rta_real_t) weights_size / (rta_real_t) output_size;

for(i=0; i<output_size; i++)
Expand All @@ -270,7 +272,7 @@ void rta_window_rounded_apply_in_place(
rta_real_t * input_vector, const unsigned int input_size,
const rta_real_t * weights_vector, const unsigned int weights_size)
{
int i;
unsigned int i;
const rta_real_t step = (rta_real_t) weights_size / (rta_real_t) input_size;

for(i=0; i<input_size; i++)
Expand All @@ -287,7 +289,8 @@ void rta_window_rounded_apply_in_place_stride(
const rta_real_t * weights_vector, const int w_stride,
const unsigned int weights_size)
{
int i,w;
unsigned int i;
int w;
const rta_real_t step = (rta_real_t) weights_size / (rta_real_t) input_size;

for(i=0,w=0; i<input_size*i_stride; i+=i_stride, w+=w_stride)
Expand Down

0 comments on commit e506823

Please sign in to comment.