Merge branch 'feat-refactor' of bitbucket.org:g4wjs/wsjtx-refactor into feat-refactor

This commit is contained in:
Bill Somerville 2019-07-03 00:59:15 +01:00
commit 2a3e4c1e50
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
4 changed files with 22 additions and 21 deletions

View File

@ -354,6 +354,7 @@ bool BWFFile::impl::update_header ()
{ {
case BextVersion::v_0: case BextVersion::v_0:
data->version_ = qToBigEndian<quint32> (data->version_); data->version_ = qToBigEndian<quint32> (data->version_);
// fall through
default: default:
data->loudness_value_ = qToBigEndian<quint16> (data->loudness_value_); data->loudness_value_ = qToBigEndian<quint16> (data->loudness_value_);
data->loudness_range_ = qToBigEndian<quint16> (data->loudness_range_); data->loudness_range_ = qToBigEndian<quint16> (data->loudness_range_);
@ -370,6 +371,7 @@ bool BWFFile::impl::update_header ()
{ {
case BextVersion::v_0: case BextVersion::v_0:
data->version_ = qToLittleEndian<quint32> (data->version_); data->version_ = qToLittleEndian<quint32> (data->version_);
// fall through
default: default:
data->loudness_value_ = qToLittleEndian<quint16> (data->loudness_value_); data->loudness_value_ = qToLittleEndian<quint16> (data->loudness_value_);
data->loudness_range_ = qToLittleEndian<quint16> (data->loudness_range_); data->loudness_range_ = qToLittleEndian<quint16> (data->loudness_range_);

View File

@ -66,8 +66,7 @@ network_server_lookup (QString query
{ {
break; break;
} }
// drop through // fall through
case QAbstractSocket::AnyIPProtocol: case QAbstractSocket::AnyIPProtocol:
found = true; found = true;
break; break;

View File

@ -22,21 +22,21 @@
void getfile(QString fname, int ntrperiod) void getfile(QString fname, int ntrperiod)
{ {
struct WAVHDR { // struct WAVHDR {
char ariff[4]; // char ariff[4];
int lenfile; // int lenfile;
char awave[4]; // char awave[4];
char afmt[4]; // char afmt[4];
int lenfmt; // int lenfmt;
short nfmt2; // short nfmt2;
short nchan2; // short nchan2;
int nsamrate; // int nsamrate;
int nbytesec; // int nbytesec;
short nbytesam2; // short nbytesam2;
short nbitsam2; // short nbitsam2;
char adata[4]; // char adata[4];
int ndata; // int ndata;
} hdr; // } hdr;
char name[512]; char name[512];
strncpy(name,fname.toLatin1(), sizeof (name) - 1); strncpy(name,fname.toLatin1(), sizeof (name) - 1);
@ -93,10 +93,10 @@ void getfile(QString fname, int ntrperiod)
if (!memcmp(desc.id,"data",sizeof desc.id)) break; if (!memcmp(desc.id,"data",sizeof desc.id)) break;
} while (!fseek(fp,(desc.size + 1) / 2 * 2,SEEK_CUR)); } while (!fseek(fp,(desc.size + 1) / 2 * 2,SEEK_CUR));
// Read (and ignore) a 44-byte WAV header; then read data // Read (and ignore) a 44-byte WAV header; then read data
// int n=fread(&hdr,1,44,fp); // int n=fread(&hdr,1,44,fp);
int n=fread(dec_data.d2,2,npts,fp); int n=fread(dec_data.d2,2,npts,fp);
if(hdr.nsamrate==11025) wav12_(dec_data.d2,dec_data.d2,&n,(short*)&fmt.nbitsam2); if(fmt.nsamrate==11025) wav12_(dec_data.d2,dec_data.d2,&n,(short*)&fmt.nbitsam2);
fclose(fp); fclose(fp);
dec_data.params.newdat=1; dec_data.params.newdat=1;
dec_data.params.kin=n; dec_data.params.kin=n;

View File

@ -10,7 +10,7 @@ QValidator::State RestrictedSpinBox::validate (QString& input, int& pos) const
// start by doing the standard QSpinBox validation // start by doing the standard QSpinBox validation
auto valid = HintedSpinBox::validate (input, pos); auto valid = HintedSpinBox::validate (input, pos);
// extra validation // extra validation
if (QValidator::Acceptable if (QValidator::Acceptable == valid
&& values ().end () == std::find (values ().begin (), values ().end (), valueFromText (input))) && values ().end () == std::find (values ().begin (), values ().end (), valueFromText (input)))
{ {
valid = QValidator::Intermediate; valid = QValidator::Intermediate;