From e565e1796a9787fb39b67131f07303c8562d267a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 6 Apr 2016 22:37:22 +0000 Subject: [PATCH] Clean up some compiler warnings git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6591 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Audio/BWFFile.cpp | 2 +- Detector.hpp | 4 ++-- Modulator.cpp | 1 - Modulator.hpp | 5 ++--- TransceiverFactory.cpp | 2 +- lib/decode65b.f90 | 2 +- lib/decoder.f90 | 2 +- lib/ftrsd/decode_rs.c | 1 - lib/ftrsd/init_rs.c | 2 -- lib/hint65.f90 | 1 - lib/jt65_decode.f90 | 1 - lib/jt65sim.f90 | 3 ++- lib/vit213.c | 1 - lib/wsprd/wsprd.c | 10 +++++----- messageaveraging.h | 2 -- 15 files changed, 15 insertions(+), 24 deletions(-) diff --git a/Audio/BWFFile.cpp b/Audio/BWFFile.cpp index 6ef000535..d1068f387 100644 --- a/Audio/BWFFile.cpp +++ b/Audio/BWFFile.cpp @@ -49,7 +49,7 @@ namespace } char * operator & () {return reinterpret_cast (this);} - char const * operator & () const {return &*this;} + char const * operator & () const {return reinterpret_cast (this);} std::array id_; quint32 size_; diff --git a/Detector.hpp b/Detector.hpp index 0ef171eae..9855be9a2 100644 --- a/Detector.hpp +++ b/Detector.hpp @@ -31,12 +31,12 @@ public: bool reset () override; protected: - qint64 readData (char * /* data */, qint64 /* maxSize */) + qint64 readData (char * /* data */, qint64 /* maxSize */) override { return -1; // we don't produce data } - qint64 writeData (char const * data, qint64 maxSize); + qint64 writeData (char const * data, qint64 maxSize) override; private: void clear (); // discard buffer contents diff --git a/Modulator.cpp b/Modulator.cpp index c8c5e04cd..13ae5eccf 100644 --- a/Modulator.cpp +++ b/Modulator.cpp @@ -32,7 +32,6 @@ Modulator::Modulator (unsigned frameRate, unsigned periodLengthInSeconds, , m_phi {0.0} , m_toneSpacing {0.0} , m_fSpread {0.0} - , m_itone0 {0} , m_frameRate {frameRate} , m_period {periodLengthInSeconds} , m_state {Idle} diff --git a/Modulator.hpp b/Modulator.hpp index ad18ed886..cea1eccc6 100644 --- a/Modulator.hpp +++ b/Modulator.hpp @@ -43,8 +43,8 @@ public: Q_SIGNAL void stateChanged (ModulatorState) const; protected: - qint64 readData (char * data, qint64 maxSize); - qint64 writeData (char const * /* data */, qint64 /* maxSize */) + qint64 readData (char * data, qint64 maxSize) override; + qint64 writeData (char const * /* data */, qint64 /* maxSize */) override { return -1; // we don't consume data } @@ -72,7 +72,6 @@ private: double m_fSpread; qint64 m_silentFrames; - qint32 m_itone0; qint32 m_TRperiod; qint16 m_ramp; diff --git a/TransceiverFactory.cpp b/TransceiverFactory.cpp index d69eaa493..fabcbfeed 100644 --- a/TransceiverFactory.cpp +++ b/TransceiverFactory.cpp @@ -189,7 +189,7 @@ std::unique_ptr TransceiverFactory::create (ParameterPack const& pa } } - return std::move (result); + return result; } #if !defined (QT_NO_DEBUG_STREAM) diff --git a/lib/decode65b.f90 b/lib/decode65b.f90 index ed57963c3..d7499123b 100644 --- a/lib/decode65b.f90 +++ b/lib/decode65b.f90 @@ -4,7 +4,7 @@ subroutine decode65b(s2,nflip,nadd,mode65,ntrials,naggressive,ndepth, & use jt65_mod real s2(66,126) real s3(64,63) - logical first,ltext + logical ltext character decoded*22 character mycall*12,hiscall*12,hisgrid*6 save diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 3e2ed5f5a..0373dabb2 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -226,7 +226,7 @@ contains integer, intent(in) :: nsubmode integer, intent(in) :: naggressive - integer nft,nsmo2,nsum2,n + integer n character*5 ctail character*22 decoded character*36 c diff --git a/lib/ftrsd/decode_rs.c b/lib/ftrsd/decode_rs.c index 91f582ac1..daeaaaebf 100644 --- a/lib/ftrsd/decode_rs.c +++ b/lib/ftrsd/decode_rs.c @@ -10,7 +10,6 @@ #include -#define NULL ((void *)0) #define min(a,b) ((a) < (b) ? (a) : (b)) #ifdef FIXED diff --git a/lib/ftrsd/init_rs.c b/lib/ftrsd/init_rs.c index ce9e8cb70..4b1d1edbe 100644 --- a/lib/ftrsd/init_rs.c +++ b/lib/ftrsd/init_rs.c @@ -13,8 +13,6 @@ #include "char.h" #endif -#define NULL ((void *)0) - void FREE_RS(void *p){ struct rs *rs = (struct rs *)p; diff --git a/lib/hint65.f90 b/lib/hint65.f90 index c98ff9931..86c979c21 100644 --- a/lib/hint65.f90 +++ b/lib/hint65.f90 @@ -16,7 +16,6 @@ subroutine hint65(s3,mrs,mrs2,mrsym,mr2sym,mrprob,nadd,flip, & character callsign*12,grid*4 character*180 line character ceme*3,msg*22 - character cgood*1 character*22 msg0(MAXMSG),decoded logical*1 eme(MAXCALLS) logical first diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index 8008b8cc0..39baf9e5c 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -311,7 +311,6 @@ contains ! Accumulated data for message averaging integer iutc(MAXAVE) integer nfsave(MAXAVE) - integer listutc(10) integer nflipsave(MAXAVE) real s1b(-255:256,126) real s1save(-255:256,126,MAXAVE) diff --git a/lib/jt65sim.f90 b/lib/jt65sim.f90 index 5bd349609..9101d185d 100644 --- a/lib/jt65sim.f90 +++ b/lib/jt65sim.f90 @@ -18,7 +18,8 @@ program jt65sim complex cspread(0:NFFT-1) !Complex amplitude for Rayleigh fading complex z real*8 f0,dt,twopi,phi,dphi,baud,fsample,freq,sps - character msg*22,fname*11,csubmode*1,call1*5,call2*5,c,optarg*500,numbuf*32 + character msg*22,fname*11,csubmode*1,c,optarg*500,numbuf*32 +! character call1*5,call2*5 logical :: display_help=.false.,seed_prngs=.true. type (option) :: long_options(8) = [ & option ('help',.false.,'h','Display this help message',''), & diff --git a/lib/vit213.c b/lib/vit213.c index 7fa697cba..616a2fd81 100644 --- a/lib/vit213.c +++ b/lib/vit213.c @@ -19,7 +19,6 @@ unsigned int Poly213[] = {012767,016461}; /* k = 13 */ #include -#define NULL ((void *)0) #define LONGBITS 32 #define LOGLONGBITS 5 diff --git a/lib/wsprd/wsprd.c b/lib/wsprd/wsprd.c index 391661e08..8d2288db6 100644 --- a/lib/wsprd/wsprd.c +++ b/lib/wsprd/wsprd.c @@ -105,7 +105,7 @@ unsigned long readc2file(char *ptr_to_infile, float *idat, float *qdat, //*************************************************************************** unsigned long readwavfile(char *ptr_to_infile, int ntrmin, float *idat, float *qdat ) { - unsigned long i, j, npoints; + size_t i, j, npoints; int nfft1, nfft2, nh2, i0; double df; @@ -151,7 +151,7 @@ unsigned long readwavfile(char *ptr_to_infile, int ntrmin, float *idat, float *q realin[i]=buf2[i]/32768.0; } - for (i=npoints; inh2 ) j=j-nfft2; + if( i>(size_t)nh2 ) j=j-nfft2; fftin[i][0]=fftout[j][0]; fftin[i][1]=fftout[j][1]; } @@ -173,7 +173,7 @@ unsigned long readwavfile(char *ptr_to_infile, int ntrmin, float *idat, float *q PLAN2 = fftwf_plan_dft_1d(nfft2, fftin, fftout, FFTW_BACKWARD, PATIENCE); fftwf_execute(PLAN2); - for (i=0; i