mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Remove warnings
This commit is contained in:
@@ -1021,7 +1021,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx)
|
||||
double *smoothA = &plot->smoothAltitude[startidx];
|
||||
double *smoothD = &plot->smoothDistance[startidx];
|
||||
double *smoothTE = &plot->smoothTemp[startidx];
|
||||
double *smoothWND = &plot->smoothWind[startidx];
|
||||
//double *smoothWND = &plot->smoothWind[startidx];
|
||||
double *smoothNM = &plot->smoothTorque[startidx];
|
||||
double *smoothBALL = &plot->smoothBalanceL[startidx];
|
||||
double *smoothBALR = &plot->smoothBalanceR[startidx];
|
||||
|
||||
@@ -108,7 +108,7 @@ struct Bin2FileReaderState
|
||||
QDateTime date = read_date(bytes_read, sum);
|
||||
|
||||
read_bytes(1, bytes_read, sum); // dummy
|
||||
int time_moving = read_bytes(4, bytes_read, sum);
|
||||
read_bytes(4, bytes_read, sum); // time_moving
|
||||
*secs = double(read_bytes(4, bytes_read, sum));
|
||||
read_bytes(16, bytes_read, sum); // dummy
|
||||
|
||||
@@ -129,10 +129,10 @@ struct Bin2FileReaderState
|
||||
void read_detail_record(double *secs, int *bytes_read = NULL, int *sum = NULL)
|
||||
{
|
||||
int cad = read_bytes(1, bytes_read, sum);
|
||||
int pedal_smoothness = read_bytes(1, bytes_read, sum);
|
||||
read_bytes(1, bytes_read, sum); // pedal_smoothness
|
||||
int lrbal = read_bytes(1, bytes_read, sum);
|
||||
int hr = read_bytes(1, bytes_read, sum);
|
||||
int dummy = read_bytes(1, bytes_read, sum);
|
||||
read_bytes(1, bytes_read, sum); // dummy
|
||||
int watts = read_bytes(2, bytes_read, sum);
|
||||
int nm = read_bytes(2, bytes_read, sum);
|
||||
double kph = read_bytes(2, bytes_read, sum);
|
||||
@@ -191,8 +191,8 @@ struct Bin2FileReaderState
|
||||
|
||||
void read_ride_summary(int *bytes_read = NULL, int *sum = NULL)
|
||||
{
|
||||
char data_version = read_bytes(1, bytes_read, sum);
|
||||
char firmware_minor_version = read_bytes(1, bytes_read, sum);
|
||||
read_bytes(1, bytes_read, sum); // data_version
|
||||
read_bytes(1, bytes_read, sum); // firmware_minor_version
|
||||
|
||||
QDateTime t = read_date(bytes_read, sum);
|
||||
|
||||
@@ -219,7 +219,7 @@ struct Bin2FileReaderState
|
||||
int smartbelt_A = read_bytes(2, bytes_read, sum);
|
||||
int smartbelt_B = read_bytes(2, bytes_read, sum);
|
||||
int smartbelt_C = read_bytes(2, bytes_read, sum);
|
||||
//deviceInfo += QString("Smartbelt %1-%2-%3\n").arg(smartbelt_A).arg(smartbelt_B).arg(smartbelt_C);
|
||||
deviceInfo += QString("Smartbelt %1-%2-%3\n").arg(smartbelt_A).arg(smartbelt_B).arg(smartbelt_C);
|
||||
|
||||
read_bytes(42, bytes_read, sum);
|
||||
}
|
||||
@@ -231,10 +231,8 @@ struct Bin2FileReaderState
|
||||
if (device_type < 255) {
|
||||
QString text = read_text(20, bytes_read, sum);
|
||||
while(text.endsWith( QChar(0) )) text.chop(1);
|
||||
QChar *chr = text.end();
|
||||
int i = chr->toAscii();
|
||||
|
||||
int flag = read_bytes(1, bytes_read, sum);
|
||||
read_bytes(1, bytes_read, sum); // flag
|
||||
uint16_t id = read_bytes(2, bytes_read, sum);
|
||||
read_bytes(2, bytes_read, sum);
|
||||
read_bytes(2, bytes_read, sum);
|
||||
@@ -281,7 +279,7 @@ struct Bin2FileReaderState
|
||||
read_bytes(1, &bytes_read, &sum); // to finish
|
||||
}
|
||||
|
||||
char checksum = read_bytes(1, &bytes_read, &sum);
|
||||
read_bytes(1, &bytes_read, &sum); // checksum
|
||||
|
||||
} else {
|
||||
// not a summary page !
|
||||
@@ -304,7 +302,7 @@ struct Bin2FileReaderState
|
||||
|
||||
if (header1 == 0x10 && header2 == 0x02 && command == 0x2022)
|
||||
{
|
||||
uint16_t length = read_bytes(2, &bytes_read, &sum);
|
||||
read_bytes(2, &bytes_read, &sum); // length
|
||||
uint16_t page_number = read_bytes(2, &bytes_read, &sum); // Page #
|
||||
|
||||
if (page_number > 0) {
|
||||
@@ -342,7 +340,7 @@ struct Bin2FileReaderState
|
||||
}
|
||||
|
||||
}
|
||||
char checksum = read_bytes(1, &bytes_read, &sum);
|
||||
read_bytes(1, &bytes_read, &sum); // checksum
|
||||
|
||||
}
|
||||
|
||||
@@ -362,7 +360,7 @@ struct Bin2FileReaderState
|
||||
|
||||
if (header == START && command == UNIT_VERSION)
|
||||
{
|
||||
uint16_t length = read_bytes(2, &bytes_read, &sum);
|
||||
read_bytes(2, &bytes_read, &sum); // length
|
||||
|
||||
int major_version = read_bytes(1, &bytes_read, &sum);
|
||||
int minor_version = read_bytes(2, &bytes_read, &sum);
|
||||
@@ -371,7 +369,7 @@ struct Bin2FileReaderState
|
||||
QString version = QString(minor_version<100?"%1.0%2 (%3)":"%1.%2 (%3)").arg(major_version).arg(minor_version).arg(data_version);
|
||||
deviceInfo += rideFile->deviceType()+QString(" Version %1\n").arg(version);
|
||||
|
||||
char checksum = read_bytes(1, &bytes_read, &sum);
|
||||
read_bytes(1, &bytes_read, &sum); // checksum
|
||||
}
|
||||
return bytes_read;
|
||||
}
|
||||
@@ -387,13 +385,13 @@ struct Bin2FileReaderState
|
||||
|
||||
if (header == START && command == SYSTEM_INFO)
|
||||
{
|
||||
uint16_t length = read_bytes(2, &bytes_read, &sum);
|
||||
read_bytes(2, &bytes_read, &sum); // length
|
||||
|
||||
read_bytes(52, &bytes_read, &sum);
|
||||
uint16_t odometer = read_bytes(8, &bytes_read, &sum);
|
||||
deviceInfo += QString("Odometer %1km\n").arg(odometer/1000.0);
|
||||
|
||||
char checksum = read_bytes(1, &bytes_read, &sum);
|
||||
read_bytes(1, &bytes_read, &sum); // checksum
|
||||
}
|
||||
return bytes_read;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,9 @@ DiaryWindow::rideSelected()
|
||||
QDate when = ride->dateTime.date();
|
||||
int month = when.month();
|
||||
int year = when.year();
|
||||
#if 0
|
||||
int weekNumber = when.weekNumber();
|
||||
#endif
|
||||
|
||||
// monthly view updates
|
||||
calendarModel->setMonth(when.month(), when.year());
|
||||
|
||||
@@ -93,7 +93,7 @@ readOneByOne(CommPortPtr dev, void *buf, size_t nbyte, QString &err)
|
||||
char * data = ((char *)buf);
|
||||
int rtn=0;
|
||||
|
||||
for (int i = 0; i < nbyte; i++)
|
||||
for (size_t i = 0; i < nbyte; i++)
|
||||
{
|
||||
int n = dev->read(data + i, 1, err);
|
||||
if (n <= 0) {
|
||||
@@ -144,7 +144,7 @@ JouleDevice::download( const QDir &tmpdir,
|
||||
return false;
|
||||
|
||||
for (int i=0; i<trainings.count(); i++) {
|
||||
statusCallback(QString("Read ride detail for ride %1/%2").arg(i+1).arg(trainings.count()));
|
||||
progressCallback(QString("Read ride detail for ride %1/%2").arg(i+1).arg(trainings.count()));
|
||||
JoulePacket request(READ_RIDE_DETAIL);
|
||||
int id1 = (trainings.at(i).id>255?trainings.at(i).id-255:trainings.at(i).id);
|
||||
int id2 = (trainings.at(i).id>255?trainings.at(i).id%255:0);
|
||||
@@ -317,7 +317,7 @@ JouleDevice::getSystemInfo(JoulePacket &response, QString &err)
|
||||
|
||||
if (response.payload.length()>3) {
|
||||
//array = response.dataArray();
|
||||
int serial = qByteArray2Int(response.payload.left(4));
|
||||
//int = qByteArray2Int(response.payload.left(4));
|
||||
//QString system = QString("%1").arg(serial);
|
||||
|
||||
return true;
|
||||
@@ -344,8 +344,11 @@ JouleDevice::getUnitFreeSpace(QString &memory, QString &err)
|
||||
int total = qByteArray2Int(response1.payload.right(2));
|
||||
int percentage = 100 * empty / total;
|
||||
memory = QString("%1/%2 (%3%)").arg(empty).arg(total).arg(percentage);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -547,6 +547,7 @@ RideFile::decimalsFor(SeriesType series)
|
||||
case interval : return 0; break;
|
||||
case vam : return 0; break;
|
||||
case wattsKg : return 2; break;
|
||||
case lrbalance : return 1; break;
|
||||
case none : break;
|
||||
}
|
||||
return 2; // default
|
||||
@@ -574,6 +575,7 @@ RideFile::maximumFor(SeriesType series)
|
||||
case interval : return 999; break;
|
||||
case vam : return 9999; break;
|
||||
case wattsKg : return 50; break;
|
||||
case lrbalance : return 100; break;
|
||||
case none : break;
|
||||
}
|
||||
return 9999; // default
|
||||
@@ -601,6 +603,7 @@ RideFile::minimumFor(SeriesType series)
|
||||
case interval : return 0; break;
|
||||
case vam : return 0; break;
|
||||
case wattsKg : return 0; break;
|
||||
case lrbalance : return 0; break;
|
||||
case none : break;
|
||||
}
|
||||
return 0; // default
|
||||
|
||||
@@ -116,8 +116,10 @@ int
|
||||
RideFileCache::decimalsFor(RideFile::SeriesType series)
|
||||
{
|
||||
switch (series) {
|
||||
case RideFile::secs : return 0; break;
|
||||
case RideFile::cad : return 0; break;
|
||||
case RideFile::hr : return 0; break;
|
||||
case RideFile::km : return 3; break;
|
||||
case RideFile::kph : return 1; break;
|
||||
case RideFile::nm : return 2; break;
|
||||
case RideFile::watts : return 0; break;
|
||||
@@ -132,6 +134,7 @@ RideFileCache::decimalsFor(RideFile::SeriesType series)
|
||||
case RideFile::interval : return 0; break;
|
||||
case RideFile::vam : return 0; break;
|
||||
case RideFile::wattsKg : return 2; break;
|
||||
case RideFile::lrbalance : return 1; break;
|
||||
case RideFile::none : break;
|
||||
}
|
||||
return 2; // default
|
||||
|
||||
@@ -181,7 +181,7 @@ struct SyncFileReaderState
|
||||
|
||||
QDateTime t = QDateTime(QDate(2000+year,month,day), QTime(hour,min,sec));
|
||||
|
||||
if (secs == 0.0 || rideFile->startTime().toTime_t()<0) {
|
||||
if (secs == 0.0) { // || rideFile->startTime().toTime_t()<0
|
||||
rideFile->setStartTime(t);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user