diff options
author | Andrej Rode <mail@andrejro.de> | 2018-02-17 14:02:04 +0100 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-02-17 14:02:04 +0100 |
commit | 201031790ec8c855ec2eaf7883652ad37b164208 (patch) | |
tree | 5989b94e7dddb1499d6a8ee366c72f5c449df7df | |
parent | 3165aaf55a83dad81af0d61e3189d90a16cccc95 (diff) |
fixup! fec: convert viterbi sub-library to valid C++ in correct namespace
-rw-r--r-- | gnuradio-runtime/include/gnuradio/math.h | 4 | ||||
-rw-r--r-- | gnuradio-runtime/lib/math/random.cc | 2 | ||||
-rw-r--r-- | gr-fec/lib/viterbi/metrics.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/gnuradio-runtime/include/gnuradio/math.h b/gnuradio-runtime/include/gnuradio/math.h index ff41006912..9d96ae2555 100644 --- a/gnuradio-runtime/include/gnuradio/math.h +++ b/gnuradio-runtime/include/gnuradio/math.h @@ -31,8 +31,8 @@ #include <gnuradio/api.h> #include <gnuradio/gr_complex.h> -#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ -#define M_LOG2E 1.4426950408889634074 /* log_2 e */ +#define GR_M_SQRT2 1.41421356237309504880 /* sqrt(2) */ +#define GR_M_LOG2E 1.4426950408889634074 /* log_2 e */ namespace gr { diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc index 401ba89735..5ebe174914 100644 --- a/gnuradio-runtime/lib/math/random.cc +++ b/gnuradio-runtime/lib/math/random.cc @@ -151,7 +151,7 @@ namespace gr { float random::impulse(float factor = 5) { - float z = -M_SQRT2 * logf(ran1()); + float z = -GR_M_SQRT2 * logf(ran1()); if(fabsf(z) <= factor) return 0.0; else diff --git a/gr-fec/lib/viterbi/metrics.c b/gr-fec/lib/viterbi/metrics.c index c4aa7a07ed..4dd28f8ada 100644 --- a/gr-fec/lib/viterbi/metrics.c +++ b/gr-fec/lib/viterbi/metrics.c @@ -48,10 +48,10 @@ extern double erf(double x); /* Normal function integrated from -Inf to x. Range: 0-1 */ -#define normal(x) (0.5 + 0.5*erf((x)/M_SQRT2)) +#define normal(x) (0.5 + 0.5*erf((x)/GR_M_SQRT2)) /* Logarithm base 2 */ -#define gr_log2(x) (log(x)*M_LOG2E) +#define gr_log2(x) (log(x)*GR_M_LOG2E) namespace gr{ namespace fec{ |