From 62f2cf649672f42678466fdbfb20124a69724b4b Mon Sep 17 00:00:00 2001 From: Paul Sutton Date: Thu, 19 Mar 2015 14:47:28 +0000 Subject: [PATCH] Fixes for clang warnings, moved cf_t definition to config.h to avoid redefinitions --- .../2.8.12.2/CompilerIdC/CMakeCCompilerId.c | 389 ++++++++++++++++++ common/include/srslte/config.h | 3 + mex/include/srslte/mex/mexutils.h | 2 +- srslte/include/srslte/agc/agc.h | 1 - .../srslte/ch_estimation/refsignal_dl.h | 2 - .../srslte/ch_estimation/refsignal_ul.h | 2 - srslte/include/srslte/channel/ch_awgn.h | 2 - srslte/include/srslte/common/phy_common.h | 2 - srslte/include/srslte/dft/dft.h | 2 - srslte/include/srslte/dft/dft_precoding.h | 2 - srslte/include/srslte/dft/ofdm.h | 2 - srslte/include/srslte/mimo/layermap.h | 2 - srslte/include/srslte/mimo/precoding.h | 2 - srslte/include/srslte/modem/demod_hard.h | 2 - srslte/include/srslte/modem/mod.h | 2 - srslte/include/srslte/modem/modem_table.h | 1 - srslte/include/srslte/phch/dci.h | 2 - srslte/include/srslte/phch/pbch.h | 2 - srslte/include/srslte/phch/pcfich.h | 2 - srslte/include/srslte/phch/pdcch.h | 2 +- srslte/include/srslte/phch/pdsch.h | 2 +- srslte/include/srslte/phch/phich.h | 2 +- srslte/include/srslte/phch/prach.h | 2 +- srslte/include/srslte/phch/pucch.h | 2 - srslte/include/srslte/phch/pusch.h | 2 +- srslte/include/srslte/phch/regs.h | 2 - srslte/include/srslte/resampling/decim.h | 4 +- srslte/include/srslte/resampling/interp.h | 2 - .../include/srslte/resampling/resample_arb.h | 2 - srslte/include/srslte/scrambling/scrambling.h | 2 - srslte/include/srslte/sync/cfo.h | 2 - srslte/include/srslte/sync/pss.h | 2 - srslte/include/srslte/sync/sss.h | 2 - srslte/include/srslte/ue/ue_phy.h | 2 +- srslte/include/srslte/utils/cexptab.h | 2 - srslte/include/srslte/utils/convolution.h | 2 - srslte/include/srslte/utils/vector.h | 2 - srslte/lib/fec/src/parity.h | 2 +- srslte/lib/fec/test/turbodecoder_test.c | 2 +- srslte/lib/fec/test/viterbi_test.c | 2 +- srslte/lib/modem/src/soft_algs.c | 2 +- srslte/lib/phch/src/prb_dl.h | 3 +- srslte/lib/phch/test/prach_test.c | 2 +- srslte/lib/phch/test/prach_test_multi.c | 2 +- .../lib/resampling/test/resample_arb_bench.c | 2 +- .../lib/resampling/test/resample_arb_test.c | 2 +- srslte/lib/utils/test/dft_test.c | 2 +- 47 files changed, 410 insertions(+), 73 deletions(-) create mode 100644 build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c diff --git a/build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 000000000..cba81d4a6 --- /dev/null +++ b/build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,389 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_C = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) +# if defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" +# else +# if __IBMC__ >= 800 +# define COMPILER_ID "XL" +# else +# define COMPILER_ID "VisualAge" +# endif + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +/* Analog VisualDSP++ >= 4.5.6 */ +#elif defined(__VISUALDSPVERSION__) +# define COMPILER_ID "ADSP" + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) + +/* Analog VisualDSP++ < 4.5.6 */ +#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" + +/* IAR Systems compiler for embedded systems. + http://www.iar.com */ +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + +/* sdcc, the small devices C compiler for embedded systems, + http://sdcc.sourceforge.net */ +#elif defined(SDCC) +# define COMPILER_ID "SDCC" + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + +/* This compiler is either not known or is too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" + +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM) +# define ARCHITECTURE_ID "ARM" + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID "" +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif + (void)argv; + return require; +} +#endif diff --git a/common/include/srslte/config.h b/common/include/srslte/config.h index 4038a49a9..19445de96 100644 --- a/common/include/srslte/config.h +++ b/common/include/srslte/config.h @@ -58,4 +58,7 @@ #define SRSLTE_ERROR -1 #define SRSLTE_ERROR_INVALID_INPUTS -2 +// cf_t definition +typedef _Complex float cf_t; + #endif // CONFIG_H diff --git a/mex/include/srslte/mex/mexutils.h b/mex/include/srslte/mex/mexutils.h index 95e5c2d96..e189454e0 100644 --- a/mex/include/srslte/mex/mexutils.h +++ b/mex/include/srslte/mex/mexutils.h @@ -40,7 +40,7 @@ #include "srslte/config.h" -typedef _Complex float cf_t; + SRSLTE_API bool mexutils_isScalar(const mxArray *ptr); diff --git a/srslte/include/srslte/agc/agc.h b/srslte/include/srslte/agc/agc.h index 3b116b6ee..c40a5d56a 100644 --- a/srslte/include/srslte/agc/agc.h +++ b/srslte/include/srslte/agc/agc.h @@ -39,7 +39,6 @@ /* Automatic Gain Control * */ -typedef _Complex float cf_t; #define SRSLTE_AGC_DEFAULT_BW (5e-2) diff --git a/srslte/include/srslte/ch_estimation/refsignal_dl.h b/srslte/include/srslte/ch_estimation/refsignal_dl.h index 08ed8581a..2f744b0a3 100644 --- a/srslte/include/srslte/ch_estimation/refsignal_dl.h +++ b/srslte/include/srslte/ch_estimation/refsignal_dl.h @@ -35,8 +35,6 @@ #include "srslte/config.h" #include "srslte/common/phy_common.h" -typedef _Complex float cf_t; - // Number of references in a subframe: there are 2 symbols for port_id=0,1 x 2 slots x 2 refs per prb #define SRSLTE_REFSIGNAL_NUM_SF(nof_prb, port_id) (((port_id)<2?8:4)*(nof_prb)) #define SRSLTE_REFSIGNAL_MAX_NUM_SF(nof_prb) SRSLTE_REFSIGNAL_NUM_SF(nof_prb, 0) diff --git a/srslte/include/srslte/ch_estimation/refsignal_ul.h b/srslte/include/srslte/ch_estimation/refsignal_ul.h index 0be5ad77b..79d487946 100644 --- a/srslte/include/srslte/ch_estimation/refsignal_ul.h +++ b/srslte/include/srslte/ch_estimation/refsignal_ul.h @@ -41,8 +41,6 @@ #define SRSLTE_NOF_DELTA_SS 30 #define SRSLTE_NOF_CSHIFT 8 -typedef _Complex float cf_t; - typedef struct SRSLTE_API { uint32_t cyclic_shift; uint32_t cyclic_shift_for_drms; diff --git a/srslte/include/srslte/channel/ch_awgn.h b/srslte/include/srslte/channel/ch_awgn.h index dcdcba785..4d945be28 100644 --- a/srslte/include/srslte/channel/ch_awgn.h +++ b/srslte/include/srslte/channel/ch_awgn.h @@ -34,8 +34,6 @@ #ifndef CH_AWGN_ #define CH_AWGN_ -typedef _Complex float cf_t; - SRSLTE_API void srslte_ch_awgn_c(const cf_t* input, cf_t* output, float variance, diff --git a/srslte/include/srslte/common/phy_common.h b/srslte/include/srslte/common/phy_common.h index b97c945b2..0810a08ac 100644 --- a/srslte/include/srslte/common/phy_common.h +++ b/srslte/include/srslte/common/phy_common.h @@ -121,8 +121,6 @@ typedef enum {SRSLTE_SRSLTE_CP_NORM, SRSLTE_SRSLTE_CP_EXT} srslte_cp_t; #define SRSLTE_NOF_TC_CB_SIZES 188 -typedef _Complex float cf_t; - typedef enum SRSLTE_API { SRSLTE_PHICH_NORM = 0, SRSLTE_PHICH_EXT diff --git a/srslte/include/srslte/dft/dft.h b/srslte/include/srslte/dft/dft.h index 2e2981dd8..fec958baf 100644 --- a/srslte/include/srslte/dft/dft.h +++ b/srslte/include/srslte/dft/dft.h @@ -67,8 +67,6 @@ typedef struct SRSLTE_API { srslte_dft_mode_t mode; // Complex/Real }srslte_dft_plan_t; -typedef _Complex float cf_t; - /* Create DFT plans */ SRSLTE_API int srslte_dft_plan(srslte_dft_plan_t *plan, diff --git a/srslte/include/srslte/dft/dft_precoding.h b/srslte/include/srslte/dft/dft_precoding.h index a3c60d02a..9465fb273 100644 --- a/srslte/include/srslte/dft/dft_precoding.h +++ b/srslte/include/srslte/dft/dft_precoding.h @@ -33,8 +33,6 @@ #include "srslte/common/phy_common.h" #include "srslte/dft/dft.h" -typedef _Complex float cf_t; - /* DFT-based Transform Precoding object */ typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/dft/ofdm.h b/srslte/include/srslte/dft/ofdm.h index 0dad1dcf6..a46fcb971 100644 --- a/srslte/include/srslte/dft/ofdm.h +++ b/srslte/include/srslte/dft/ofdm.h @@ -37,8 +37,6 @@ #include "srslte/common/phy_common.h" #include "srslte/dft/dft.h" -typedef _Complex float cf_t; /* this is only a shortcut */ - /* This is common for both directions */ typedef struct SRSLTE_API{ srslte_dft_plan_t fft_plan; diff --git a/srslte/include/srslte/mimo/layermap.h b/srslte/include/srslte/mimo/layermap.h index 34edb2677..697c61846 100644 --- a/srslte/include/srslte/mimo/layermap.h +++ b/srslte/include/srslte/mimo/layermap.h @@ -32,8 +32,6 @@ #include "srslte/config.h" #include "srslte/common/phy_common.h" -typedef _Complex float cf_t; - /* Generates the vector of layer-mapped symbols "x" based on the vector of data symbols "d" */ SRSLTE_API int srslte_layermap_single(cf_t *d, diff --git a/srslte/include/srslte/mimo/precoding.h b/srslte/include/srslte/mimo/precoding.h index 40086865a..4336a65e0 100644 --- a/srslte/include/srslte/mimo/precoding.h +++ b/srslte/include/srslte/mimo/precoding.h @@ -31,8 +31,6 @@ #include "srslte/config.h" #include "srslte/common/phy_common.h" -typedef _Complex float cf_t; - /** The precoder takes as input nlayers vectors "x" from the * layer mapping and generates nports vectors "y" to be mapped onto * resources on each of the antenna ports. diff --git a/srslte/include/srslte/modem/demod_hard.h b/srslte/include/srslte/modem/demod_hard.h index b388b0958..76c1af0d2 100644 --- a/srslte/include/srslte/modem/demod_hard.h +++ b/srslte/include/srslte/modem/demod_hard.h @@ -35,8 +35,6 @@ #include "srslte/config.h" #include "modem_table.h" -typedef _Complex float cf_t; - typedef struct SRSLTE_API { srslte_mod_t mod; /* In this implementation, mapping table is hard-coded */ }srslte_demod_hard_t; diff --git a/srslte/include/srslte/modem/mod.h b/srslte/include/srslte/modem/mod.h index d724e6ad2..627b47de1 100644 --- a/srslte/include/srslte/modem/mod.h +++ b/srslte/include/srslte/modem/mod.h @@ -35,8 +35,6 @@ #include "srslte/config.h" #include "modem_table.h" -typedef _Complex float cf_t; - SRSLTE_API int srslte_mod_modulate(srslte_srslte_modem_table_t* table, uint8_t *bits, cf_t* symbols, diff --git a/srslte/include/srslte/modem/modem_table.h b/srslte/include/srslte/modem/modem_table.h index c4cb0184f..42b14a8f9 100644 --- a/srslte/include/srslte/modem/modem_table.h +++ b/srslte/include/srslte/modem/modem_table.h @@ -37,7 +37,6 @@ #include "srslte/common/phy_common.h" #include "srslte/config.h" -typedef _Complex float cf_t; typedef struct SRSLTE_API { uint32_t idx[2][6][32]; uint32_t min_idx[2][64][6]; /* NEW: for each constellation point zone (2, 4, 16, 64 for BPSK, QPSK, 16QAM, 64QAM) the 2x(1, 2, 4, and 6 closest constellation points) for each bit, respectively. */ diff --git a/srslte/include/srslte/phch/dci.h b/srslte/include/srslte/phch/dci.h index 6695b6368..831d7e132 100644 --- a/srslte/include/srslte/phch/dci.h +++ b/srslte/include/srslte/phch/dci.h @@ -34,8 +34,6 @@ #include "srslte/common/phy_common.h" #include "srslte/phch/ra.h" -typedef _Complex float cf_t; - /** * DCI message generation according to the formats, as specified in * 36.212 Section 5.3.3.1 diff --git a/srslte/include/srslte/phch/pbch.h b/srslte/include/srslte/phch/pbch.h index 5b0316472..9bcf92c14 100644 --- a/srslte/include/srslte/phch/pbch.h +++ b/srslte/include/srslte/phch/pbch.h @@ -48,8 +48,6 @@ #define PBCH_RE_SRSLTE_SRSLTE_CP_NORM 240 #define PBCH_RE_SRSLTE_SRSLTE_CP_EXT 216 -typedef _Complex float cf_t; - /* PBCH object */ typedef struct SRSLTE_API { srslte_cell_t cell; diff --git a/srslte/include/srslte/phch/pcfich.h b/srslte/include/srslte/phch/pcfich.h index c2f04c202..1cd97c274 100644 --- a/srslte/include/srslte/phch/pcfich.h +++ b/srslte/include/srslte/phch/pcfich.h @@ -40,8 +40,6 @@ #define PCFICH_CFI_LEN 32 #define PCFICH_RE PCFICH_CFI_LEN/2 -typedef _Complex float cf_t; - /* PCFICH object */ typedef struct SRSLTE_API { srslte_cell_t cell; diff --git a/srslte/include/srslte/phch/pdcch.h b/srslte/include/srslte/phch/pdcch.h index 01fa0e209..4a9694585 100644 --- a/srslte/include/srslte/phch/pdcch.h +++ b/srslte/include/srslte/phch/pdcch.h @@ -42,7 +42,7 @@ #include "srslte/phch/dci.h" #include "srslte/phch/regs.h" -typedef _Complex float cf_t; + typedef enum SRSLTE_API { diff --git a/srslte/include/srslte/phch/pdsch.h b/srslte/include/srslte/phch/pdsch.h index e04b1875c..a3a923b13 100644 --- a/srslte/include/srslte/phch/pdsch.h +++ b/srslte/include/srslte/phch/pdsch.h @@ -43,7 +43,7 @@ #define SRSLTE_PDSCH_MAX_TDEC_ITERS 5 -typedef _Complex float cf_t; + /* PDSCH object */ typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/phch/phich.h b/srslte/include/srslte/phch/phich.h index e3400317e..221ff0ed5 100644 --- a/srslte/include/srslte/phch/phich.h +++ b/srslte/include/srslte/phch/phich.h @@ -38,7 +38,7 @@ #include "srslte/scrambling/scrambling.h" #include "regs.h" -typedef _Complex float cf_t; + #define SRSLTE_PHICH_NORM_NSEQUENCES 8 #define SRSLTE_PHICH_EXT_NSEQUENCES 4 diff --git a/srslte/include/srslte/phch/prach.h b/srslte/include/srslte/phch/prach.h index adce53944..6b001b600 100644 --- a/srslte/include/srslte/phch/prach.h +++ b/srslte/include/srslte/phch/prach.h @@ -35,7 +35,7 @@ #include "srslte/config.h" #include "srslte/dft/dft.h" -typedef _Complex float cf_t; + /** Generation and detection of RACH signals for uplink. * Currently only supports preamble formats 0-3. diff --git a/srslte/include/srslte/phch/pucch.h b/srslte/include/srslte/phch/pucch.h index 8feea36e1..6b7128da2 100644 --- a/srslte/include/srslte/phch/pucch.h +++ b/srslte/include/srslte/phch/pucch.h @@ -41,8 +41,6 @@ #include "srslte/phch/harq.h" #include "srslte/dft/dft_precoding.h" -typedef _Complex float cf_t; - #define SRSLTE_PUCCH_N_SEQ 12 // Only Format 1, 1a and 1b supported #define SRSLTE_PUCCH_MAX_BITS 2 #define SRSLTE_PUCCH_N_SF_MAX 4 diff --git a/srslte/include/srslte/phch/pusch.h b/srslte/include/srslte/phch/pusch.h index fecf45370..e8d559162 100644 --- a/srslte/include/srslte/phch/pusch.h +++ b/srslte/include/srslte/phch/pusch.h @@ -43,7 +43,7 @@ #define SRSLTE_PUSCH_MAX_TDEC_ITERS 5 -typedef _Complex float cf_t; + typedef struct { diff --git a/srslte/include/srslte/phch/regs.h b/srslte/include/srslte/phch/regs.h index 9a66f4ab1..9b57fada8 100644 --- a/srslte/include/srslte/phch/regs.h +++ b/srslte/include/srslte/phch/regs.h @@ -42,8 +42,6 @@ #define REGS_RE_X_REG 4 -typedef _Complex float cf_t; - typedef struct SRSLTE_API { uint32_t k[4]; uint32_t k0; diff --git a/srslte/include/srslte/resampling/decim.h b/srslte/include/srslte/resampling/decim.h index f7c6759db..7897cfb14 100644 --- a/srslte/include/srslte/resampling/decim.h +++ b/srslte/include/srslte/resampling/decim.h @@ -26,12 +26,10 @@ */ #ifndef DECIM_H -#define DECIM_H_ +#define DECIM_H #include "srslte/config.h" -typedef _Complex float cf_t; - SRSLTE_API void srslte_decim_c(cf_t *input, cf_t *output, diff --git a/srslte/include/srslte/resampling/interp.h b/srslte/include/srslte/resampling/interp.h index daf047bd7..353f91371 100644 --- a/srslte/include/srslte/resampling/interp.h +++ b/srslte/include/srslte/resampling/interp.h @@ -32,8 +32,6 @@ #include "srslte/config.h" -typedef _Complex float cf_t; - /************* STATIC LINEAR INTERPOLATION FUNCTIONS */ diff --git a/srslte/include/srslte/resampling/resample_arb.h b/srslte/include/srslte/resampling/resample_arb.h index cd17a042b..d22192bfb 100644 --- a/srslte/include/srslte/resampling/resample_arb.h +++ b/srslte/include/srslte/resampling/resample_arb.h @@ -33,8 +33,6 @@ #include "srslte/config.h" -typedef _Complex float cf_t; - #define SRSLTE_RESAMPLE_ARB_N 32 // Polyphase filter rows #define SRSLTE_RESAMPLE_ARB_M 8 // Polyphase filter columns diff --git a/srslte/include/srslte/scrambling/scrambling.h b/srslte/include/srslte/scrambling/scrambling.h index 0be7a5944..c4d285c58 100644 --- a/srslte/include/srslte/scrambling/scrambling.h +++ b/srslte/include/srslte/scrambling/scrambling.h @@ -33,8 +33,6 @@ #include "srslte/common/sequence.h" #include "srslte/common/phy_common.h" -typedef _Complex float cf_t; - /* Scrambling has no state */ SRSLTE_API void srslte_scrambling_b(srslte_sequence_t *s, uint8_t *data); diff --git a/srslte/include/srslte/sync/cfo.h b/srslte/include/srslte/sync/cfo.h index e85682929..df33fb888 100644 --- a/srslte/include/srslte/sync/cfo.h +++ b/srslte/include/srslte/sync/cfo.h @@ -34,8 +34,6 @@ #include "srslte/config.h" #include "srslte/utils/cexptab.h" -typedef _Complex float cf_t; - /** If the frequency is changed more than the tolerance, a new table is generated */ #define SRSLTE_CFO_TOLERANCE 0.00001 diff --git a/srslte/include/srslte/sync/pss.h b/srslte/include/srslte/sync/pss.h index 513268709..e27e42db0 100644 --- a/srslte/include/srslte/sync/pss.h +++ b/srslte/include/srslte/sync/pss.h @@ -36,8 +36,6 @@ #include "srslte/common/phy_common.h" #include "srslte/utils/convolution.h" -typedef _Complex float cf_t; /* this is only a shortcut */ - #define CONVOLUTION_FFT #define SRSLTE_PSS_LEN 62 diff --git a/srslte/include/srslte/sync/sss.h b/srslte/include/srslte/sync/sss.h index d56bf2c62..f7535576d 100644 --- a/srslte/include/srslte/sync/sss.h +++ b/srslte/include/srslte/sync/sss.h @@ -36,8 +36,6 @@ #include "srslte/common/phy_common.h" #include "srslte/dft/dft.h" -typedef _Complex float cf_t; /* this is only a shortcut */ - #define SRSLTE_SSS_N 31 #define SRSLTE_SSS_LEN 2*SRSLTE_SSS_N diff --git a/srslte/include/srslte/ue/ue_phy.h b/srslte/include/srslte/ue/ue_phy.h index e6edc7dd1..876e1032b 100644 --- a/srslte/include/srslte/ue/ue_phy.h +++ b/srslte/include/srslte/ue/ue_phy.h @@ -31,7 +31,7 @@ #ifndef UEPHY_H #define UEPHY_H -typedef _Complex float cf_t; + class srslte_ue_phy { diff --git a/srslte/include/srslte/utils/cexptab.h b/srslte/include/srslte/utils/cexptab.h index a46d80f0b..9e6cb7764 100644 --- a/srslte/include/srslte/utils/cexptab.h +++ b/srslte/include/srslte/utils/cexptab.h @@ -33,8 +33,6 @@ #include #include "srslte/config.h" -typedef _Complex float cf_t; - typedef struct SRSLTE_API { uint32_t size; cf_t *tab; diff --git a/srslte/include/srslte/utils/convolution.h b/srslte/include/srslte/utils/convolution.h index 930d94235..3dd6f0507 100644 --- a/srslte/include/srslte/utils/convolution.h +++ b/srslte/include/srslte/utils/convolution.h @@ -32,8 +32,6 @@ #include "srslte/config.h" #include "srslte/dft/dft.h" -typedef _Complex float cf_t; - typedef struct SRSLTE_API { cf_t *input_fft; cf_t *filter_fft; diff --git a/srslte/include/srslte/utils/vector.h b/srslte/include/srslte/utils/vector.h index 92b287b4b..9d5aceb51 100644 --- a/srslte/include/srslte/utils/vector.h +++ b/srslte/include/srslte/utils/vector.h @@ -37,8 +37,6 @@ extern "C" { #include #include "srslte/config.h" -typedef _Complex float cf_t; - #define SRSLTE_MAX(a,b) ((a)>(b)?(a):(b)) #define SRSLTE_MIN(a,b) ((a)<(b)?(a):(b)) diff --git a/srslte/lib/fec/src/parity.h b/srslte/lib/fec/src/parity.h index 5ad4b1b5c..d2d4d0c56 100644 --- a/srslte/lib/fec/src/parity.h +++ b/srslte/lib/fec/src/parity.h @@ -11,7 +11,7 @@ /* Determine parity of argument: 1 = odd, 0 = even */ #ifdef __i386__ static inline uint32_t parityb(uint8_t x){ - __asm__ __volatile__ ("test %1,%1;setpo %0" : "=qhm" (x) : "qh" (x)); + __asm__ __volatile__ ("test %1,%1;setpo %0" : "=q" (x) : "q" (x)); return x; } #else diff --git a/srslte/lib/fec/test/turbodecoder_test.c b/srslte/lib/fec/test/turbodecoder_test.c index e8ac5e6b1..f96ba16d5 100644 --- a/srslte/lib/fec/test/turbodecoder_test.c +++ b/srslte/lib/fec/test/turbodecoder_test.c @@ -39,7 +39,7 @@ #include "turbodecoder_test.h" -typedef _Complex float cf_t; + uint32_t frame_length = 1000, nof_frames = 100; float ebno_db = 100.0; diff --git a/srslte/lib/fec/test/viterbi_test.c b/srslte/lib/fec/test/viterbi_test.c index 25b267693..7f7a7e61f 100644 --- a/srslte/lib/fec/test/viterbi_test.c +++ b/srslte/lib/fec/test/viterbi_test.c @@ -37,7 +37,7 @@ #include "viterbi_test.h" -typedef _Complex float cf_t; + int frame_length = 1000, nof_frames = 128; float ebno_db = 100.0; diff --git a/srslte/lib/modem/src/soft_algs.c b/srslte/lib/modem/src/soft_algs.c index c4d9064d5..8bb3eb15f 100644 --- a/srslte/lib/modem/src/soft_algs.c +++ b/srslte/lib/modem/src/soft_algs.c @@ -42,7 +42,7 @@ #define QAM64_THRESHOLD_3 6/sqrt(42) -typedef _Complex float cf_t; + // There are 3 implemenations: 1 - based on zones; 2 - using volk, 3 - straightforward C #define LLR_SRSLTE_DEMOD_SOFT_ALG_APPROX_IMPLEMENTATION 1 diff --git a/srslte/lib/phch/src/prb_dl.h b/srslte/lib/phch/src/prb_dl.h index 3aea25003..4603363bd 100644 --- a/srslte/lib/phch/src/prb_dl.h +++ b/srslte/lib/phch/src/prb_dl.h @@ -25,8 +25,7 @@ * */ - -typedef _Complex float cf_t; +#include "srslte/config.h" void prb_cp_ref(cf_t **input, cf_t **output, int offset, int nof_refs, int nof_intervals, bool advance_input); diff --git a/srslte/lib/phch/test/prach_test.c b/srslte/lib/phch/test/prach_test.c index 593897e93..29a86a111 100644 --- a/srslte/lib/phch/test/prach_test.c +++ b/srslte/lib/phch/test/prach_test.c @@ -9,7 +9,7 @@ #include "srslte/phch/prach.h" #define MAX_LEN 70176 -typedef _Complex float cf_t; + uint32_t N_ifft_ul = 128; uint32_t preamble_format = 0; diff --git a/srslte/lib/phch/test/prach_test_multi.c b/srslte/lib/phch/test/prach_test_multi.c index 8b3e54c2f..83f65dacb 100644 --- a/srslte/lib/phch/test/prach_test_multi.c +++ b/srslte/lib/phch/test/prach_test_multi.c @@ -9,7 +9,7 @@ #include "srslte/phch/prach.h" #define MAX_LEN 70176 -typedef _Complex float cf_t; + uint32_t N_ifft_ul = 128; uint32_t preamble_format = 0; diff --git a/srslte/lib/resampling/test/resample_arb_bench.c b/srslte/lib/resampling/test/resample_arb_bench.c index 9c94344f5..cdd909ab5 100644 --- a/srslte/lib/resampling/test/resample_arb_bench.c +++ b/srslte/lib/resampling/test/resample_arb_bench.c @@ -8,7 +8,7 @@ #include "srslte/srslte.h" #include "srslte/resampling/resample_arb.h" -typedef _Complex float cf_t; + int main(int argc, char **argv) { int N=10000000; diff --git a/srslte/lib/resampling/test/resample_arb_test.c b/srslte/lib/resampling/test/resample_arb_test.c index 13d333405..fcdb49a03 100644 --- a/srslte/lib/resampling/test/resample_arb_test.c +++ b/srslte/lib/resampling/test/resample_arb_test.c @@ -8,7 +8,7 @@ #include "srslte/srslte.h" #include "srslte/resampling/resample_arb.h" -typedef _Complex float cf_t; + int main(int argc, char **argv) { int N = 100; // Number of sinwave samples diff --git a/srslte/lib/utils/test/dft_test.c b/srslte/lib/utils/test/dft_test.c index 072cacd36..d9078dc33 100644 --- a/srslte/lib/utils/test/dft_test.c +++ b/srslte/lib/utils/test/dft_test.c @@ -8,7 +8,7 @@ #include "srslte/dft/dft.h" -typedef _Complex float cf_t; + int N = 256; bool forward = true;