diff --git a/CMakeLists.txt b/CMakeLists.txt index af7caa07e..8b3526baa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,10 +394,15 @@ set (wsjt_FSRCS lib/zplot9.f90 ) -set (wsjt_CSRCS +set (ka9q_CSRCS lib/sfrsd2/decode_rs.c lib/sfrsd2/encode_rs.c lib/sfrsd2/init_rs.c + ) +set_source_files_properties (${ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare) + +set (wsjt_CSRCS + ${ka9q_CSRCS} lib/sfrsd2/sfrsd2.c lib/gran.c lib/igray.c diff --git a/Configuration.ui b/Configuration.ui index 38aae1fe8..9882996c2 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -2155,7 +2155,7 @@ Right click for insert and delete options. Aggressive decoding level: - + 10 @@ -2243,7 +2243,7 @@ Right click for insert and delete options. Experience-based decoding - + 20 diff --git a/lib/decjt9.f90 b/lib/decjt9.f90 index 788122908..d12c188e3 100644 --- a/lib/decjt9.f90 +++ b/lib/decjt9.f90 @@ -38,6 +38,8 @@ subroutine decjt9(ss,id2,nutc,nfqso,newdat,npts8,nfa,nfsplit,nfb,ntol, & df8=1500.0/nsps8 dblim=db(864.0/nsps8) - 26.2 + ia1=1 !quel compiler gripe + ib1=1 !quel compiler gripe do nqd=1,0,-1 limit=5000 ccflim=3.0 diff --git a/lib/rectify_msk.f90 b/lib/rectify_msk.f90 index 4e77ecb73..dd4fede11 100644 --- a/lib/rectify_msk.f90 +++ b/lib/rectify_msk.f90 @@ -6,7 +6,7 @@ subroutine rectify_msk(c,msg,freq2) complex c1(0:NSPM-1) !Rectified signal complex c2(0:NSPM-1) !Integral of rectified signal complex c3(0:2*NSPM-1) !FFT of rectified signal - complex cfac,z + complex cfac !,z character*22 msg,msgsent integer i4tone(234) diff --git a/lib/sfrsd2/sfrsd2.c b/lib/sfrsd2/sfrsd2.c index 02001465b..b06aa17da 100644 --- a/lib/sfrsd2/sfrsd2.c +++ b/lib/sfrsd2/sfrsd2.c @@ -30,74 +30,74 @@ void sfrsd2_(int mrsym[], int mrprob[], int mr2sym[], int mr2prob[], int rxdat[63], rxprob[63], rxdat2[63], rxprob2[63]; int workdat[63]; int era_pos[51]; - int i, j, numera, nerr, nn=63, kk=12; - FILE *datfile, *logfile; + int i, j, numera, nerr, nn=63; + FILE *logfile = NULL; int ntrials = *ntrials0; int verbose = *verbose0; int nhard=0,nhard_min=32768,nsoft=0,nsoft_min=32768; int nsofter=0,nsofter_min=32768,ntotal=0,ntotal_min=32768,ncandidates; - int nera_best; + int nera_best=0; clock_t t0=0,t1=0; static unsigned int nseed; /* For JT exp(x) symbol metrics - gaussian noise, no fading int perr[8][8] = { - 12, 31, 44, 52, 60, 57, 50, 50, - 28, 38, 49, 58, 65, 69, 64, 80, - 40, 41, 53, 62, 66, 73, 76, 81, - 50, 53, 53, 64, 70, 76, 77, 81, - 50, 50, 52, 60, 71, 72, 77, 84, - 50, 50, 56, 62, 67, 73, 81, 85, - 50, 50, 71, 62, 70, 77, 80, 85, - 50, 50, 62, 64, 71, 75, 82, 87}; + {12, 31, 44, 52, 60, 57, 50, 50}, + {28, 38, 49, 58, 65, 69, 64, 80}, + {40, 41, 53, 62, 66, 73, 76, 81}, + {50, 53, 53, 64, 70, 76, 77, 81}, + {50, 50, 52, 60, 71, 72, 77, 84}, + {50, 50, 56, 62, 67, 73, 81, 85}, + {50, 50, 71, 62, 70, 77, 80, 85}, + {50, 50, 62, 64, 71, 75, 82, 87}}; */ /* For JT exp(x) symbol metrics - hf conditions int perr[8][8] = { - 10, 10, 10, 12, 13, 15, 15, 9, - 28, 30, 43, 50, 61, 58, 50, 34, - 40, 40, 50, 53, 70, 65, 58, 45, - 50, 50, 53, 74, 71, 68, 66, 52, - 50, 50, 52, 45, 67, 70, 70, 60, - 50, 50, 56, 73, 55, 74, 69, 67, - 50, 50, 70, 81, 81, 69, 76, 75, - 50, 50, 62, 57, 77, 81, 73, 78}; + {10, 10, 10, 12, 13, 15, 15, 9}, + {28, 30, 43, 50, 61, 58, 50, 34}, + {40, 40, 50, 53, 70, 65, 58, 45}, + {50, 50, 53, 74, 71, 68, 66, 52}, + {50, 50, 52, 45, 67, 70, 70, 60}, + {50, 50, 56, 73, 55, 74, 69, 67}, + {50, 50, 70, 81, 81, 69, 76, 75}, + {50, 50, 62, 57, 77, 81, 73, 78}}; */ // For SF power-percentage symbol metrics - composite gnnf/hf int perr[8][8] = { - 4, 9, 11, 13, 14, 14, 15, 15, - 2, 20, 20, 30, 40, 50, 50, 50, - 7, 24, 27, 40, 50, 50, 50, 50, - 13, 25, 35, 46, 52, 70, 50, 50, - 17, 30, 42, 54, 55, 64, 71, 70, - 25, 39, 48, 57, 64, 66, 77, 77, - 32, 45, 54, 63, 66, 75, 78, 83, - 51, 58, 57, 66, 72, 77, 82, 86}; + {4, 9, 11, 13, 14, 14, 15, 15}, + {2, 20, 20, 30, 40, 50, 50, 50}, + {7, 24, 27, 40, 50, 50, 50, 50}, + {13, 25, 35, 46, 52, 70, 50, 50}, + {17, 30, 42, 54, 55, 64, 71, 70}, + {25, 39, 48, 57, 64, 66, 77, 77}, + {32, 45, 54, 63, 66, 75, 78, 83}, + {51, 58, 57, 66, 72, 77, 82, 86}}; // /* For SF power-percentage symbol metrics - gaussian noise, no fading int perr[8][8] = { - 1, 10, 10, 20, 30, 50, 50, 50, - 2, 20, 20, 30, 40, 50, 50, 50, - 7, 24, 27, 40, 50, 50, 50, 50, - 13, 25, 35, 46, 52, 70, 50, 50, - 17, 30, 42, 54, 55, 64, 71, 70, - 25, 39, 48, 57, 64, 66, 77, 77, - 32, 45, 54, 63, 66, 75, 78, 83, - 51, 58, 57, 66, 72, 77, 82, 86}; + {1, 10, 10, 20, 30, 50, 50, 50}, + {2, 20, 20, 30, 40, 50, 50, 50}, + {7, 24, 27, 40, 50, 50, 50, 50}, + {13, 25, 35, 46, 52, 70, 50, 50}, + {17, 30, 42, 54, 55, 64, 71, 70}, + {25, 39, 48, 57, 64, 66, 77, 77}, + {32, 45, 54, 63, 66, 75, 78, 83}, + {51, 58, 57, 66, 72, 77, 82, 86}}; */ /* For SF power-percentage symbol metrics - hf int perr[8][8] = { - 4, 9, 11, 13, 14, 14, 15, 15, - 9, 12, 14, 25, 28, 30, 50, 50, - 18, 22, 22, 28, 32, 35, 50, 50, - 30, 35, 38, 38, 57, 50, 50, 50, - 43, 46, 45, 53, 50, 64, 70, 50, - 56, 58, 58, 57, 67, 66, 80, 77, - 65, 72, 73, 72, 67, 75, 80, 83, - 70, 74, 73, 70, 75, 77, 80, 86}; + {4, 9, 11, 13, 14, 14, 15, 15}, + {9, 12, 14, 25, 28, 30, 50, 50}, + {18, 22, 22, 28, 32, 35, 50, 50}, + {30, 35, 38, 38, 57, 50, 50, 50}, + {43, 46, 45, 53, 50, 64, 70, 50}, + {56, 58, 58, 57, 67, 66, 80, 77}, + {65, 72, 73, 72, 67, 75, 80, 83}, + {70, 74, 73, 70, 75, 77, 80, 86}}; */ if(verbose) { @@ -146,7 +146,7 @@ void sfrsd2_(int mrsym[], int mrprob[], int mr2sym[], int mr2prob[], memcpy(workdat,rxdat,sizeof(rxdat)); nerr=decode_rs_int(rs,workdat,era_pos,numera,1); if( nerr >= 0 ) { - if(verbose) { + if(logfile) { fprintf(logfile,"BM decode nerrors= %3d : \n",nerr); fclose(logfile); } @@ -169,7 +169,7 @@ used to decide which codeword is "best". nseed=1; //Seed for random numbers - float ratio, ratio0[63]; + float ratio; int thresh, nsum; int thresh0[63]; ncandidates=0; @@ -179,7 +179,6 @@ used to decide which codeword is "best". nsum=nsum+rxprob[i]; j = indexes[62-i]; ratio = (float)rxprob2[j]/((float)rxprob[j]+0.01); - ratio0[i]=ratio; ii = 7.999*ratio; jj = (62-i)/8; thresh0[i] = 1.3*perr[ii][jj]; @@ -254,7 +253,7 @@ NB: j is the symbol-vector index of the symbol with rank i. nhard_min=-1; } - if(verbose) { + if(logfile) { fprintf(logfile,"ncand %4d nhard %4d nsoft %4d nhard+nsoft %4d nsum %8d\n", ncandidates,nhard_min,nsoft_min,ntotal_min,nsum); fclose(logfile); diff --git a/lib/syncmsk.f90 b/lib/syncmsk.f90 index 7006bdda4..cc796ccf0 100644 --- a/lib/syncmsk.f90 +++ b/lib/syncmsk.f90 @@ -71,6 +71,7 @@ subroutine syncmsk(cdat,npts,jpk,ipk,idf,rmax,snr,metric,decoded) dt=1.0/12000.0 f0=1000.0 f1=2000.0 + dphi=0 !quel compiler gripe do i=1,11 if(b11(i).eq.0) dphi=twopi*f0*dt if(b11(i).eq.1) dphi=twopi*f1*dt diff --git a/lib/vit213.c b/lib/vit213.c index 985a923c7..7fa697cba 100644 --- a/lib/vit213.c +++ b/lib/vit213.c @@ -46,12 +46,13 @@ int enc213(unsigned char symbols[], unsigned char data[], unsigned int nbytes, unsigned int startstate, unsigned int endstate) { - int i,j,k,n=-1; + unsigned int i,j,k; + int l,n=-1; unsigned int encstate = startstate; for(k=0; k=0;i--){ - encstate = (encstate + encstate) + ((data[k] >> i) & 1); + for(l=7;l>=0;l--){ + encstate = (encstate + encstate) + ((data[k] >> l) & 1); for(j=0;j 6 ) { return 0; } @@ -80,11 +80,11 @@ long unsigned int pack_call(char *callsign) { } void pack_prefix(char *callsign, int32_t *n, int32_t *m, int32_t *nadd ) { - int i; + size_t i; char *call6; call6=malloc(sizeof(char)*6); memset(call6,32,sizeof(char)*6); - int i1=strcspn(callsign,"/"); + size_t i1=strcspn(callsign,"/"); if( callsign[i1+2] == 0 ) { //single char suffix @@ -115,7 +115,7 @@ void pack_prefix(char *callsign, int32_t *n, int32_t *m, int32_t *nadd ) { char* pfx=strtok(callsign,"/"); call6=strtok(NULL," "); *n=pack_call(call6); - int plen=strlen(pfx); + size_t plen=strlen(pfx); if( plen ==1 ) { *m=36; *m=37*(*m)+36; @@ -187,11 +187,11 @@ int get_wspr_channel_symbols(char* rawmessage, char* hashtab, unsigned char* sym i++; } - int i1=strcspn(message," "); - int i2=strcspn(message,"/"); - int i3=strcspn(message,"<"); - int i4=strcspn(message,">"); - int mlen=strlen(message); + size_t i1=strcspn(message," "); + size_t i2=strcspn(message,"/"); + size_t i3=strcspn(message,"<"); + size_t i4=strcspn(message,">"); + size_t mlen=strlen(message); // Use the presence and/or absence of "<" and "/" to decide what // type of message. No sanity checks! Beware!