Remove Boost

Replace boost checksum stuff.
Remove boost from versions
Remove Boost from src.pro
Remove Boost from gcconfig.pri.in
This commit is contained in:
Andy Bryson
2012-12-29 21:10:15 +00:00
parent ecf2f03abe
commit 49d8eb0fc3
9 changed files with 34 additions and 58 deletions

View File

@@ -3,7 +3,6 @@
#include "DBAccess.h"
#include "MetricAggregator.h"
#include <QtSql>
#include <boost/version.hpp>
#ifndef GC_VERSION
#define GC_VERSION "(developer build)"
@@ -221,26 +220,24 @@ VersionPage::VersionPage(MainWindow *main, QDir home) : main(main), home(home)
"<table>"
"<tr><td colspan=\"2\">QT</td><td>%1</td></tr>"
"<tr><td colspan=\"2\">QWT</td><td>%2</td></tr>"
"<tr><td colspan=\"2\">BOOST</td><td>%3</td></tr>"
"<tr><td colspan=\"2\">GCC</td><td>%4</td></tr>"
"<tr><td colspan=\"2\">SRMIO</td><td>%5</td></tr>"
"<tr><td colspan=\"2\">OAUTH</td><td>%6</td></tr>"
"<tr><td colspan=\"2\">D2XX</td><td>%7</td></tr>"
"<tr><td colspan=\"2\">QWTPLOT3D</td><td>%8</td></tr>"
"<tr><td colspan=\"2\">KML</td><td>%9</td></tr>"
"<tr><td colspan=\"2\">ICAL</td><td>%10</td></tr>"
"<tr><td colspan=\"2\">USBXPRESS</td><td>%11</td></tr>"
"<tr><td colspan=\"2\">LIBUSB</td><td>%12</td></tr>"
"<tr><td colspan=\"2\">VLC</td><td>%13</td></tr>"
"<tr><td colspan=\"2\">LUCENE</td><td>%14</td></tr>"
"<tr><td colspan=\"2\">GCC</td><td>%3</td></tr>"
"<tr><td colspan=\"2\">SRMIO</td><td>%4</td></tr>"
"<tr><td colspan=\"2\">OAUTH</td><td>%5</td></tr>"
"<tr><td colspan=\"2\">D2XX</td><td>%6</td></tr>"
"<tr><td colspan=\"2\">QWTPLOT3D</td><td>%7</td></tr>"
"<tr><td colspan=\"2\">KML</td><td>%8</td></tr>"
"<tr><td colspan=\"2\">ICAL</td><td>%9</td></tr>"
"<tr><td colspan=\"2\">USBXPRESS</td><td>%10</td></tr>"
"<tr><td colspan=\"2\">LIBUSB</td><td>%11</td></tr>"
"<tr><td colspan=\"2\">VLC</td><td>%12</td></tr>"
"<tr><td colspan=\"2\">LUCENE</td><td>%13</td></tr>"
#ifdef Q_OS_MAC
"<tr><td colspan=\"2\">LION SUPPORT</td><td>%15</td></tr>"
"<tr><td colspan=\"2\">LION SUPPORT</td><td>%14</td></tr>"
#endif
"</table>"
)
.arg(QT_VERSION_STR)
.arg(QWT_VERSION_STR)
.arg(BOOST_LIB_VERSION)
.arg(GCC_VERSION)
.arg(srmio)
.arg(oauth)

View File

@@ -34,8 +34,6 @@
#include "RideMetadata.h"
#include "SpecialFields.h"
#include <boost/crc.hpp>
// DB Schema Version - YOU MUST UPDATE THIS IF THE SCHEMA VERSION CHANGES!!!
// Schema version will change if a) the default metadata.xml is updated
// or b) new metrics are added / old changed
@@ -139,12 +137,7 @@ computeFileCRC(QString filename)
rawstream->readRawData(&data[0], file.size());
file.close();
// calculate the CRC
boost::crc_optimal<16, 0x1021, 0xFFFF, 0, false, false> CRC;
CRC.process_bytes(&data[0], file.size());
return CRC.checksum();
return qChecksum(&data[0], file.size());
}
bool DBAccess::createMetricsTable()

View File

@@ -25,7 +25,6 @@
#include <qcolor.h>
#include <assert.h>
#include <math.h>
#include <boost/crc.hpp>
// the infinity endpoints are indicated with extreme date ranges
@@ -850,29 +849,27 @@ int HrZones::insertRangeAtDate(QDate date, int lt) {
return rnum;
}
unsigned long
quint16
HrZones::getFingerprint() const
{
boost::crc_optimal<16, 0x1021, 0xFFFF, 0, false, false> CRC;
quint64 x = 0;
for (int i=0; i<ranges.size(); i++) {
// from
int x = ranges[i].begin.toJulianDay();
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].begin.toJulianDay();
// to
x = ranges[i].end.toJulianDay();
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].end.toJulianDay();
// CP
x = ranges[i].lt;
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].lt;
// each zone definition (manual edit/default changed)
for (int j=0; j<ranges[i].zones.count(); j++) {
x = ranges[i].zones[j].lo;
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].zones[j].lo;
}
}
return CRC.checksum();
QByteArray ba = QByteArray::number(x);
return qChecksum(ba, ba.length());
}

View File

@@ -207,7 +207,7 @@ class HrZones : public QObject
// calculate a CRC for the zones data - used to see if zones
// data is changed since last referenced in Metric code
// could also be used in Configuration pages (later)
unsigned long getFingerprint() const;
quint16 getFingerprint() const;
};
QColor hrZoneColor(int zone, int num_zones);

View File

@@ -106,7 +106,8 @@ void MetricAggregator::refreshMetrics(QDateTime forceAfterThisDate)
}
}
unsigned long zoneFingerPrint = zones->getFingerprint() + hrzones->getFingerprint(); // crc of *all* zone data (HR and Power)
unsigned long zoneFingerPrint = static_cast<unsigned long>(zones->getFingerprint())
+ static_cast<unsigned long>(hrzones->getFingerprint()); // checksum of *all* zone data (HR and Power)
// update statistics for ride files which are out of date
// showing a progress bar as we go

View File

@@ -26,7 +26,6 @@
#include <qcolor.h>
#include <assert.h>
#include <math.h>
#include <boost/crc.hpp>
// the infinity endpoints are indicated with extreme date ranges
@@ -826,29 +825,26 @@ int Zones::insertRangeAtDate(QDate date, int cp) {
return rnum;
}
unsigned long
quint16
Zones::getFingerprint() const
{
boost::crc_optimal<16, 0x1021, 0xFFFF, 0, false, false> CRC;
quint64 x = 0;
for (int i=0; i<ranges.size(); i++) {
// from
int x = ranges[i].begin.toJulianDay();
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].begin.toJulianDay();
// to
x = ranges[i].end.toJulianDay();
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].end.toJulianDay();
// CP
x = ranges[i].cp;
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].cp;
// each zone definition (manual edit/default changed)
for (int j=0; j<ranges[i].zones.count(); j++) {
x = ranges[i].zones[j].lo;
CRC.process_bytes(&x, sizeof(int));
x += ranges[i].zones[j].lo;
}
}
return CRC.checksum() + (appsettings->value(this, GC_ELEVATION_HYSTERESIS).toDouble()*10);
QByteArray ba = QByteArray::number(x);
return qChecksum(ba, ba.length()) + (appsettings->value(this, GC_ELEVATION_HYSTERESIS).toDouble()*10);
}

View File

@@ -193,7 +193,7 @@ class Zones : public QObject
// calculate a CRC for the zones data - used to see if zones
// data is changed since last referenced in Metric code
// could also be used in Configuration pages (later)
unsigned long getFingerprint() const;
quint16 getFingerprint() const;
};
QColor zoneColor(int zone, int num_zones);

View File

@@ -32,12 +32,6 @@
# QMAKE_DEL_FILE = rm -f
#}
# Set path to the root of the boost include files.
# If the files are in /usr/include/boost then set
# BOOST_INCLUDE = /usr/include
# If you do not define BOOST_INCLUDE the application may or may not compile.
BOOST_INCLUDE =
# If you want SRM download support you must install SRMIO
# http://www.zuto.de/project/srmio/
# Set path to the root of the SRMIO installation

View File

@@ -8,8 +8,6 @@ TARGET = GoldenCheetah
!isEmpty( APP_NAME ) { TARGET = $${APP_NAME} }
DEPENDPATH += .
!isEmpty( BOOST_INCLUDE ) { INCLUDEPATH += $${BOOST_INCLUDE} }
INCLUDEPATH += ../qwt/src ../qxt/src $${LIBZ_INCLUDE}
QT += xml sql network webkit script
LIBS += ../qwt/lib/libqwt.a