Cleaning up compiler warnings on Linux.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3319 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-05-29 13:41:57 +00:00
parent 8e56a3c2ef
commit fc5d05394e
7 changed files with 54 additions and 42 deletions

View File

@ -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";

View File

@ -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;
}

View File

@ -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;

View File

@ -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()

View File

@ -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
}
}

View File

@ -94,7 +94,8 @@ int Rig::open(int n) {
}
} else
#endif
{
{
if(n==-99999) return -1; //Silence compiler warning
return rig_open(theRig);
}
}

View File

@ -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;
}