From 6ed7585eec8708df0e5518cbdfeed221f305c35e Mon Sep 17 00:00:00 2001 From: Damien Date: Sat, 15 Dec 2012 17:17:34 +0100 Subject: [PATCH] Remove some warnings --- src/ANTChannel.cpp | 4 ++-- src/ANTChannel.h | 2 +- src/AddIntervalDialog.cpp | 2 +- src/Computrainer.cpp | 1 - src/ErgFilePlot.cpp | 2 +- src/GcCalendar.cpp | 2 +- src/GoldenCheetah.h | 18 +++++++++--------- src/HomeWindow.cpp | 3 +-- src/LTMPlot.cpp | 4 ++-- src/LTMWindow.cpp | 2 +- src/ManualRideFile.cpp | 2 -- src/RealtimePlot.cpp | 2 +- src/RideNavigatorProxy.h | 4 ++-- src/Serial.cpp | 3 ++- 14 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/ANTChannel.cpp b/src/ANTChannel.cpp index 0620fcbce..1d57d66bb 100644 --- a/src/ANTChannel.cpp +++ b/src/ANTChannel.cpp @@ -675,7 +675,7 @@ void ANTChannel::burstData(unsigned char *ant_message) { } // choose this one.. -void ANTChannel::setChannelID(int device_number, int device_id, int txtype) +void ANTChannel::setChannelID(int device_number, int device_id, int /*txtype*/) { parent->sendMessage(ANTMessage::setChannelID(number, device_number, device_id, 0)); // lets go back to allowing anything parent->sendMessage(ANTMessage::open(number)); // lets go back to allowing anything @@ -758,7 +758,7 @@ void ANTChannel::attemptTransition(int message_id) } // set channel timeout -int ANTChannel::setTimeout(int seconds) +void ANTChannel::setTimeout(int seconds) { parent->sendMessage(ANTMessage::setSearchTimeout(number, seconds/2.5)); } diff --git a/src/ANTChannel.h b/src/ANTChannel.h index dc99c80b2..c809f778d 100644 --- a/src/ANTChannel.h +++ b/src/ANTChannel.h @@ -156,7 +156,7 @@ class ANTChannel : public QObject { void setId(); void requestCalibrate(); void attemptTransition(int message_code); - int setTimeout(int seconds); + void setTimeout(int seconds); // telemetry for this channel double channelValue() { return value; } diff --git a/src/AddIntervalDialog.cpp b/src/AddIntervalDialog.cpp index c0deee091..c12fc5215 100644 --- a/src/AddIntervalDialog.cpp +++ b/src/AddIntervalDialog.cpp @@ -271,7 +271,7 @@ intervalDuration(const RideFilePoint *start, const RideFilePoint *stop, const Ri } static double -intervalDistance(const RideFilePoint *start, const RideFilePoint *stop, const RideFile *ride) +intervalDistance(const RideFilePoint *start, const RideFilePoint *stop, const RideFile *) { return 1000*(stop->km - start->km);// + (ride->recIntSecs()*stop->kph/3600)); } diff --git a/src/Computrainer.cpp b/src/Computrainer.cpp index 8a8716c5f..d8bcd4263 100644 --- a/src/Computrainer.cpp +++ b/src/Computrainer.cpp @@ -1004,7 +1004,6 @@ int Computrainer::rawRead(uint8_t bytes[], int size) // returns true if the device exists and false if not bool Computrainer::discover(QString filename) { - bool returning = false; uint8_t *greeting = (uint8_t *)"RacerMate"; uint8_t handshake[7]; int rc; diff --git a/src/ErgFilePlot.cpp b/src/ErgFilePlot.cpp index 523d6682e..67d6ddb05 100644 --- a/src/ErgFilePlot.cpp +++ b/src/ErgFilePlot.cpp @@ -347,7 +347,7 @@ ErgFilePlot::setData(ErgFile *ergfile) } void -ErgFilePlot::setNow(long msecs) +ErgFilePlot::setNow(long /*msecs*/) { replot(); // and update } diff --git a/src/GcCalendar.cpp b/src/GcCalendar.cpp index 881c5d869..b52d59781 100644 --- a/src/GcCalendar.cpp +++ b/src/GcCalendar.cpp @@ -708,7 +708,7 @@ GcCalendar::setSummary() } void -GcCalendar::splitterMoved(int pos, int /*index*/) +GcCalendar::splitterMoved(int /*pos*/, int /*index*/) { appsettings->setCValue(main->cyclist, GC_SETTINGS_CALSPLITTER_SIZES, splitter->saveState()); } diff --git a/src/GoldenCheetah.h b/src/GoldenCheetah.h index 409f00c12..7979b7ee3 100644 --- a/src/GoldenCheetah.h +++ b/src/GoldenCheetah.h @@ -41,10 +41,10 @@ class GcWindow; #include "GcWindowRegistry.h" -Q_DECLARE_METATYPE(QWidget*); -Q_DECLARE_METATYPE(RideItem*); -Q_DECLARE_METATYPE(GcWinID); -Q_DECLARE_METATYPE(DateRange); +Q_DECLARE_METATYPE(QWidget*) +Q_DECLARE_METATYPE(RideItem*) +Q_DECLARE_METATYPE(GcWinID) +Q_DECLARE_METATYPE(DateRange) class GcWindow : public QFrame @@ -72,15 +72,15 @@ private: Q_PROPERTY(RideItem* ride READ rideItem WRITE setRideItem NOTIFY rideItemChanged) // all charts have a date range, they don't all implement it - Q_PROPERTY(DateRange dateRange READ dateRange WRITE setDateRange NOTIFY dateRangeChanged); + Q_PROPERTY(DateRange dateRange READ dateRange WRITE setDateRange NOTIFY dateRangeChanged) // geometry factor - Q_PROPERTY(double widthFactor READ widthFactor WRITE setWidthFactor NOTIFY widthFactorChanged USER true); - Q_PROPERTY(double heightFactor READ heightFactor WRITE setHeightFactor NOTIFY heightFactorChanged USER true); + Q_PROPERTY(double widthFactor READ widthFactor WRITE setWidthFactor NOTIFY widthFactorChanged USER true) + Q_PROPERTY(double heightFactor READ heightFactor WRITE setHeightFactor NOTIFY heightFactorChanged USER true) // can be resized - Q_PROPERTY(bool resizable READ resizable WRITE setResizable USER true); - Q_PROPERTY(bool gripped READ gripped WRITE setGripped); + Q_PROPERTY(bool resizable READ resizable WRITE setResizable USER true) + Q_PROPERTY(bool gripped READ gripped WRITE setGripped) QWidget *_controls; QString _title; diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index 0ad897ce1..aa8b46adb 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -364,7 +364,7 @@ HomeWindow::rideSelected() void HomeWindow::dateRangeChanged(DateRange dr) -{ +{ Q_UNUSED( dr ) if (amVisible()) { for (int i=0; i < charts.count(); i++) { @@ -884,7 +884,6 @@ HomeWindow::eventFilter(QObject *object, QEvent *e) } } else if (e->type() == QEvent::MouseButtonPress) { - int x = ((QMouseEvent*)(e))->pos().x(); int y = ((QMouseEvent*)(e))->pos().y(); if (y<=15) { diff --git a/src/LTMPlot.cpp b/src/LTMPlot.cpp index 3116091e7..8dc6abcbc 100644 --- a/src/LTMPlot.cpp +++ b/src/LTMPlot.cpp @@ -1102,7 +1102,7 @@ LTMPlot::pointClicked(QwtPlotCurve *curve, int index) // start of date range selection void LTMPlot::pickerAppended(QPoint pos) -{ +{ Q_UNUSED( pos ) #if 0 //XXX deprecating using the ltm plot to create a date range for now... // ony work once we have a chart to do it on @@ -1175,7 +1175,7 @@ LTMPlot::pickerAppended(QPoint pos) // end of date range selection void LTMPlot::pickerMoved(QPoint pos) -{ +{ Q_UNUSED( pos ) #if 0 if (settings == NULL || settings->groupBy == LTM_TOD) return; diff --git a/src/LTMWindow.cpp b/src/LTMWindow.cpp index 422314e53..46316c9c4 100644 --- a/src/LTMWindow.cpp +++ b/src/LTMWindow.cpp @@ -202,7 +202,7 @@ LTMWindow::metricSelected() void LTMWindow::dateRangeChanged(DateRange range) -{ +{ Q_UNUSED( range ) if (!amVisible() && !dirty) return; settings.data = &results; diff --git a/src/ManualRideFile.cpp b/src/ManualRideFile.cpp index a1fc42198..95c640bf1 100644 --- a/src/ManualRideFile.cpp +++ b/src/ManualRideFile.cpp @@ -43,7 +43,6 @@ RideFile *ManualFileReader::openRideFile(QFile &file, QStringList &errors, QList * minutes,mph,watts,miles,hr,bikeScore # data */ QRegExp manualCSV("manual", Qt::CaseInsensitive); - bool manual = false; double rideSec = 0; @@ -73,7 +72,6 @@ RideFile *ManualFileReader::openRideFile(QFile &file, QStringList &errors, QList if (lineno == 1) { if (manualCSV.indexIn(line) != -1) { - manual = true; rideFile->setDeviceType("Manual"); rideFile->setFileFormat("Manual CSV (csv)"); ++lineno; diff --git a/src/RealtimePlot.cpp b/src/RealtimePlot.cpp index 36f517898..356b2fbab 100644 --- a/src/RealtimePlot.cpp +++ b/src/RealtimePlot.cpp @@ -50,7 +50,7 @@ QRectF RealtimePwrData::boundingRect() const // 30 second Power rolling avg double Realtime30PwrData::x(size_t i) const { return i ? 0 : MAXSAMPLES; } -double Realtime30PwrData::y(size_t i) const { double pwr30=0; for (int x=0; x<150; x++) { pwr30+=pwrData[x]; } pwr30 /= 150; return pwr30; } +double Realtime30PwrData::y(size_t /*i*/) const { double pwr30=0; for (int x=0; x<150; x++) { pwr30+=pwrData[x]; } pwr30 /= 150; return pwr30; } size_t Realtime30PwrData::size() const { return 150; } //QwtSeriesData *Realtime30PwrData::copy() const { return new Realtime30PwrData(const_cast(this)); } void Realtime30PwrData::init() { pwrCur=0; for (int i=0; i<150; i++) pwrData[i]=0; } diff --git a/src/RideNavigatorProxy.h b/src/RideNavigatorProxy.h index 6430dfac3..2c4433b8a 100644 --- a/src/RideNavigatorProxy.h +++ b/src/RideNavigatorProxy.h @@ -329,8 +329,8 @@ public: return sourceModel()->setHeaderData(section-2, orientation, value, role); // accomodate virtual columns else if (section == 1) // set header for virtual column ride_time starttimeHeader = value.toString(); - else - return true; + + return true; } int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { diff --git a/src/Serial.cpp b/src/Serial.cpp index f81f9e712..1ca655634 100644 --- a/src/Serial.cpp +++ b/src/Serial.cpp @@ -319,7 +319,7 @@ Serial::name() const bool Serial::setBaudRate(int speed, QString &err) -{ +{ Q_UNUSED(speed); Q_UNUSED(err); /* not yet implemented struct termios tty; @@ -328,6 +328,7 @@ Serial::setBaudRate(int speed, QString &err) assert(0); } */ + return false; } #ifndef Q_OS_WIN32