summaryrefslogtreecommitdiff
path: root/gr-fec
diff options
context:
space:
mode:
authorRon Economos <w6rz@comcast.net>2019-01-12 07:54:23 -0800
committerMartin Braun <martin.braun@ettus.com>2019-01-14 10:11:16 -0800
commitc63227bebddc4e8ae3976fc4c928ed1274bd8cd3 (patch)
tree54e650eac4b7842941e8b4310c7f3f3c56019b85 /gr-fec
parent4ed30a4d218a2a7d209afc3543ec6b6afdccc5b2 (diff)
fec: Suppress warnings in Reed-Solomon test code
RS test codes were using random() instead of rand(), which is now fixed.
Diffstat (limited to 'gr-fec')
-rw-r--r--gr-fec/lib/reed-solomon/exercise.c8
-rw-r--r--gr-fec/lib/reed-solomon/rstest.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/gr-fec/lib/reed-solomon/exercise.c b/gr-fec/lib/reed-solomon/exercise.c
index de33a6bff3..41ed4f2148 100644
--- a/gr-fec/lib/reed-solomon/exercise.c
+++ b/gr-fec/lib/reed-solomon/exercise.c
@@ -70,7 +70,7 @@ int trials){
/* Load block with random data and encode */
for(i=0;i<NN-NROOTS;i++)
- block[i] = random() & NN;
+ block[i] = rand() & NN;
#if defined(CCSDS) || defined(FIXED)
ENCODE_RS(&block[0],&block[NN-NROOTS]);
@@ -85,17 +85,17 @@ int trials){
erasures=0;
for(i=0;i<(unsigned int)errors;i++){
do {
- errval = random() & NN;
+ errval = rand() & NN;
} while(errval == 0); /* Error value must be nonzero */
do {
- errloc = random() % NN;
+ errloc = rand() % NN;
} while(errlocs[errloc] != 0); /* Must not choose the same location twice */
errlocs[errloc] = 1;
#if FLAG_ERASURE
- if(random() & 1) /* 50-50 chance */
+ if(rand() & 1) /* 50-50 chance */
derrlocs[erasures++] = errloc;
#endif
tblock[errloc] ^= errval;
diff --git a/gr-fec/lib/reed-solomon/rstest.c b/gr-fec/lib/reed-solomon/rstest.c
index 767c01d848..e2783843e9 100644
--- a/gr-fec/lib/reed-solomon/rstest.c
+++ b/gr-fec/lib/reed-solomon/rstest.c
@@ -57,7 +57,7 @@ int main(){
int i;
terrs = 0;
- srandom(time(NULL));
+ srand(time(NULL));
#ifdef ALL_VERSIONS
printf("Testing fixed (255,223) RS codec...");