diff --git a/devsetup.cpp b/devsetup.cpp index ae15c86c5..5c517f51c 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -31,8 +31,6 @@ void DevSetup::initDlg() const PaDeviceInfo *pdi; int nchin; int nchout; - char *p,*p1; - char p2[50]; char pa_device_name[128]; char pa_device_hostapi[128]; @@ -48,6 +46,8 @@ void DevSetup::initDlg() Pa_GetHostApiInfo(pdi->hostApi)->name); #ifdef WIN32 + char *p,*p1; + char p2[50]; p1=(char*)""; p=strstr(pa_device_hostapi,"MME"); if(p!=NULL) p1=(char*)"MME"; diff --git a/getfile.cpp b/getfile.cpp index 46a8ff67a..79a3de405 100644 --- a/getfile.cpp +++ b/getfile.cpp @@ -24,11 +24,11 @@ void getfile(QString fname, int ntrperiod) if(fp != NULL) { // Read (and ignore) a 44-byte WAV header; then read data - fread(jt9com_.d2,1,44,fp); -// fread(jt9com_.d2,2,30000,fp); - fread(jt9com_.d2,2,npts,fp); + int n=fread(jt9com_.d2,1,44,fp); + n=fread(jt9com_.d2,2,npts,fp); fclose(fp); jt9com_.newdat=1; + if(n==-99999) jt9com_.newdat=2; //Silence compiler warning } } @@ -159,7 +159,9 @@ int ptt(int nport, int ntx, int* iptt, int* nopen) *iptt=0; *nopen=0; } - if((i3+i4+i5+i6+i9+i00)==-999) return 1; //Silence compiler warning + if((i3+i4+i5+i6+i9+i00)==-999) return 1; //Silence compiler warning return 0; #endif + if((nport+ntx+(*iptt)==-99999)) *nopen=0; //Silence compiler warning + return 0; } diff --git a/logqso.cpp b/logqso.cpp index 1705f91c0..acbea045b 100644 --- a/logqso.cpp +++ b/logqso.cpp @@ -38,6 +38,7 @@ void LogQSO::initLogQSO(QString hisCall, QString hisGrid, QString mode, date=date.mid(0,4) + "-" + date.mid(4,2) + "-" + date.mid(6,2); ui->date->setText(date); ui->time->setText(qsoStart); + if(qsoStart=="") ui->time->setText(qsoStop); //Silence compiler warning m_dialFreq=dialFreq; m_myCall=myCall; m_myGrid=myGrid; diff --git a/mainwindow.cpp b/mainwindow.cpp index 9fe71e630..3d8c28837 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1437,9 +1437,7 @@ void MainWindow::readFromStdout() //readFromStdout qDebug() << "D:" << QString::fromStdWString(buffer); } } -#endif - -#ifdef unix +#else if(b and !m_diskData and okToPost) { int i1=msg.indexOf(" "); QString c2=msg.mid(i1+1); @@ -1910,6 +1908,7 @@ void MainWindow::doubleClickOnCall(bool shift, bool ctrl) if(m_decodedText2) cursor=ui->decodedTextBrowser->textCursor(); cursor.select(QTextCursor::LineUnderCursor); int i2=cursor.position(); + if(shift and i2==-9999) return; //Silence compiler warning QString t; if(!m_decodedText2) t= ui->decodedTextBrowser2->toPlainText(); //Full contents @@ -2339,29 +2338,31 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button void MainWindow::acceptQSO2(bool accepted) { - m_logQSOgeom=logDlg->geometry(); - QString date=dateTimeQSO.toString("yyyyMMdd"); - QFile f("wsjtx.log"); - if(!f.open(QIODevice::Text | QIODevice::Append)) { - msgBox("Cannot open file \"wsjtx.log\"."); - } else { - QString logEntry=dateTimeQSO.date().toString("yyyy-MMM-dd,") + - dateTimeQSO.time().toString("hh:mm,") + m_hisCall + "," + - m_hisGrid + "," + QString::number(m_dialFreq) + "," + m_mode + - "," + m_rptSent + "," + m_rptRcvd; - QTextStream out(&f); - out << logEntry << endl; - f.close(); - } - if(m_clearCallGrid) { - m_hisCall=""; - ui->dxCallEntry->setText(""); - m_hisGrid=""; - ui->dxGridEntry->setText(""); - m_rptSent=""; - m_rptRcvd=""; - m_qsoStart=""; - m_qsoStop=""; + if(accepted) { + m_logQSOgeom=logDlg->geometry(); + QString date=dateTimeQSO.toString("yyyyMMdd"); + QFile f("wsjtx.log"); + if(!f.open(QIODevice::Text | QIODevice::Append)) { + msgBox("Cannot open file \"wsjtx.log\"."); + } else { + QString logEntry=dateTimeQSO.date().toString("yyyy-MMM-dd,") + + dateTimeQSO.time().toString("hh:mm,") + m_hisCall + "," + + m_hisGrid + "," + QString::number(m_dialFreq) + "," + m_mode + + "," + m_rptSent + "," + m_rptRcvd; + QTextStream out(&f); + out << logEntry << endl; + f.close(); + } + if(m_clearCallGrid) { + m_hisCall=""; + ui->dxCallEntry->setText(""); + m_hisGrid=""; + ui->dxGridEntry->setText(""); + m_rptSent=""; + m_rptRcvd=""; + m_qsoStart=""; + m_qsoStop=""; + } } } @@ -2703,17 +2704,20 @@ void MainWindow::on_pbSend73_clicked() void MainWindow::on_rbGenMsg_toggled(bool checked) { - m_freeText=false; - m_ntx=7; - if(m_transmitting) m_restart=true; + m_freeText=!checked; + if(!m_freeText) { + m_ntx=7; + if(m_transmitting) m_restart=true; + } } void MainWindow::on_rbFreeText_toggled(bool checked) { - m_freeText=true; - m_ntx=8; - if(m_transmitting) m_restart=true; - + m_freeText=checked; + if(m_freeText) { + m_ntx=8; + if (m_transmitting) m_restart=true; + } } void MainWindow::on_freeTextMsg_editingFinished() diff --git a/plotter.cpp b/plotter.cpp index 7467828c6..7168096a0 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -490,11 +490,12 @@ void CPlotter::setPalette(QString palette) //setPalette() int n,r,g,b; float xr,xg,xb; for(int i=0; i<256; i++) { - fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb); + int nn=fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb); r=255.0*xr + 0.5; g=255.0*xg + 0.5; b=255.0*xb + 0.5; m_ColorTbl[i].setRgb(r,g,b); + if(nn==-999999) i++; //Silence compiler warning } } @@ -503,11 +504,12 @@ void CPlotter::setPalette(QString palette) //setPalette() int n,r,g,b; float xr,xg,xb; for(int i=0; i<256; i++) { - fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb); + int nn=fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb); r=255.0*xr + 0.5; g=255.0*xg + 0.5; b=255.0*xb + 0.5; m_ColorTbl[i].setRgb(r,g,b); + if(nn==-999999) i++; //Silence compiler warning } } diff --git a/rigclass.cpp b/rigclass.cpp index 35f15ada8..4e7f718ce 100644 --- a/rigclass.cpp +++ b/rigclass.cpp @@ -94,7 +94,8 @@ int Rig::open(int n) { } } else #endif - { + { + if(n==-99999) return -1; //Silence compiler warning return rig_open(theRig); } } diff --git a/soundout.cpp b/soundout.cpp index 31f67bcab..188675d0a 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -94,6 +94,8 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, ic++; } if(j>icw[0]) return paComplete; + if(statusFlags==999999 and timeInfo==NULL and + inputBuffer==NULL) return paContinue; //Silence compiler warning: return paContinue; }