diff --git a/src/ANTChannel.cpp b/src/ANTChannel.cpp index 1d57d66bb..d574e4e21 100644 --- a/src/ANTChannel.cpp +++ b/src/ANTChannel.cpp @@ -224,12 +224,10 @@ void ANTChannel::channelEvent(unsigned char *ant_message) { void ANTChannel::checkCinqo() { - int version_hi, version_lo, swab_version; + int version_hi, version_lo; version_hi=(product_version >> 8) &0xff; version_lo=(product_version & 0xff); - swab_version=version_lo | (version_hi<<8); - if (!(mi.first_time_manufacturer || mi.first_time_product)) { if ((product_id == 1) && (manufacturer_id==7)) { // we are a cinqo, were we aware of this? diff --git a/src/AddIntervalDialog.cpp b/src/AddIntervalDialog.cpp index c12fc5215..22cf620aa 100644 --- a/src/AddIntervalDialog.cpp +++ b/src/AddIntervalDialog.cpp @@ -399,10 +399,8 @@ AddIntervalDialog::findFirsts(bool typeTime, const RideFile *ride, double window QList window; // ride is shorter than the window size! - if (typeTime) - if (windowSize > ride->dataPoints().last()->secs + secsDelta) return; - else - if (windowSize > ride->dataPoints().last()->km*1000) return; + if (typeTime && windowSize > ride->dataPoints().last()->secs + secsDelta) return; + else if (windowSize > ride->dataPoints().last()->km*1000) return; double rest = 0; // We're looking for intervals with durations in [windowSizeSecs, windowSizeSecs + secsDelta). @@ -521,10 +519,8 @@ AddIntervalDialog::findBests(bool typeTime, const RideFile *ride, double windowS QList window; // ride is shorter than the window size! - if (typeTime) - if (windowSize > ride->dataPoints().last()->secs + secsDelta) return; - else - if (windowSize > ride->dataPoints().last()->km*1000) return; + if (typeTime && windowSize > ride->dataPoints().last()->secs + secsDelta) return; + else if (windowSize > ride->dataPoints().last()->km*1000) return; // We're looking for intervals with durations in [windowSizeSecs, windowSizeSecs + secsDelta). foreach (const RideFilePoint *point, ride->dataPoints()) { diff --git a/src/Computrainer.cpp b/src/Computrainer.cpp index 529b93e24..73c0f358c 100644 --- a/src/Computrainer.cpp +++ b/src/Computrainer.cpp @@ -430,13 +430,6 @@ int Computrainer::restart() int Computrainer::stop() { - int status; - - // get current status - pvars.lock(); - status = this->deviceStatus; - pvars.unlock(); - // what state are we in anyway? pvars.lock(); deviceStatus = 0; // Terminate it! @@ -491,11 +484,10 @@ void Computrainer::run() int ss1,ss2,ss3, buttons, type, value8, value12; // newly read values - compared against cached values - int changed; int newmode; double newload, newgradient; double newspeed, newRRC; - bool newcalibrated, newhrconnected, newcadconnected; + bool newhrconnected, newcadconnected; bool isDeviceOpen = false; // Cached current values @@ -509,11 +501,9 @@ void Computrainer::run() double curCadence; // current cadence in RPM double curSpeed; // current speef in KPH double curRRC; // calibrated Rolling Resistance - bool curcalibrated; // is it calibrated? bool curhrconnected; // is HR sensor connected? bool curcadconnected; // is CAD sensor connected? int curButtons; // Button status - int curStatus; // Device status running, paused, disconnected // initialise local cache & main vars @@ -528,7 +518,6 @@ void Computrainer::run() curSpeed = this->deviceSpeed = 0; curButtons = this->deviceButtons; curRRC = this->deviceRRC = 0; - curcalibrated = false; this->deviceCalibrated = false; curhrconnected = false; this->deviceHRConnected = false; @@ -536,7 +525,6 @@ void Computrainer::run() this->deviceCADConnected = false; curButtons = 0; this->deviceButtons = 0; - curStatus = this->deviceStatus; pvars.unlock(); @@ -568,7 +556,6 @@ void Computrainer::run() // UPDATE BASIC TELEMETRY (HR, CAD, SPD et al) //---------------------------------------------------------------- - changed = 0; unpackTelemetry(ss1, ss2, ss3, buttons, type, value8, value12); switch (type) { @@ -578,8 +565,6 @@ void Computrainer::run() pvars.lock(); this->deviceHeartRate = curHeartRate; pvars.unlock(); - - changed=1; } break; @@ -589,8 +574,6 @@ void Computrainer::run() pvars.lock(); this->devicePower = curPower; pvars.unlock(); - - changed=1; } break; @@ -600,8 +583,6 @@ void Computrainer::run() pvars.lock(); this->deviceCadence = curCadence; pvars.unlock(); - - changed=1; } break; @@ -615,13 +596,11 @@ void Computrainer::run() pvars.lock(); this->deviceSpeed = curSpeed = newspeed; pvars.unlock(); - - changed=1; } break; case CT_RRC : - newcalibrated = value12&2048 ? true : false; + //newcalibrated = value12&2048 ? true : false; newRRC = value12&~2048; // only use 11bits newRRC /= 256; @@ -629,8 +608,6 @@ void Computrainer::run() pvars.lock(); this->deviceRRC = curRRC = newRRC; pvars.unlock(); - - changed=1; } break; @@ -643,8 +620,6 @@ void Computrainer::run() this->deviceHRConnected=curhrconnected=newhrconnected; this->deviceCADConnected=curcadconnected=newcadconnected; pvars.unlock(); - - changed=1; } break; diff --git a/src/DataFilter.cpp b/src/DataFilter.cpp index 7d96d3cd2..3aa0654df 100644 --- a/src/DataFilter.cpp +++ b/src/DataFilter.cpp @@ -254,9 +254,9 @@ bool Leaf::eval(DataFilter *df, Leaf *leaf, SummaryMetrics m) case Leaf::Operation : { - double lhsdouble, rhsdouble; + double lhsdouble=0.00, rhsdouble=0.00; QString lhsstring, rhsstring; - bool lhsisNumber, rhsisNumber; + bool lhsisNumber=false, rhsisNumber=false; // GET LHS VALUE switch (leaf->lvalue.l->type) { diff --git a/src/FitRideFile.cpp b/src/FitRideFile.cpp index 4a2df5ef2..17ccecba0 100644 --- a/src/FitRideFile.cpp +++ b/src/FitRideFile.cpp @@ -238,7 +238,6 @@ struct FitFileReaderState } void decodeEvent(const FitDefinition &def, int, const std::vector values) { - time_t time = 0; int event = -1; int event_type = -1; int i = 0; @@ -249,7 +248,8 @@ struct FitFileReaderState continue; switch (field.num) { - case 253: time = value + qbase_time.toTime_t(); break; + case 253: //time = value + qbase_time.toTime_t(); + break; case 0: event = value; break; case 1: event_type = value; break; default: ; // do nothing @@ -326,8 +326,8 @@ struct FitFileReaderState time_t time = 0; if (time_offset > 0) time = last_time + time_offset; - double alt = 0, cad = 0, km = 0, grade = 0, hr = 0, lat = 0, lng = 0, badgps = 0, lrbalance = 0; - double resistance = 0, kph = 0, temperature = RideFile::noTemp, time_from_course = 0, watts = 0; + double alt = 0, cad = 0, km = 0, hr = 0, lat = 0, lng = 0, badgps = 0, lrbalance = 0; + double kph = 0, temperature = RideFile::noTemp, watts = 0; fit_value_t lati = NA_VALUE, lngi = NA_VALUE; int i = 0; foreach(const FitField &field, def.fields) { @@ -352,9 +352,12 @@ struct FitFileReaderState case 6: kph = value * 3.6 / 1000.0; break; case 7: watts = value; break; case 8: break; // XXX packed speed/dist - case 9: grade = value / 100.0; break; - case 10: resistance = value; break; - case 11: time_from_course = value / 1000.0; break; + case 9: //grade = value / 100.0; + break; + case 10: //resistance = value; + break; + case 11: //time_from_course = value / 1000.0; + break; case 12: break; // XXX "cycle_length" case 13: temperature = value; break; case 30: lrbalance = (value & 0x80 ? 100 - (value & 0x7F) : value & 0x7F);break; diff --git a/src/GcBubble.cpp b/src/GcBubble.cpp index deedc84ba..fc2854f4f 100644 --- a/src/GcBubble.cpp +++ b/src/GcBubble.cpp @@ -32,7 +32,7 @@ static const int spikeMargin = 40; #include "Settings.h" #include "Units.h" -GcBubble::GcBubble(MainWindow *parent) : QWidget(parent, Qt::FramelessWindowHint), borderWidth(3), mainWindow(parent), parent(parent), orientation(Qt::Horizontal) +GcBubble::GcBubble(MainWindow *parent) : QWidget(parent, Qt::FramelessWindowHint), mainWindow(parent), borderWidth(3), parent(parent), orientation(Qt::Horizontal) { setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_TranslucentBackground); diff --git a/src/PolarRideFile.cpp b/src/PolarRideFile.cpp index 7e777405c..7e0492850 100644 --- a/src/PolarRideFile.cpp +++ b/src/PolarRideFile.cpp @@ -53,7 +53,6 @@ RideFile *PolarFileReader::openRideFile(QFile &file, QStringList &errors, QList< bool altitude = false; bool power = false; bool balance = false; - bool pedaling_index = false; int recInterval = 1; @@ -153,8 +152,7 @@ RideFile *PolarFileReader::openRideFile(QFile &file, QStringList &errors, QList< power = true; if (smode.length()>3 && smode.at(4)=='1') balance = true; - if (smode.length()>4 && smode.at(5)=='1') - pedaling_index = true; + //if (smode.length()>4 && smode.at(5)=='1') pedaling_index = true; /* It appears that the Polar CS600 exports its data alays in metric when downloaded from the diff --git a/src/PowerHist.cpp b/src/PowerHist.cpp index 5797e888a..52e03431a 100644 --- a/src/PowerHist.cpp +++ b/src/PowerHist.cpp @@ -43,6 +43,7 @@ #include "LTMCanvasPicker.h" // for tooltip PowerHist::PowerHist(MainWindow *mainWindow): + minX(0), rideItem(NULL), mainWindow(mainWindow), series(RideFile::watts), @@ -52,7 +53,6 @@ PowerHist::PowerHist(MainWindow *mainWindow): binw(3), withz(true), dt(1), - minX(0), absolutetime(true), cache(NULL), source(Ride) diff --git a/src/QuarqdClient.cpp b/src/QuarqdClient.cpp index 9dabe4e7b..99ce7ffeb 100644 --- a/src/QuarqdClient.cpp +++ b/src/QuarqdClient.cpp @@ -64,13 +64,11 @@ void QuarqdClient::run() { qDebug() << "Starting thread..."; int status; // control commands from controller - bool isPortOpen = false; Status = ANT_RUNNING; QString strBuf; openPort(); - isPortOpen = true; elapsedTime.start(); while(1) @@ -286,13 +284,6 @@ QuarqdClient::pause() int QuarqdClient::stop() { - int status; - - // get current status - pvars.lock(); - status = this->Status; - pvars.unlock(); - // what state are we in anyway? pvars.lock(); Status = 0; // Terminate it! diff --git a/src/RealtimeData.cpp b/src/RealtimeData.cpp index aa59f4587..6fc5be996 100644 --- a/src/RealtimeData.cpp +++ b/src/RealtimeData.cpp @@ -24,7 +24,7 @@ RealtimeData::RealtimeData() { name[0] = '\0'; - hr, watts, altWatts, speed, wheelRpm, load, slope = 0.0; + hr= watts= altWatts= speed= wheelRpm= load= slope = 0.0; cadence = distance = virtualSpeed = 0.0; lap = msecs = lapMsecs = lapMsecsRemaining = 0; diff --git a/src/RideNavigator.cpp b/src/RideNavigator.cpp index b0f032215..98445df41 100644 --- a/src/RideNavigator.cpp +++ b/src/RideNavigator.cpp @@ -324,7 +324,6 @@ void RideNavigator::setWidth(int x) // proportionally to fit into new // layout int setwidth=0; - int last=0; int newwidth=0; for (int i=1; iheader()->count(); i++) { if (tableView->header()->isSectionHidden(i) == false) { @@ -334,7 +333,6 @@ void RideNavigator::setWidth(int x) if (columnName == "*") newwidth = 0; tableView->setColumnWidth(i, newwidth); setwidth += newwidth; - last = i; } } diff --git a/src/ScatterPlot.cpp b/src/ScatterPlot.cpp index 33cbede55..b3cc38033 100644 --- a/src/ScatterPlot.cpp +++ b/src/ScatterPlot.cpp @@ -354,7 +354,6 @@ ScatterPlot::configChanged() { // setColors bg setCanvasBackground(GColor(CPLOTBACKGROUND)); - QColor grid = GColor(CPLOTGRID); } void diff --git a/src/ToolsRhoEstimator.cpp b/src/ToolsRhoEstimator.cpp index cb01555f2..85737676a 100644 --- a/src/ToolsRhoEstimator.cpp +++ b/src/ToolsRhoEstimator.cpp @@ -160,8 +160,7 @@ ToolsRhoEstimator::ToolsRhoEstimator(MainWindow *mainWindow, QWidget *parent) : this->on_valueChanged(0.0); } -void ToolsRhoEstimator::on_radio_toggled(bool checked) { - checked = true; // hack to avoid the "unused parameter" g++ warning +void ToolsRhoEstimator::on_radio_toggled(bool /* checked */) { if (impBut->isChecked()) { // we just changed from metric --> imperial, so relabel and do the diff --git a/src/TxtRideFile.cpp b/src/TxtRideFile.cpp index 4971a8cd6..fa9245c6f 100644 --- a/src/TxtRideFile.cpp +++ b/src/TxtRideFile.cpp @@ -70,6 +70,10 @@ RideFile *TxtFileReader::openRideFile(QFile &file, QStringList &errors, QListdateTime.date(); wstart = wstart.addDays(Qt::Monday - wstart.dayOfWeek()); assert(wstart.dayOfWeek() == Qt::Monday); - QDate wend = wstart.addDays(7); // weekly values QVector time_in_zone; // max 10 zones supported diff --git a/src/WkoRideFile.cpp b/src/WkoRideFile.cpp index b394fdd20..c5a12bec4 100644 --- a/src/WkoRideFile.cpp +++ b/src/WkoRideFile.cpp @@ -544,8 +544,6 @@ WkoParser::parseHeaderData(WKO_UCHAR *fb) unsigned long julian, sincemidnight; WKO_UCHAR *goal=NULL, *notes=NULL, *code=NULL; // save location of WKO metadata - enum configtype lastchart; - /* utility holders */ WKO_ULONG num; WKO_ULONG ul; @@ -790,13 +788,10 @@ WkoParser::parseHeaderData(WKO_UCHAR *fb) num=0; while (charts) { // keep parsing until we have no charts left - WKO_ULONG prev=0; enum configtype type=INVALID; - prev=num; p += donumber(p, &ul); num = ul; - lastchart = OTHER; // Each config section is preceded with // 0xff 0xff 0x01 0x00 @@ -810,14 +805,14 @@ WkoParser::parseHeaderData(WKO_UCHAR *fb) p += us; /* What type? */ - if (!strcmp(buf, "CRideSettingsConfig")) lastchart=type=CRIDESETTINGSCONFIG; - if (!strcmp(buf, "CRideGoalConfig")) lastchart=type=CRIDEGOALCONFIG; - if (!strcmp(buf, "CRideNotesConfig")) lastchart=type=CRIDENOTESCONFIG; - if (!strcmp(buf, "CDistributionChartConfig")) lastchart=type=CDISTRIBUTIONCHARTCONFIG; - if (!strcmp(buf, "CRideSummaryConfig")) lastchart=type=CRIDESUMMARYCONFIG; - if (!strcmp(buf, "CMeanMaxChartConfig"))lastchart=type=CMEANMAXCHARTCONFIG; - if (!strcmp(buf, "CMeanMaxChartCache")) lastchart=type=CMEANMAXCHARTCACHE; - if (!strcmp(buf, "CDistributionChartCache")) lastchart=type=CDISTRIBUTIONCHARTCACHE; + if (!strcmp(buf, "CRideSettingsConfig")) type=CRIDESETTINGSCONFIG; + if (!strcmp(buf, "CRideGoalConfig")) type=CRIDEGOALCONFIG; + if (!strcmp(buf, "CRideNotesConfig")) type=CRIDENOTESCONFIG; + if (!strcmp(buf, "CDistributionChartConfig")) type=CDISTRIBUTIONCHARTCONFIG; + if (!strcmp(buf, "CRideSummaryConfig")) type=CRIDESUMMARYCONFIG; + if (!strcmp(buf, "CMeanMaxChartConfig"))type=CMEANMAXCHARTCONFIG; + if (!strcmp(buf, "CMeanMaxChartCache")) type=CMEANMAXCHARTCACHE; + if (!strcmp(buf, "CDistributionChartCache")) type=CDISTRIBUTIONCHARTCACHE; if (type == CDISTRIBUTIONCHARTCACHE) {