diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2016-06-18 10:42:33 +0300 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2016-06-18 15:49:21 +0300 |
commit | f7e0eb153d8ea6874001072d9aa07c45a623d2f3 (patch) | |
tree | 0789dc35ef6cc4afde3461801867c3b1083d242b | |
parent | 256ec631150189e944249fd1b61eb6a233c127d8 (diff) |
radioDevice: GSMRATE macro must have parentheses around its definition.
So we had the following define:
#define GSMRATE 1625e3/6
Now, I wanted to use it in the following expression:
3.0/GSMRATE
which turns into:
3.0/1625e3/6
while what I really wanted is:
3.0/(1625e3/6) = 3.0/1625e3*6
To avoid this, all macros with calculations must be enclosed in parentheses.
-rw-r--r-- | Transceiver52M/radioDevice.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Transceiver52M/radioDevice.h b/Transceiver52M/radioDevice.h index 40f47a5..6d7ea72 100644 --- a/Transceiver52M/radioDevice.h +++ b/Transceiver52M/radioDevice.h @@ -22,7 +22,7 @@ #include "config.h" #endif -#define GSMRATE 1625e3/6 +#define GSMRATE (1625e3/6) /** a 64-bit virtual timestamp for radio data */ typedef unsigned long long TIMESTAMP; |