1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-30 19:04:51 +00:00

Using limits.h instead of hardcoded values

This commit is contained in:
Carles Fernandez 2016-01-21 12:30:46 +01:00
parent 62a17dc3d7
commit d139e6d93a

View File

@ -33,6 +33,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <math.h> #include <math.h>
#include <limits.h>
#include "volk_gnsssdr/volk_gnsssdr_complex.h" #include "volk_gnsssdr/volk_gnsssdr_complex.h"
@ -55,8 +56,8 @@ static inline void volk_gnsssdr_32fc_convert_8ic_u_sse2(lv_8sc_t* outputVector,
float* inputVectorPtr = (float*)inputVector; float* inputVectorPtr = (float*)inputVector;
int8_t* outputVectorPtr = (int8_t*)outputVector; int8_t* outputVectorPtr = (int8_t*)outputVector;
float min_val = -128; float min_val = SCHAR_MIN;
float max_val = 127; float max_val = SCHAR_MAX;
__m128 inputVal1, inputVal2, inputVal3, inputVal4; __m128 inputVal1, inputVal2, inputVal3, inputVal4;
__m128i intInputVal1, intInputVal2, intInputVal3, intInputVal4; __m128i intInputVal1, intInputVal2, intInputVal3, intInputVal4;
@ -113,8 +114,8 @@ static inline void volk_gnsssdr_32fc_convert_8ic_generic(lv_8sc_t* outputVector,
{ {
float* inputVectorPtr = (float*)inputVector; float* inputVectorPtr = (float*)inputVector;
int8_t* outputVectorPtr = (int8_t*)outputVector; int8_t* outputVectorPtr = (int8_t*)outputVector;
float min_val = -128; float min_val = SCHAR_MIN;
float max_val = 127; float max_val = SCHAR_MAX;
for(unsigned int i = 0; i < num_points * 2; i++) for(unsigned int i = 0; i < num_points * 2; i++)
{ {
@ -143,8 +144,8 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_sse2(lv_8sc_t* outputVector,
float* inputVectorPtr = (float*)inputVector; float* inputVectorPtr = (float*)inputVector;
int8_t* outputVectorPtr = (int8_t*)outputVector; int8_t* outputVectorPtr = (int8_t*)outputVector;
float min_val = -128; float min_val = SCHAR_MIN;
float max_val = 127; float max_val = SCHAR_MAX;
__m128 inputVal1, inputVal2, inputVal3, inputVal4; __m128 inputVal1, inputVal2, inputVal3, inputVal4;
__m128i intInputVal1, intInputVal2, intInputVal3, intInputVal4; __m128i intInputVal1, intInputVal2, intInputVal3, intInputVal4;